diff --git a/Phraseanet-production-client/dist/account.js b/Phraseanet-production-client/dist/account.js index e81551f30d..48802883e2 100644 --- a/Phraseanet-production-client/dist/account.js +++ b/Phraseanet-production-client/dist/account.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 245); +/******/ return __webpack_require__(__webpack_require__.s = 281); /******/ }) /************************************************************************/ /******/ ({ @@ -83,31 +83,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -2235,7 +2327,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -2594,7 +2686,7 @@ process.umask = function() { return 0; }; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -3013,424 +3105,12 @@ var I18n = function (_EventEmitter) { /***/ }), -/***/ 245: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(246); - - -/***/ }), - -/***/ 246: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _bootstrap = __webpack_require__(247); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var accountApp = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.accountApp = accountApp; -} - -module.exports = accountApp; - -/***/ }), - -/***/ 247: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _config = __webpack_require__(248); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _account = __webpack_require__(249); - -var _account2 = _interopRequireDefault(_account); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -(0, _jquery2.default)(document).ready(function () { - // hide or show callback url input whether user choose a web or dektop application - (0, _jquery2.default)('#form_create input[name=type]').bind('click', function () { - if ((0, _jquery2.default)(this).val() === 'desktop') { - (0, _jquery2.default)('#form_create .callback-control-group').hide().find('input').val(''); - } else { - (0, _jquery2.default)('#form_create .callback-control-group').show(); - } - }); -}); - -var Bootstrap = function () { - function Bootstrap(userConfig) { - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.onConfigReady(); - - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - var accountService = (0, _account2.default)(_this.appServices); - - accountService.initialize({ - $container: (0, _jquery2.default)('body') - }); - - switch (_this.configService.get('state')) { - case 'editAccount': - accountService.editAccount(); - break; - case 'editSession': - accountService.editSession(); - break; - default: - } - }); - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 248: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/prod/language.json' -}; - -exports.default = defaultConfig; - -/***/ }), - -/***/ 249: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _geonames = __webpack_require__(54); - -var _geonames2 = _interopRequireDefault(_geonames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var account = function account(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - - var initialize = function initialize(options) { - var $container = options.$container; - - $container.on('click', '.alert .alert-block-close a', function (e) { - e.preventDefault(); - (0, _jquery2.default)(this).closest('.alert').alert('close'); - return false; - }); - - // revoke third party application access - (0, _jquery2.default)('a.app-btn').bind('click', function (e) { - e.preventDefault(); - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'GET', - url: $this.attr('href'), - dataType: 'json', - data: { revoke: $this.hasClass('authorize') ? 0 : 1 }, - success: function success(data) { - if (data.success) { - var li = $this.closest('li'); - - var hidden = (0, _jquery2.default)('.app-btn.hidden , .status.hidden', li); - var notHidden = (0, _jquery2.default)('.app-btn:not(.hidden), .status:not(.hidden)', li); - - hidden.removeClass('hidden'); - notHidden.addClass('hidden'); - } - } - }); - }); - - // generate new access token - (0, _jquery2.default)('a#generate_access').bind('click', function (e) { - e.preventDefault(); - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'POST', - url: $this.attr('href'), - dataType: 'json', - data: { - usr_id: $this.closest('div').attr('id') - }, - success: function success(data) { - if (data.success) { - (0, _jquery2.default)('#my_access_token').empty().append(data.token); - } - } - }); - }); - - //modify application callback url - (0, _jquery2.default)('.modifier_callback').bind('click', function () { - var modifierBtn = (0, _jquery2.default)(this); - var saveBtn = (0, _jquery2.default)('a.save_callback'); - var input = (0, _jquery2.default)('.url_callback_input'); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input.empty().wrapInner('' + ''); - - (0, _jquery2.default)('.url_callback').off(); - - // save new callback - saveBtn.bind('click', function (e) { - e.preventDefault(); - var callback = (0, _jquery2.default)('input[name=oauth_callback]').val(); - _jquery2.default.ajax({ - type: 'POST', - url: saveBtn.attr('href'), - dataType: 'json', - data: { callback: callback }, - success: function success(data) { - if (data.success) { - input.empty().append(callback); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - //modify application webhook url - (0, _jquery2.default)('.webhook-modify-btn').bind('click', function () { - var modifierBtn = (0, _jquery2.default)(this); - var saveBtn = (0, _jquery2.default)('a.save_webhook'); - var input = (0, _jquery2.default)('.url_webhook_input'); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input.empty().wrapInner('' + ''); - - (0, _jquery2.default)('.url_webhook').off(); - - // save new callback - saveBtn.bind('click', function (e) { - e.preventDefault(); - var webhook = (0, _jquery2.default)('input[name=oauth_webhook]').val(); - _jquery2.default.ajax({ - type: 'POST', - url: saveBtn.attr('href'), - dataType: 'json', - data: { webhook: webhook }, - success: function success(data) { - if (data.success) { - input.empty().append(webhook); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - // hide or show callback url input whether user choose a web or dektop application - /* $('#form_create input[name=type]').bind('click', function () { - if ($(this).val() === 'desktop') { - $('#form_create .callback-control-group').hide().find('input').val(''); - } else { - $('#form_create .callback-control-group').show(); - } - });*/ - - // authorize password grant type or not - (0, _jquery2.default)('.grant-type').bind('click', function () { - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'POST', - url: $this.attr('value'), - dataType: 'json', - data: { grant: $this.is(':checked') ? '1' : '0' }, - success: function success(data) {} - }); - }); - - // delete an application - /* $('a.delete-app').bind('click', function (e) { - e.preventDefault(); - var $this = $(this); - var li = $this.closest('li'); - $.ajax({ - type: 'DELETE', - url: $this.attr('href'), - dataType: 'json', - data: {}, - success: function (data) { - if (data.success) { - li.find('.modal').modal('hide'); - li.remove(); - } - } - }); - });*/ - }; - - var editAccount = function editAccount() { - (0, _jquery2.default)('legend').bind('click', function () { - (0, _jquery2.default)('.form-info').hide(200); - (0, _jquery2.default)((0, _jquery2.default)(this).data('target')).show(); - }); - - _geonames2.default.init((0, _jquery2.default)('#form_geonameid'), { - server: configService.get('geonameServerUrl'), - limit: 40 - }); - }; - - var editSession = function editSession() { - var modal = (0, _jquery2.default)('#modal-delete-confirm').modal({ - show: false - }); - - (0, _jquery2.default)('a.delete-session').bind('click', function (e) { - e.preventDefault(); - modal.data('delete-url', (0, _jquery2.default)(this).prop('href')).modal('toggle'); - - return false; - }); - - (0, _jquery2.default)('a.confirm-delete').on('click', function (e) { - e.preventDefault(); - _jquery2.default.ajax({ - type: 'POST', - url: modal.data('delete-url'), - dataType: 'json', - success: function success(data) { - if (data.success) { - (0, _jquery2.default)('#row-' + data.session_id).closest('tr').remove(); - } - modal.modal('toggle'); - } - }); - }); - }; - - return { initialize: initialize, editAccount: editAccount, editSession: editSession }; -}; -exports.default = account; - -/***/ }), - /***/ 25: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -3582,10 +3262,10 @@ var ResourceStore = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -4184,11 +3864,423 @@ var PluralResolver = function () { /***/ }), +/***/ 281: +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(282); + + +/***/ }), + +/***/ 282: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _bootstrap = __webpack_require__(283); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var accountApp = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.accountApp = accountApp; +} + +module.exports = accountApp; + +/***/ }), + +/***/ 283: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +var _config = __webpack_require__(284); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _account = __webpack_require__(285); + +var _account2 = _interopRequireDefault(_account); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +(0, _jquery2.default)(document).ready(function () { + // hide or show callback url input whether user choose a web or dektop application + (0, _jquery2.default)('#form_create input[name=type]').bind('click', function () { + if ((0, _jquery2.default)(this).val() === 'desktop') { + (0, _jquery2.default)('#form_create .callback-control-group').hide().find('input').val(''); + } else { + (0, _jquery2.default)('#form_create .callback-control-group').show(); + } + }); +}); + +var Bootstrap = function () { + function Bootstrap(userConfig) { + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.onConfigReady(); + + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + var accountService = (0, _account2.default)(_this.appServices); + + accountService.initialize({ + $container: (0, _jquery2.default)('body') + }); + + switch (_this.configService.get('state')) { + case 'editAccount': + accountService.editAccount(); + break; + case 'editSession': + accountService.editSession(); + break; + default: + } + }); + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 284: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/prod/language.json' +}; + +exports.default = defaultConfig; + +/***/ }), + +/***/ 285: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _geonames = __webpack_require__(56); + +var _geonames2 = _interopRequireDefault(_geonames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var account = function account(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + + var initialize = function initialize(options) { + var $container = options.$container; + + $container.on('click', '.alert .alert-block-close a', function (e) { + e.preventDefault(); + (0, _jquery2.default)(this).closest('.alert').alert('close'); + return false; + }); + + // revoke third party application access + (0, _jquery2.default)('a.app-btn').bind('click', function (e) { + e.preventDefault(); + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'GET', + url: $this.attr('href'), + dataType: 'json', + data: { revoke: $this.hasClass('authorize') ? 0 : 1 }, + success: function success(data) { + if (data.success) { + var li = $this.closest('li'); + + var hidden = (0, _jquery2.default)('.app-btn.hidden , .status.hidden', li); + var notHidden = (0, _jquery2.default)('.app-btn:not(.hidden), .status:not(.hidden)', li); + + hidden.removeClass('hidden'); + notHidden.addClass('hidden'); + } + } + }); + }); + + // generate new access token + (0, _jquery2.default)('a#generate_access').bind('click', function (e) { + e.preventDefault(); + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('href'), + dataType: 'json', + data: { + usr_id: $this.closest('div').attr('id') + }, + success: function success(data) { + if (data.success) { + (0, _jquery2.default)('#my_access_token').empty().append(data.token); + } + } + }); + }); + + //modify application callback url + (0, _jquery2.default)('.modifier_callback').bind('click', function () { + var modifierBtn = (0, _jquery2.default)(this); + var saveBtn = (0, _jquery2.default)('a.save_callback'); + var input = (0, _jquery2.default)('.url_callback_input'); + var inputVal = input.html(); + + modifierBtn.hide(); + saveBtn.show(); + // wrapp current calback in an input + input.empty().wrapInner('' + ''); + + (0, _jquery2.default)('.url_callback').off(); + + // save new callback + saveBtn.bind('click', function (e) { + e.preventDefault(); + var callback = (0, _jquery2.default)('input[name=oauth_callback]').val(); + _jquery2.default.ajax({ + type: 'POST', + url: saveBtn.attr('href'), + dataType: 'json', + data: { callback: callback }, + success: function success(data) { + if (data.success) { + input.empty().append(callback); + } else { + input.empty().append(inputVal); + } + + modifierBtn.show(); + saveBtn.hide(); + } + }); + }); + }); + + //modify application webhook url + (0, _jquery2.default)('.webhook-modify-btn').bind('click', function () { + var modifierBtn = (0, _jquery2.default)(this); + var saveBtn = (0, _jquery2.default)('a.save_webhook'); + var input = (0, _jquery2.default)('.url_webhook_input'); + var inputVal = input.html(); + + modifierBtn.hide(); + saveBtn.show(); + // wrapp current calback in an input + input.empty().wrapInner('' + ''); + + (0, _jquery2.default)('.url_webhook').off(); + + // save new callback + saveBtn.bind('click', function (e) { + e.preventDefault(); + var webhook = (0, _jquery2.default)('input[name=oauth_webhook]').val(); + _jquery2.default.ajax({ + type: 'POST', + url: saveBtn.attr('href'), + dataType: 'json', + data: { webhook: webhook }, + success: function success(data) { + if (data.success) { + input.empty().append(webhook); + } else { + input.empty().append(inputVal); + } + + modifierBtn.show(); + saveBtn.hide(); + } + }); + }); + }); + + // hide or show callback url input whether user choose a web or dektop application + /* $('#form_create input[name=type]').bind('click', function () { + if ($(this).val() === 'desktop') { + $('#form_create .callback-control-group').hide().find('input').val(''); + } else { + $('#form_create .callback-control-group').show(); + } + });*/ + + // authorize password grant type or not + (0, _jquery2.default)('.grant-type').bind('click', function () { + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('value'), + dataType: 'json', + data: { grant: $this.is(':checked') ? '1' : '0' }, + success: function success(data) {} + }); + }); + + // delete an application + /* $('a.delete-app').bind('click', function (e) { + e.preventDefault(); + var $this = $(this); + var li = $this.closest('li'); + $.ajax({ + type: 'DELETE', + url: $this.attr('href'), + dataType: 'json', + data: {}, + success: function (data) { + if (data.success) { + li.find('.modal').modal('hide'); + li.remove(); + } + } + }); + });*/ + }; + + var editAccount = function editAccount() { + (0, _jquery2.default)('legend').bind('click', function () { + (0, _jquery2.default)('.form-info').hide(200); + (0, _jquery2.default)((0, _jquery2.default)(this).data('target')).show(); + }); + + _geonames2.default.init((0, _jquery2.default)('#form_geonameid'), { + server: configService.get('geonameServerUrl'), + limit: 40 + }); + }; + + var editSession = function editSession() { + var modal = (0, _jquery2.default)('#modal-delete-confirm').modal({ + show: false + }); + + (0, _jquery2.default)('a.delete-session').bind('click', function (e) { + e.preventDefault(); + modal.data('delete-url', (0, _jquery2.default)(this).prop('href')).modal('toggle'); + + return false; + }); + + (0, _jquery2.default)('a.confirm-delete').on('click', function (e) { + e.preventDefault(); + _jquery2.default.ajax({ + type: 'POST', + url: modal.data('delete-url'), + dataType: 'json', + success: function success(data) { + if (data.success) { + (0, _jquery2.default)('#row-' + data.session_id).closest('tr').remove(); + } + modal.modal('toggle'); + } + }); + }); + }; + + return { initialize: initialize, editAccount: editAccount, editSession: editSession }; +}; +exports.default = account; + +/***/ }), + /***/ 29: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -4465,9 +4557,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -4760,7 +4852,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -5184,7 +5276,7 @@ exports.default = ajax; /***/ }), -/***/ 37: +/***/ 38: /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -20196,7 +20288,7 @@ $.widget( "ui.tooltip", { /***/ }), -/***/ 38: +/***/ 39: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -22568,11 +22660,100 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /***/ 5: +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ 56: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +__webpack_require__(38); +__webpack_require__(39); +var geonames = { + + init: function init($field, options) { + var geocompleter = $field.geocompleter(options); + + // On focus add select-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompletefocus', function (event, ui) { + (0, _jquery2.default)('li', (0, _jquery2.default)(event.originalEvent.target)).closest('li').removeClass('selected'); + (0, _jquery2.default)('a.ui-state-active, a.ui-state-hover, a.ui-state-focus', (0, _jquery2.default)(event.originalEvent.target)).closest('li').addClass('selected'); + }); + + // On search request add loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompletesearch', function (event, ui) { + (0, _jquery2.default)(this).attr('autocomplete', 'false'); + (0, _jquery2.default)(this).addClass('input-loading'); + (0, _jquery2.default)(this).removeClass('input-error'); + }); + + // On response remove loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompleteresponse', function (event, ui) { + (0, _jquery2.default)(this).removeClass('input-loading'); + }); + + // On close menu remove loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompleteclose', function (event, ui) { + (0, _jquery2.default)(this).removeClass('input-loading'); + }); + + // On request error add error-state + geocompleter.geocompleter('autocompleter', 'on', 'geotocompleter.request.error', function (jqXhr, status, error) { + (0, _jquery2.default)(this).removeClass('input-loading'); + (0, _jquery2.default)(this).addClass('input-error'); + }); + + return geocompleter; + } + +}; + +exports.default = geonames; + +/***/ }), + +/***/ 6: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22640,95 +22821,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), - -/***/ 54: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -__webpack_require__(37); -__webpack_require__(38); -var geonames = { - - init: function init($field, options) { - var geocompleter = $field.geocompleter(options); - - // On focus add select-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompletefocus', function (event, ui) { - (0, _jquery2.default)('li', (0, _jquery2.default)(event.originalEvent.target)).closest('li').removeClass('selected'); - (0, _jquery2.default)('a.ui-state-active, a.ui-state-hover, a.ui-state-focus', (0, _jquery2.default)(event.originalEvent.target)).closest('li').addClass('selected'); - }); - - // On search request add loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompletesearch', function (event, ui) { - (0, _jquery2.default)(this).attr('autocomplete', 'false'); - (0, _jquery2.default)(this).addClass('input-loading'); - (0, _jquery2.default)(this).removeClass('input-error'); - }); - - // On response remove loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompleteresponse', function (event, ui) { - (0, _jquery2.default)(this).removeClass('input-loading'); - }); - - // On close menu remove loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompleteclose', function (event, ui) { - (0, _jquery2.default)(this).removeClass('input-loading'); - }); - - // On request error add error-state - geocompleter.geocompleter('autocompleter', 'on', 'geotocompleter.request.error', function (jqXhr, status, error) { - (0, _jquery2.default)(this).removeClass('input-loading'); - (0, _jquery2.default)(this).addClass('input-error'); - }); - - return geocompleter; - } - -}; - -exports.default = geonames; - -/***/ }), - -/***/ 6: -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /***/ 7: @@ -35124,128 +35216,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/account.min.js b/Phraseanet-production-client/dist/account.min.js index e81551f30d..48802883e2 100644 --- a/Phraseanet-production-client/dist/account.min.js +++ b/Phraseanet-production-client/dist/account.min.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 245); +/******/ return __webpack_require__(__webpack_require__.s = 281); /******/ }) /************************************************************************/ /******/ ({ @@ -83,31 +83,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -2235,7 +2327,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -2594,7 +2686,7 @@ process.umask = function() { return 0; }; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -3013,424 +3105,12 @@ var I18n = function (_EventEmitter) { /***/ }), -/***/ 245: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(246); - - -/***/ }), - -/***/ 246: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _bootstrap = __webpack_require__(247); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var accountApp = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.accountApp = accountApp; -} - -module.exports = accountApp; - -/***/ }), - -/***/ 247: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _config = __webpack_require__(248); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _account = __webpack_require__(249); - -var _account2 = _interopRequireDefault(_account); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -(0, _jquery2.default)(document).ready(function () { - // hide or show callback url input whether user choose a web or dektop application - (0, _jquery2.default)('#form_create input[name=type]').bind('click', function () { - if ((0, _jquery2.default)(this).val() === 'desktop') { - (0, _jquery2.default)('#form_create .callback-control-group').hide().find('input').val(''); - } else { - (0, _jquery2.default)('#form_create .callback-control-group').show(); - } - }); -}); - -var Bootstrap = function () { - function Bootstrap(userConfig) { - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.onConfigReady(); - - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - var accountService = (0, _account2.default)(_this.appServices); - - accountService.initialize({ - $container: (0, _jquery2.default)('body') - }); - - switch (_this.configService.get('state')) { - case 'editAccount': - accountService.editAccount(); - break; - case 'editSession': - accountService.editSession(); - break; - default: - } - }); - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 248: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/prod/language.json' -}; - -exports.default = defaultConfig; - -/***/ }), - -/***/ 249: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _geonames = __webpack_require__(54); - -var _geonames2 = _interopRequireDefault(_geonames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var account = function account(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - - var initialize = function initialize(options) { - var $container = options.$container; - - $container.on('click', '.alert .alert-block-close a', function (e) { - e.preventDefault(); - (0, _jquery2.default)(this).closest('.alert').alert('close'); - return false; - }); - - // revoke third party application access - (0, _jquery2.default)('a.app-btn').bind('click', function (e) { - e.preventDefault(); - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'GET', - url: $this.attr('href'), - dataType: 'json', - data: { revoke: $this.hasClass('authorize') ? 0 : 1 }, - success: function success(data) { - if (data.success) { - var li = $this.closest('li'); - - var hidden = (0, _jquery2.default)('.app-btn.hidden , .status.hidden', li); - var notHidden = (0, _jquery2.default)('.app-btn:not(.hidden), .status:not(.hidden)', li); - - hidden.removeClass('hidden'); - notHidden.addClass('hidden'); - } - } - }); - }); - - // generate new access token - (0, _jquery2.default)('a#generate_access').bind('click', function (e) { - e.preventDefault(); - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'POST', - url: $this.attr('href'), - dataType: 'json', - data: { - usr_id: $this.closest('div').attr('id') - }, - success: function success(data) { - if (data.success) { - (0, _jquery2.default)('#my_access_token').empty().append(data.token); - } - } - }); - }); - - //modify application callback url - (0, _jquery2.default)('.modifier_callback').bind('click', function () { - var modifierBtn = (0, _jquery2.default)(this); - var saveBtn = (0, _jquery2.default)('a.save_callback'); - var input = (0, _jquery2.default)('.url_callback_input'); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input.empty().wrapInner('' + ''); - - (0, _jquery2.default)('.url_callback').off(); - - // save new callback - saveBtn.bind('click', function (e) { - e.preventDefault(); - var callback = (0, _jquery2.default)('input[name=oauth_callback]').val(); - _jquery2.default.ajax({ - type: 'POST', - url: saveBtn.attr('href'), - dataType: 'json', - data: { callback: callback }, - success: function success(data) { - if (data.success) { - input.empty().append(callback); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - //modify application webhook url - (0, _jquery2.default)('.webhook-modify-btn').bind('click', function () { - var modifierBtn = (0, _jquery2.default)(this); - var saveBtn = (0, _jquery2.default)('a.save_webhook'); - var input = (0, _jquery2.default)('.url_webhook_input'); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input.empty().wrapInner('' + ''); - - (0, _jquery2.default)('.url_webhook').off(); - - // save new callback - saveBtn.bind('click', function (e) { - e.preventDefault(); - var webhook = (0, _jquery2.default)('input[name=oauth_webhook]').val(); - _jquery2.default.ajax({ - type: 'POST', - url: saveBtn.attr('href'), - dataType: 'json', - data: { webhook: webhook }, - success: function success(data) { - if (data.success) { - input.empty().append(webhook); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - // hide or show callback url input whether user choose a web or dektop application - /* $('#form_create input[name=type]').bind('click', function () { - if ($(this).val() === 'desktop') { - $('#form_create .callback-control-group').hide().find('input').val(''); - } else { - $('#form_create .callback-control-group').show(); - } - });*/ - - // authorize password grant type or not - (0, _jquery2.default)('.grant-type').bind('click', function () { - var $this = (0, _jquery2.default)(this); - _jquery2.default.ajax({ - type: 'POST', - url: $this.attr('value'), - dataType: 'json', - data: { grant: $this.is(':checked') ? '1' : '0' }, - success: function success(data) {} - }); - }); - - // delete an application - /* $('a.delete-app').bind('click', function (e) { - e.preventDefault(); - var $this = $(this); - var li = $this.closest('li'); - $.ajax({ - type: 'DELETE', - url: $this.attr('href'), - dataType: 'json', - data: {}, - success: function (data) { - if (data.success) { - li.find('.modal').modal('hide'); - li.remove(); - } - } - }); - });*/ - }; - - var editAccount = function editAccount() { - (0, _jquery2.default)('legend').bind('click', function () { - (0, _jquery2.default)('.form-info').hide(200); - (0, _jquery2.default)((0, _jquery2.default)(this).data('target')).show(); - }); - - _geonames2.default.init((0, _jquery2.default)('#form_geonameid'), { - server: configService.get('geonameServerUrl'), - limit: 40 - }); - }; - - var editSession = function editSession() { - var modal = (0, _jquery2.default)('#modal-delete-confirm').modal({ - show: false - }); - - (0, _jquery2.default)('a.delete-session').bind('click', function (e) { - e.preventDefault(); - modal.data('delete-url', (0, _jquery2.default)(this).prop('href')).modal('toggle'); - - return false; - }); - - (0, _jquery2.default)('a.confirm-delete').on('click', function (e) { - e.preventDefault(); - _jquery2.default.ajax({ - type: 'POST', - url: modal.data('delete-url'), - dataType: 'json', - success: function success(data) { - if (data.success) { - (0, _jquery2.default)('#row-' + data.session_id).closest('tr').remove(); - } - modal.modal('toggle'); - } - }); - }); - }; - - return { initialize: initialize, editAccount: editAccount, editSession: editSession }; -}; -exports.default = account; - -/***/ }), - /***/ 25: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -3582,10 +3262,10 @@ var ResourceStore = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -4184,11 +3864,423 @@ var PluralResolver = function () { /***/ }), +/***/ 281: +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(282); + + +/***/ }), + +/***/ 282: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _bootstrap = __webpack_require__(283); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var accountApp = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.accountApp = accountApp; +} + +module.exports = accountApp; + +/***/ }), + +/***/ 283: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +var _config = __webpack_require__(284); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _account = __webpack_require__(285); + +var _account2 = _interopRequireDefault(_account); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +(0, _jquery2.default)(document).ready(function () { + // hide or show callback url input whether user choose a web or dektop application + (0, _jquery2.default)('#form_create input[name=type]').bind('click', function () { + if ((0, _jquery2.default)(this).val() === 'desktop') { + (0, _jquery2.default)('#form_create .callback-control-group').hide().find('input').val(''); + } else { + (0, _jquery2.default)('#form_create .callback-control-group').show(); + } + }); +}); + +var Bootstrap = function () { + function Bootstrap(userConfig) { + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.onConfigReady(); + + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + var accountService = (0, _account2.default)(_this.appServices); + + accountService.initialize({ + $container: (0, _jquery2.default)('body') + }); + + switch (_this.configService.get('state')) { + case 'editAccount': + accountService.editAccount(); + break; + case 'editSession': + accountService.editSession(); + break; + default: + } + }); + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 284: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/prod/language.json' +}; + +exports.default = defaultConfig; + +/***/ }), + +/***/ 285: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _geonames = __webpack_require__(56); + +var _geonames2 = _interopRequireDefault(_geonames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var account = function account(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + + var initialize = function initialize(options) { + var $container = options.$container; + + $container.on('click', '.alert .alert-block-close a', function (e) { + e.preventDefault(); + (0, _jquery2.default)(this).closest('.alert').alert('close'); + return false; + }); + + // revoke third party application access + (0, _jquery2.default)('a.app-btn').bind('click', function (e) { + e.preventDefault(); + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'GET', + url: $this.attr('href'), + dataType: 'json', + data: { revoke: $this.hasClass('authorize') ? 0 : 1 }, + success: function success(data) { + if (data.success) { + var li = $this.closest('li'); + + var hidden = (0, _jquery2.default)('.app-btn.hidden , .status.hidden', li); + var notHidden = (0, _jquery2.default)('.app-btn:not(.hidden), .status:not(.hidden)', li); + + hidden.removeClass('hidden'); + notHidden.addClass('hidden'); + } + } + }); + }); + + // generate new access token + (0, _jquery2.default)('a#generate_access').bind('click', function (e) { + e.preventDefault(); + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('href'), + dataType: 'json', + data: { + usr_id: $this.closest('div').attr('id') + }, + success: function success(data) { + if (data.success) { + (0, _jquery2.default)('#my_access_token').empty().append(data.token); + } + } + }); + }); + + //modify application callback url + (0, _jquery2.default)('.modifier_callback').bind('click', function () { + var modifierBtn = (0, _jquery2.default)(this); + var saveBtn = (0, _jquery2.default)('a.save_callback'); + var input = (0, _jquery2.default)('.url_callback_input'); + var inputVal = input.html(); + + modifierBtn.hide(); + saveBtn.show(); + // wrapp current calback in an input + input.empty().wrapInner('' + ''); + + (0, _jquery2.default)('.url_callback').off(); + + // save new callback + saveBtn.bind('click', function (e) { + e.preventDefault(); + var callback = (0, _jquery2.default)('input[name=oauth_callback]').val(); + _jquery2.default.ajax({ + type: 'POST', + url: saveBtn.attr('href'), + dataType: 'json', + data: { callback: callback }, + success: function success(data) { + if (data.success) { + input.empty().append(callback); + } else { + input.empty().append(inputVal); + } + + modifierBtn.show(); + saveBtn.hide(); + } + }); + }); + }); + + //modify application webhook url + (0, _jquery2.default)('.webhook-modify-btn').bind('click', function () { + var modifierBtn = (0, _jquery2.default)(this); + var saveBtn = (0, _jquery2.default)('a.save_webhook'); + var input = (0, _jquery2.default)('.url_webhook_input'); + var inputVal = input.html(); + + modifierBtn.hide(); + saveBtn.show(); + // wrapp current calback in an input + input.empty().wrapInner('' + ''); + + (0, _jquery2.default)('.url_webhook').off(); + + // save new callback + saveBtn.bind('click', function (e) { + e.preventDefault(); + var webhook = (0, _jquery2.default)('input[name=oauth_webhook]').val(); + _jquery2.default.ajax({ + type: 'POST', + url: saveBtn.attr('href'), + dataType: 'json', + data: { webhook: webhook }, + success: function success(data) { + if (data.success) { + input.empty().append(webhook); + } else { + input.empty().append(inputVal); + } + + modifierBtn.show(); + saveBtn.hide(); + } + }); + }); + }); + + // hide or show callback url input whether user choose a web or dektop application + /* $('#form_create input[name=type]').bind('click', function () { + if ($(this).val() === 'desktop') { + $('#form_create .callback-control-group').hide().find('input').val(''); + } else { + $('#form_create .callback-control-group').show(); + } + });*/ + + // authorize password grant type or not + (0, _jquery2.default)('.grant-type').bind('click', function () { + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('value'), + dataType: 'json', + data: { grant: $this.is(':checked') ? '1' : '0' }, + success: function success(data) {} + }); + }); + + // delete an application + /* $('a.delete-app').bind('click', function (e) { + e.preventDefault(); + var $this = $(this); + var li = $this.closest('li'); + $.ajax({ + type: 'DELETE', + url: $this.attr('href'), + dataType: 'json', + data: {}, + success: function (data) { + if (data.success) { + li.find('.modal').modal('hide'); + li.remove(); + } + } + }); + });*/ + }; + + var editAccount = function editAccount() { + (0, _jquery2.default)('legend').bind('click', function () { + (0, _jquery2.default)('.form-info').hide(200); + (0, _jquery2.default)((0, _jquery2.default)(this).data('target')).show(); + }); + + _geonames2.default.init((0, _jquery2.default)('#form_geonameid'), { + server: configService.get('geonameServerUrl'), + limit: 40 + }); + }; + + var editSession = function editSession() { + var modal = (0, _jquery2.default)('#modal-delete-confirm').modal({ + show: false + }); + + (0, _jquery2.default)('a.delete-session').bind('click', function (e) { + e.preventDefault(); + modal.data('delete-url', (0, _jquery2.default)(this).prop('href')).modal('toggle'); + + return false; + }); + + (0, _jquery2.default)('a.confirm-delete').on('click', function (e) { + e.preventDefault(); + _jquery2.default.ajax({ + type: 'POST', + url: modal.data('delete-url'), + dataType: 'json', + success: function success(data) { + if (data.success) { + (0, _jquery2.default)('#row-' + data.session_id).closest('tr').remove(); + } + modal.modal('toggle'); + } + }); + }); + }; + + return { initialize: initialize, editAccount: editAccount, editSession: editSession }; +}; +exports.default = account; + +/***/ }), + /***/ 29: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -4465,9 +4557,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -4760,7 +4852,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -5184,7 +5276,7 @@ exports.default = ajax; /***/ }), -/***/ 37: +/***/ 38: /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -20196,7 +20288,7 @@ $.widget( "ui.tooltip", { /***/ }), -/***/ 38: +/***/ 39: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -22568,11 +22660,100 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /***/ 5: +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ 56: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +__webpack_require__(38); +__webpack_require__(39); +var geonames = { + + init: function init($field, options) { + var geocompleter = $field.geocompleter(options); + + // On focus add select-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompletefocus', function (event, ui) { + (0, _jquery2.default)('li', (0, _jquery2.default)(event.originalEvent.target)).closest('li').removeClass('selected'); + (0, _jquery2.default)('a.ui-state-active, a.ui-state-hover, a.ui-state-focus', (0, _jquery2.default)(event.originalEvent.target)).closest('li').addClass('selected'); + }); + + // On search request add loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompletesearch', function (event, ui) { + (0, _jquery2.default)(this).attr('autocomplete', 'false'); + (0, _jquery2.default)(this).addClass('input-loading'); + (0, _jquery2.default)(this).removeClass('input-error'); + }); + + // On response remove loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompleteresponse', function (event, ui) { + (0, _jquery2.default)(this).removeClass('input-loading'); + }); + + // On close menu remove loading-state + geocompleter.geocompleter('autocompleter', 'on', 'autocompleteclose', function (event, ui) { + (0, _jquery2.default)(this).removeClass('input-loading'); + }); + + // On request error add error-state + geocompleter.geocompleter('autocompleter', 'on', 'geotocompleter.request.error', function (jqXhr, status, error) { + (0, _jquery2.default)(this).removeClass('input-loading'); + (0, _jquery2.default)(this).addClass('input-error'); + }); + + return geocompleter; + } + +}; + +exports.default = geonames; + +/***/ }), + +/***/ 6: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22640,95 +22821,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), - -/***/ 54: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -__webpack_require__(37); -__webpack_require__(38); -var geonames = { - - init: function init($field, options) { - var geocompleter = $field.geocompleter(options); - - // On focus add select-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompletefocus', function (event, ui) { - (0, _jquery2.default)('li', (0, _jquery2.default)(event.originalEvent.target)).closest('li').removeClass('selected'); - (0, _jquery2.default)('a.ui-state-active, a.ui-state-hover, a.ui-state-focus', (0, _jquery2.default)(event.originalEvent.target)).closest('li').addClass('selected'); - }); - - // On search request add loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompletesearch', function (event, ui) { - (0, _jquery2.default)(this).attr('autocomplete', 'false'); - (0, _jquery2.default)(this).addClass('input-loading'); - (0, _jquery2.default)(this).removeClass('input-error'); - }); - - // On response remove loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompleteresponse', function (event, ui) { - (0, _jquery2.default)(this).removeClass('input-loading'); - }); - - // On close menu remove loading-state - geocompleter.geocompleter('autocompleter', 'on', 'autocompleteclose', function (event, ui) { - (0, _jquery2.default)(this).removeClass('input-loading'); - }); - - // On request error add error-state - geocompleter.geocompleter('autocompleter', 'on', 'geotocompleter.request.error', function (jqXhr, status, error) { - (0, _jquery2.default)(this).removeClass('input-loading'); - (0, _jquery2.default)(this).addClass('input-error'); - }); - - return geocompleter; - } - -}; - -exports.default = geonames; - -/***/ }), - -/***/ 6: -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /***/ 7: @@ -35124,128 +35216,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/authenticate.js b/Phraseanet-production-client/dist/authenticate.js index a24b40a769..76084f0723 100644 --- a/Phraseanet-production-client/dist/authenticate.js +++ b/Phraseanet-production-client/dist/authenticate.js @@ -152,7 +152,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 228); +/******/ return __webpack_require__(__webpack_require__.s = 264); /******/ }) /************************************************************************/ /******/ ({ @@ -165,31 +165,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -2317,7 +2409,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -2669,989 +2761,6 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; -/***/ }), - -/***/ 228: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(229); - - -/***/ }), - -/***/ 229: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _bootstrap = __webpack_require__(230); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var authenticateApp = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.authenticateApp = authenticateApp; -} - -module.exports = authenticateApp; - -/***/ }), - -/***/ 230: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _config = __webpack_require__(231); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _authentication = __webpack_require__(232); - -var _authentication2 = _interopRequireDefault(_authentication); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Bootstrap = function () { - function Bootstrap(userConfig) { - var _this = this; - - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.localeService = new _locale2.default({ - configService: this.configService - }); - - this.localeService.fetchTranslations().then(function () { - _this.onConfigReady(); - }); - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this2 = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - // export translation for backward compatibility: - // window.language = this.localeService.getTranslations(); - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - var authService = (0, _authentication2.default)(_this2.appServices); - - authService.initialize(); - - switch (_this2.configService.get('state')) { - case 'login': - authService.login(); - break; - case 'forgotPassword': - authService.forgotPassword(); - break; - case 'renewPassword': - authService.renewPassword(); - break; - case 'register': - authService.register(); - break; - case 'registerProvider': - authService.registerProvider(); - break; - case 'renewEmail': - authService.renewEmail(); - break; - case 'changePassword': - authService.changePassword(); - break; - default: - } - }); - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 231: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/login/language.json' -}; - -exports.default = defaultConfig; - -/***/ }), - -/***/ 232: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _login = __webpack_require__(233); - -var _login2 = _interopRequireDefault(_login); - -var _forgotPassword = __webpack_require__(238); - -var _forgotPassword2 = _interopRequireDefault(_forgotPassword); - -var _renewPassword = __webpack_require__(239); - -var _renewPassword2 = _interopRequireDefault(_renewPassword); - -var _register = __webpack_require__(240); - -var _register2 = _interopRequireDefault(_register); - -var _registerProvider = __webpack_require__(241); - -var _registerProvider2 = _interopRequireDefault(_registerProvider); - -var _renewEmail = __webpack_require__(242); - -var _renewEmail2 = _interopRequireDefault(_renewEmail); - -var _changePassword = __webpack_require__(243); - -var _changePassword2 = _interopRequireDefault(_changePassword); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -__webpack_require__(244); // multiselect - -var authentication = function authentication(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - - var initialize = function initialize() { - // close alerts - (0, _jquery2.default)(document).on('click', '.alert .alert-block-close a', function (e) { - e.preventDefault(); - (0, _jquery2.default)(this).closest('.alert').alert('close'); - return false; - }); - - (0, _jquery2.default)('select[multiple="multiple"]').multiselect({ - buttonWidth: '100%', - buttonClass: 'btn btn-inverse', - maxHeight: 185, - includeSelectAllOption: true, - selectAllValue: 'all', - selectAllText: localeService.t('all_collections'), - buttonText: function buttonText(options, select) { - if (options.length === 0) { - return localeService.t('no_collection_selected') + ''; - } else { - return localeService.t(options.length === 1 ? 'one_collection_selected' : 'collections_selected', { - postProcess: 'sprintf', - sprintf: [options.length] - }) + ' '; - } - } - }); - (0, _jquery2.default)('form[name="registerForm"]').on('submit', function () { - // must deselect the 'select all' checkbox for server side validation. - (0, _jquery2.default)('select[multiple="multiple"]').multiselect('deselect', 'all'); - }); - }; - - var login = function login() { - // init login form - (0, _login2.default)(services).initialize(); - }; - var forgotPassword = function forgotPassword() { - // init login form - (0, _forgotPassword2.default)(services).initialize(); - }; - var renewPassword = function renewPassword() { - // init login form - (0, _renewPassword2.default)(services).initialize(); - }; - var register = function register() { - // init login form - (0, _register2.default)(services).initialize(); - }; - var registerProvider = function registerProvider() { - // init login form - (0, _registerProvider2.default)(services).initialize(); - }; - var renewEmail = function renewEmail() { - // init login form - (0, _renewEmail2.default)(services).initialize(); - }; - var changePassword = function changePassword() { - // init login form - (0, _changePassword2.default)(services).initialize(); - }; - - return { initialize: initialize, login: login, forgotPassword: forgotPassword, renewPassword: renewPassword, register: register, registerProvider: registerProvider, renewEmail: renewEmail, changePassword: changePassword }; -}; -exports.default = authentication; - -/***/ }), - -/***/ 233: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _form = __webpack_require__(42); - -var _form2 = _interopRequireDefault(_form); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var login = function login(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - - new _form2.default({ - el: (0, _jquery2.default)('form[name=loginForm]'), - rules: [{ - name: 'login', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'password', - rules: 'required', - message: localeService.t('validation_blank') - }] - }); - }; - - return { initialize: initialize }; -}; -exports.default = login; - -/***/ }), - -/***/ 234: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var FormValidator = function FormValidator(rules, handlers) { - // rules setted by user - this.rules = rules || []; - // custom callbacks - this.handlers = handlers || []; - // final fields to validate - this.fields = []; - - var self = this; - - _underscore2.default.each(this.rules, function (field) { - if ('name' in field && 'rules' in field) { - self._addField(field); - } - }); -}; - -// Validate method, argument is the serialize form -FormValidator.prototype.validate = function (inputs) { - var self = this; - // possible errors - this.errors = []; - // inputs present in form - this.inputs = {}; - - _underscore2.default.each(_underscore2.default.groupBy(inputs, function (input) { - return input.name; - }), function (fields, name) { - self.inputs[name] = fields; - }); - - this._validateForm(); - - return this; -}; - -FormValidator.prototype.getErrors = function () { - return this.errors; -}; - -FormValidator.prototype.hasErrors = function () { - return this.errors.length > 0; -}; - -FormValidator.prototype.getRules = function () { - return this.rules; -}; - -FormValidator.prototype._addField = function (field) { - this.fields.push({ - name: field.name, - rules: field.rules, - message: field.message || 'An error ocurred on input[name=' + field.name + '], you can edit this message by setting a "message" property in your rule definition object', - value: null, - type: field.type || 'text' - }); -}; - -FormValidator.prototype._validateForm = function () { - var self = this; - this.errors = []; - _underscore2.default.each(this.fields, function (field) { - if (_underscore2.default.has(self.inputs, field.name)) { - // values can be multiple - var values = []; - - _underscore2.default.each(self.inputs[field.name], function (field) { - return values.push(field.value); - }); - - field.value = values.join(','); - - self._validateField(field); - } else if (field.type === 'checkbox' || field.type === 'radio' || field.type === 'select' || field.type === 'multiple') { - field.value = ''; - self._validateField(field); - } - }); -}; - -FormValidator.prototype._validateField = function (field) { - var self = this; - var ruleRegex = /^(.+?)\[(.+)\]$/; - var rules = field.rules.split('|'); - - // Run through the rules and execute the validation methods as needed - _underscore2.default.every(rules, function (method) { - var param = null; - var failed = false; - var parts = ruleRegex.exec(method); - - // If the rule has a parameter (i.e. matches[param]) split it out - if (parts) { - method = parts[1]; - param = parts[2]; - } - - // If the hook is defined, run it to find any validation errors - if (typeof self._hooks[method] === 'function') { - if (!self._hooks[method].apply(self, [field, param])) { - failed = true; - } - } else if (method.substring(0, 9) === 'callback_') { - // Custom method. Execute the handler if it was registered - method = method.substring(9, method.length); - - if (typeof self.handlers[method] === 'function') { - if (this.handlers[method].apply(self, [field.value, param]) === false) { - failed = true; - } - } - } - - // If the hook failed, add a message to the errors array - if (failed) { - self.errors.push({ - name: field.name, - value: field.value, - message: field.message, - rule: method - }); - } - - // Breaks loop iteration - return failed; - }); -}; - -FormValidator.prototype.Regexp = { - numericRegex: /^[0-9]+$/, - integerRegex: /^\-?[0-9]+$/, - decimalRegex: /^\-?[0-9]*\.?[0-9]+$/, - emailRegex: /^[^@]+@[^@]+\.[^@]+$/, - alphaRegex: /^[a-z]+$/i, - alphaNumericRegex: /^[a-z0-9]+$/i, - alphaDashRegex: /^[a-z0-9_\-]+$/i, - naturalRegex: /^[0-9]+$/i, - naturalNoZeroRegex: /^[1-9][0-9]*$/i, - // IP v6 a v4 or hostname, by Mikulas Dite see http://stackoverflow.com/a/9209720/96656 - ipRegex: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,1}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,2}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$/i, - numericDashRegex: /^[\d\-\s]+$/, - urlRegex: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/ -}; - -// Object containing all of the validation hooks -FormValidator.prototype._hooks = { - required: function required(field) { - var value = field.value; - - return value !== null && value !== ''; - }, - equal: function equal(field, defaultName) { - return field.value === defaultName; - }, - matches: function matches(field, matchName) { - if (typeof this.inputs[matchName] === 'undefined') { - return false; - } - - var el = this.inputs[matchName].shift(); - - if (el) { - return field.value === el.value; - } - - return false; - }, - valid_email: function valid_email(field) { - return this.Regexp.emailRegex.test(field.value); - }, - valid_emails: function valid_emails(field) { - var result = field.value.split(','); - - for (var i = 0; i < result.length; i++) { - if (!this.Regexp.emailRegex.test(_jquery2.default.trim(result[i]))) { - return false; - } - } - - return true; - }, - min_length: function min_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length >= parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length >= parseInt(length, 10); - }, - max_length: function max_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length <= parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length <= parseInt(length, 10); - }, - exact_length: function exact_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length === parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length === parseInt(length, 10); - }, - greater_than: function greater_than(field, param) { - if (!this.Regexp.decimalRegex.test(field.value)) { - return false; - } - - return parseFloat(field.value) > parseFloat(param); - }, - less_than: function less_than(field, param) { - if (!this.Regexp.decimalRegex.test(field.value)) { - return false; - } - - return parseFloat(field.value) < parseFloat(param); - }, - alpha: function alpha(field) { - return this.Regexp.alphaRegex.test(field.value); - }, - alpha_numeric: function alpha_numeric(field) { - return this.Regexp.alphaNumericRegex.test(field.value); - }, - alpha_dash: function alpha_dash(field) { - return this.Regexp.alphaDashRegex.test(field.value); - }, - numeric: function numeric(field) { - return this.Regexp.numericRegex.test(field.value); - }, - integer: function integer(field) { - return this.Regexp.integerRegex.test(field.value); - }, - decimal: function decimal(field) { - return this.Regexp.decimalRegex.test(field.value); - }, - is_natural: function is_natural(field) { - return this.Regexp.naturalRegex.test(field.value); - }, - is_natural_no_zero: function is_natural_no_zero(field) { - return this.Regexp.naturalNoZeroRegex.test(field.value); - }, - valid_ip: function valid_ip(field) { - return this.Regexp.ipRegex.test(field.value); - }, - valid_url: function valid_url(field) { - return this.Regexp.urlRegex.test(field.value); - } -}; - -exports.default = FormValidator; - -/***/ }), - -/***/ 235: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -var _backbone = __webpack_require__(52); - -var _backbone2 = _interopRequireDefault(_backbone); - -var _error = __webpack_require__(236); - -var _error2 = _interopRequireDefault(_error); - -var _multiviews = __webpack_require__(237); - -var _multiviews2 = _interopRequireDefault(_multiviews); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var InputView = _backbone2.default.View.extend(_underscore2.default.extend({}, _multiviews2.default, { - initialize: function initialize(options) { - options = options || {}; - if (options.name === undefined) { - throw 'Missing name attribute in input view'; - } - - if (options.errorTemplate === undefined) { - throw 'Missing errorTemplate attribute in input view'; - } - - this.name = options.name; - - this.errorView = new _error2.default({ - name: this.name, - errorTemplate: options.errorTemplate, - onRenderError: options.onRenderError || null - }); - }, - render: function render() { - this._assignView({ '.error-view': this.errorView }); - }, - showErrors: function showErrors(errors) { - this.render(); - - this.errorView.renderErrors(errors); - - return this; - }, - resetErrors: function resetErrors() { - this.errorView.reset(); - } -})); /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -exports.default = InputView; - -/***/ }), - -/***/ 236: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -var _backbone = __webpack_require__(52); - -var _backbone2 = _interopRequireDefault(_backbone); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ErrorView = _backbone2.default.View.extend({ - tagName: 'div', - initialize: function initialize(options) { - options = options || {}; - - if (options.name === undefined) { - throw 'Missing name attribute in error view'; - } - - if (options.errorTemplate === undefined) { - throw 'Missing errorTemplate attribute in error view'; - } - - this.name = options.name; - this.errorTemplate = options.errorTemplate; - - this.errors = options.errors || {}; - this.onRenderError = options.onRenderError || null; - }, - render: function render() { - if (this.errors.length > 0) { - var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { - errors: this.errors - }); - - this.$el.html(template); - - if (_underscore2.default.isFunction(this.onRenderError)) { - this.onRenderError(this.name, this.$el); - } - } else { - this.reset(); - } - - return this; - }, - renderErrors: function renderErrors(errors) { - this.errors = errors; - this.render(); - - return this; - }, - reset: function reset() { - this.$el.empty(); - } -}); /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -exports.default = ErrorView; - -/***/ }), - -/***/ 237: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - // bind a subview to a DOM element - _assignView: function _assignView(selector, view) { - var selectors; - if (_underscore2.default.isObject(selector)) { - selectors = selector; - } else { - selectors = {}; - selectors[selector] = view; - } - if (!selectors) return; - _underscore2.default.each(selectors, function (view, selector) { - view.setElement(this.$(selector)).render(); - }, this); - } -}; /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/***/ }), - -/***/ 238: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _form = __webpack_require__(42); - -var _form2 = _interopRequireDefault(_form); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var forgotPassword = function forgotPassword(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - new _form2.default({ - el: (0, _jquery2.default)('form[name=forgottenPasswordForm]'), - rules: [{ - name: 'email', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'email', - rules: 'valid_email', - message: localeService.t('validation_email') - }] - }); - }; - - return { initialize: initialize }; -}; -exports.default = forgotPassword; - -/***/ }), - -/***/ 239: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _passwordSetter = __webpack_require__(53); - -var _passwordSetter2 = _interopRequireDefault(_passwordSetter); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var renewPassword = function renewPassword(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - - __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); - new _passwordSetter2.default({ - services: services, - el: (0, _jquery2.default)('form[name=passwordRenewForm]'), - rules: [{ - name: 'password[password]', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'password[password]', - rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) - }, { - name: 'password[confirm]', - rules: 'matches[password[password]]', - message: localeService.t('password_match') - }] - }); - }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); - }; - - return { initialize: initialize }; -}; -exports.default = renewPassword; - /***/ }), /***/ 24: @@ -3659,7 +2768,7 @@ exports.default = renewPassword; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -4078,7 +3187,957 @@ var I18n = function (_EventEmitter) { /***/ }), -/***/ 240: +/***/ 25: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + + + + +var ResourceStore = function (_EventEmitter) { + _inherits(ResourceStore, _EventEmitter); + + function ResourceStore() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { ns: ['translation'], defaultNS: 'translation' }; + + _classCallCheck(this, ResourceStore); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + _this.data = data; + _this.options = options; + return _this; + } + + ResourceStore.prototype.addNamespaces = function addNamespaces(ns) { + if (this.options.ns.indexOf(ns) < 0) { + this.options.ns.push(ns); + } + }; + + ResourceStore.prototype.removeNamespaces = function removeNamespaces(ns) { + var index = this.options.ns.indexOf(ns); + if (index > -1) { + this.options.ns.splice(index, 1); + } + }; + + ResourceStore.prototype.getResource = function getResource(lng, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var keySeparator = options.keySeparator || this.options.keySeparator; + if (keySeparator === undefined) keySeparator = '.'; + + var path = [lng, ns]; + if (key && typeof key !== 'string') path = path.concat(key); + if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); + + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + } + + return __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path); + }; + + ResourceStore.prototype.addResource = function addResource(lng, ns, key, value) { + var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { silent: false }; + + var keySeparator = this.options.keySeparator; + if (keySeparator === undefined) keySeparator = '.'; + + var path = [lng, ns]; + if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); + + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + value = ns; + ns = path[1]; + } + + this.addNamespaces(ns); + + __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, value); + + if (!options.silent) this.emit('added', lng, ns, key, value); + }; + + ResourceStore.prototype.addResources = function addResources(lng, ns, resources) { + /* eslint no-restricted-syntax: 0 */ + for (var m in resources) { + if (typeof resources[m] === 'string') this.addResource(lng, ns, m, resources[m], { silent: true }); + } + this.emit('added', lng, ns, resources); + }; + + ResourceStore.prototype.addResourceBundle = function addResourceBundle(lng, ns, resources, deep, overwrite) { + var path = [lng, ns]; + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + deep = resources; + resources = ns; + ns = path[1]; + } + + this.addNamespaces(ns); + + var pack = __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path) || {}; + + if (deep) { + __WEBPACK_IMPORTED_MODULE_1__utils__["b" /* deepExtend */](pack, resources, overwrite); + } else { + pack = _extends({}, pack, resources); + } + + __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, pack); + + this.emit('added', lng, ns, resources); + }; + + ResourceStore.prototype.removeResourceBundle = function removeResourceBundle(lng, ns) { + if (this.hasResourceBundle(lng, ns)) { + delete this.data[lng][ns]; + } + this.removeNamespaces(ns); + + this.emit('removed', lng, ns); + }; + + ResourceStore.prototype.hasResourceBundle = function hasResourceBundle(lng, ns) { + return this.getResource(lng, ns) !== undefined; + }; + + ResourceStore.prototype.getResourceBundle = function getResourceBundle(lng, ns) { + if (!ns) ns = this.options.defaultNS; + + // COMPATIBILITY: remove extend in v2.1.0 + if (this.options.compatibilityAPI === 'v1') return _extends({}, this.getResource(lng, ns)); + + return this.getResource(lng, ns); + }; + + ResourceStore.prototype.toJSON = function toJSON() { + return this.data; + }; + + return ResourceStore; +}(__WEBPACK_IMPORTED_MODULE_0__EventEmitter__["a" /* default */]); + +/* harmony default export */ __webpack_exports__["a"] = (ResourceStore); + +/***/ }), + +/***/ 26: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + + + + + + + +var Translator = function (_EventEmitter) { + _inherits(Translator, _EventEmitter); + + function Translator(services) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Translator); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + __WEBPACK_IMPORTED_MODULE_4__utils__["a" /* copy */](['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector'], services, _this); + + _this.options = options; + _this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('translator'); + return _this; + } + + Translator.prototype.changeLanguage = function changeLanguage(lng) { + if (lng) this.language = lng; + }; + + Translator.prototype.exists = function exists(key) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { interpolation: {} }; + + if (this.options.compatibilityAPI === 'v1') { + options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); + } + + return this.resolve(key, options) !== undefined; + }; + + Translator.prototype.extractFromKey = function extractFromKey(key, options) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + if (nsSeparator === undefined) nsSeparator = ':'; + var keySeparator = options.keySeparator || this.options.keySeparator || '.'; + + var namespaces = options.ns || this.options.defaultNS; + if (nsSeparator && key.indexOf(nsSeparator) > -1) { + var parts = key.split(nsSeparator); + if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); + key = parts.join(keySeparator); + } + if (typeof namespaces === 'string') namespaces = [namespaces]; + + return { + key: key, + namespaces: namespaces + }; + }; + + Translator.prototype.translate = function translate(keys) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') { + /* eslint prefer-rest-params: 0 */ + options = this.options.overloadTranslationOptionHandler(arguments); + } else if (this.options.compatibilityAPI === 'v1') { + options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); + } + + // non valid keys handling + if (keys === undefined || keys === null || keys === '') return ''; + if (typeof keys === 'number') keys = String(keys); + if (typeof keys === 'string') keys = [keys]; + + // separators + var keySeparator = options.keySeparator || this.options.keySeparator || '.'; + + // get namespace(s) + + var _extractFromKey = this.extractFromKey(keys[keys.length - 1], options), + key = _extractFromKey.key, + namespaces = _extractFromKey.namespaces; + + var namespace = namespaces[namespaces.length - 1]; + + // return key on CIMode + var lng = options.lng || this.language; + var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; + if (lng && lng.toLowerCase() === 'cimode') { + if (appendNamespaceToCIMode) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + return namespace + nsSeparator + key; + } + + return key; + } + + // resolve from store + var res = this.resolve(keys, options); + + var resType = Object.prototype.toString.apply(res); + var noObject = ['[object Number]', '[object Function]', '[object RegExp]']; + var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; + + // object + if (res && typeof res !== 'string' && noObject.indexOf(resType) < 0 && !(joinArrays && resType === '[object Array]')) { + if (!options.returnObjects && !this.options.returnObjects) { + this.logger.warn('accessing an object - but returnObjects options is not enabled!'); + return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(key, res, options) : 'key \'' + key + ' (' + this.language + ')\' returned an object instead of string.'; + } + + // if we got a separator we loop over children - else we just return object as is + // as having it set to false means no hierarchy so no lookup for nested values + if (options.keySeparator || this.options.keySeparator) { + var copy = resType === '[object Array]' ? [] : {}; // apply child translation on a copy + + /* eslint no-restricted-syntax: 0 */ + for (var m in res) { + if (Object.prototype.hasOwnProperty.call(res, m)) { + copy[m] = this.translate('' + key + keySeparator + m, _extends({}, options, { joinArrays: false, ns: namespaces })); + } + } + res = copy; + } + } else if (joinArrays && resType === '[object Array]') { + // array special treatment + res = res.join(joinArrays); + if (res) res = this.extendTranslation(res, key, options); + } else { + // string, empty or null + var usedDefault = false; + var usedKey = false; + + // fallback value + if (!this.isValidLookup(res) && options.defaultValue !== undefined) { + usedDefault = true; + res = options.defaultValue; + } + if (!this.isValidLookup(res)) { + usedKey = true; + res = key; + } + + // save missing + if (usedKey || usedDefault) { + this.logger.log('missingKey', lng, namespace, key, res); + + var lngs = []; + var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); + if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { + for (var i = 0; i < fallbackLngs.length; i++) { + lngs.push(fallbackLngs[i]); + } + } else if (this.options.saveMissingTo === 'all') { + lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); + } else { + lngs.push(options.lng || this.language); + } + + if (this.options.saveMissing) { + if (this.options.missingKeyHandler) { + this.options.missingKeyHandler(lngs, namespace, key, res); + } else if (this.backendConnector && this.backendConnector.saveMissing) { + this.backendConnector.saveMissing(lngs, namespace, key, res); + } + } + + this.emit('missingKey', lngs, namespace, key, res); + } + + // extend + res = this.extendTranslation(res, key, options); + + // append namespace if still key + if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = namespace + ':' + key; + + // parseMissingKeyHandler + if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); + } + + // return + return res; + }; + + Translator.prototype.extendTranslation = function extendTranslation(res, key, options) { + var _this2 = this; + + if (options.interpolation) this.interpolator.init(_extends({}, options, { interpolation: _extends({}, this.options.interpolation, options.interpolation) })); + + // interpolate + var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; + if (this.options.interpolation.defaultVariables) data = _extends({}, this.options.interpolation.defaultVariables, data); + res = this.interpolator.interpolate(res, data, options.lng || this.language); + + // nesting + if (options.nest !== false) res = this.interpolator.nest(res, function () { + return _this2.translate.apply(_this2, arguments); + }, options); + + if (options.interpolation) this.interpolator.reset(); + + // post process + var postProcess = options.postProcess || this.options.postProcess; + var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess; + + if (res !== undefined && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { + res = __WEBPACK_IMPORTED_MODULE_2__postProcessor__["a" /* default */].handle(postProcessorNames, res, key, options, this); + } + + return res; + }; + + Translator.prototype.resolve = function resolve(keys) { + var _this3 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var found = void 0; + + if (typeof keys === 'string') keys = [keys]; + + // forEach possible key + keys.forEach(function (k) { + if (_this3.isValidLookup(found)) return; + + var extracted = _this3.extractFromKey(k, options); + var key = extracted.key; + var namespaces = extracted.namespaces; + if (_this3.options.fallbackNS) namespaces = namespaces.concat(_this3.options.fallbackNS); + + var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; + var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; + + var codes = options.lngs ? options.lngs : _this3.languageUtils.toResolveHierarchy(options.lng || _this3.language); + + namespaces.forEach(function (ns) { + if (_this3.isValidLookup(found)) return; + + codes.forEach(function (code) { + if (_this3.isValidLookup(found)) return; + + var finalKey = key; + var finalKeys = [finalKey]; + + var pluralSuffix = void 0; + if (needsPluralHandling) pluralSuffix = _this3.pluralResolver.getSuffix(code, options.count); + + // fallback for plural if context not found + if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); + + // get key for context if needed + if (needsContextHandling) finalKeys.push(finalKey += '' + _this3.options.contextSeparator + options.context); + + // get key for plural if needed + if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); + + // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only + var possibleKey = void 0; + /* eslint no-cond-assign: 0 */ + while (possibleKey = finalKeys.pop()) { + if (!_this3.isValidLookup(found)) { + found = _this3.getResource(code, ns, possibleKey, options); + } + } + }); + }); + }); + + return found; + }; + + Translator.prototype.isValidLookup = function isValidLookup(res) { + return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); + }; + + Translator.prototype.getResource = function getResource(code, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + return this.resourceStore.getResource(code, ns, key, options); + }; + + return Translator; +}(__WEBPACK_IMPORTED_MODULE_1__EventEmitter__["a" /* default */]); + +/* harmony default export */ __webpack_exports__["a"] = (Translator); + +/***/ }), + +/***/ 264: +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(265); + + +/***/ }), + +/***/ 265: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _bootstrap = __webpack_require__(266); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var authenticateApp = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.authenticateApp = authenticateApp; +} + +module.exports = authenticateApp; + +/***/ }), + +/***/ 266: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +var _config = __webpack_require__(267); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _authentication = __webpack_require__(268); + +var _authentication2 = _interopRequireDefault(_authentication); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Bootstrap = function () { + function Bootstrap(userConfig) { + var _this = this; + + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.localeService = new _locale2.default({ + configService: this.configService + }); + + this.localeService.fetchTranslations().then(function () { + _this.onConfigReady(); + }); + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this2 = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + // export translation for backward compatibility: + // window.language = this.localeService.getTranslations(); + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + var authService = (0, _authentication2.default)(_this2.appServices); + + authService.initialize(); + + switch (_this2.configService.get('state')) { + case 'login': + authService.login(); + break; + case 'forgotPassword': + authService.forgotPassword(); + break; + case 'renewPassword': + authService.renewPassword(); + break; + case 'register': + authService.register(); + break; + case 'registerProvider': + authService.registerProvider(); + break; + case 'renewEmail': + authService.renewEmail(); + break; + case 'changePassword': + authService.changePassword(); + break; + default: + } + }); + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 267: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/login/language.json' +}; + +exports.default = defaultConfig; + +/***/ }), + +/***/ 268: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _login = __webpack_require__(269); + +var _login2 = _interopRequireDefault(_login); + +var _forgotPassword = __webpack_require__(274); + +var _forgotPassword2 = _interopRequireDefault(_forgotPassword); + +var _renewPassword = __webpack_require__(275); + +var _renewPassword2 = _interopRequireDefault(_renewPassword); + +var _register = __webpack_require__(276); + +var _register2 = _interopRequireDefault(_register); + +var _registerProvider = __webpack_require__(277); + +var _registerProvider2 = _interopRequireDefault(_registerProvider); + +var _renewEmail = __webpack_require__(278); + +var _renewEmail2 = _interopRequireDefault(_renewEmail); + +var _changePassword = __webpack_require__(279); + +var _changePassword2 = _interopRequireDefault(_changePassword); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +__webpack_require__(280); // multiselect + +var authentication = function authentication(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + + var initialize = function initialize() { + // close alerts + (0, _jquery2.default)(document).on('click', '.alert .alert-block-close a', function (e) { + e.preventDefault(); + (0, _jquery2.default)(this).closest('.alert').alert('close'); + return false; + }); + + (0, _jquery2.default)('select[multiple="multiple"]').multiselect({ + buttonWidth: '100%', + buttonClass: 'btn btn-inverse', + maxHeight: 185, + includeSelectAllOption: true, + selectAllValue: 'all', + selectAllText: localeService.t('all_collections'), + buttonText: function buttonText(options, select) { + if (options.length === 0) { + return localeService.t('no_collection_selected') + ''; + } else { + return localeService.t(options.length === 1 ? 'one_collection_selected' : 'collections_selected', { + postProcess: 'sprintf', + sprintf: [options.length] + }) + ' '; + } + } + }); + (0, _jquery2.default)('form[name="registerForm"]').on('submit', function () { + // must deselect the 'select all' checkbox for server side validation. + (0, _jquery2.default)('select[multiple="multiple"]').multiselect('deselect', 'all'); + }); + }; + + var login = function login() { + // init login form + (0, _login2.default)(services).initialize(); + }; + var forgotPassword = function forgotPassword() { + // init login form + (0, _forgotPassword2.default)(services).initialize(); + }; + var renewPassword = function renewPassword() { + // init login form + (0, _renewPassword2.default)(services).initialize(); + }; + var register = function register() { + // init login form + (0, _register2.default)(services).initialize(); + }; + var registerProvider = function registerProvider() { + // init login form + (0, _registerProvider2.default)(services).initialize(); + }; + var renewEmail = function renewEmail() { + // init login form + (0, _renewEmail2.default)(services).initialize(); + }; + var changePassword = function changePassword() { + // init login form + (0, _changePassword2.default)(services).initialize(); + }; + + return { initialize: initialize, login: login, forgotPassword: forgotPassword, renewPassword: renewPassword, register: register, registerProvider: registerProvider, renewEmail: renewEmail, changePassword: changePassword }; +}; +exports.default = authentication; + +/***/ }), + +/***/ 269: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _form = __webpack_require__(43); + +var _form2 = _interopRequireDefault(_form); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var login = function login(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + + new _form2.default({ + el: (0, _jquery2.default)('form[name=loginForm]'), + rules: [{ + name: 'login', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'password', + rules: 'required', + message: localeService.t('validation_blank') + }] + }); + }; + + return { initialize: initialize }; +}; +exports.default = login; + +/***/ }), + +/***/ 27: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + +var LanguageUtil = function () { + function LanguageUtil(options) { + _classCallCheck(this, LanguageUtil); + + this.options = options; + + this.whitelist = this.options.whitelist || false; + this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('languageUtils'); + } + + LanguageUtil.prototype.getScriptPartFromCode = function getScriptPartFromCode(code) { + if (!code || code.indexOf('-') < 0) return null; + + var p = code.split('-'); + if (p.length === 2) return null; + p.pop(); + return this.formatLanguageCode(p.join('-')); + }; + + LanguageUtil.prototype.getLanguagePartFromCode = function getLanguagePartFromCode(code) { + if (!code || code.indexOf('-') < 0) return code; + + var p = code.split('-'); + return this.formatLanguageCode(p[0]); + }; + + LanguageUtil.prototype.formatLanguageCode = function formatLanguageCode(code) { + // http://www.iana.org/assignments/language-tags/language-tags.xhtml + if (typeof code === 'string' && code.indexOf('-') > -1) { + var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab']; + var p = code.split('-'); + + if (this.options.lowerCaseLng) { + p = p.map(function (part) { + return part.toLowerCase(); + }); + } else if (p.length === 2) { + p[0] = p[0].toLowerCase(); + p[1] = p[1].toUpperCase(); + + if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); + } else if (p.length === 3) { + p[0] = p[0].toLowerCase(); + + // if lenght 2 guess it's a country + if (p[1].length === 2) p[1] = p[1].toUpperCase(); + if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); + + if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); + if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase()); + } + + return p.join('-'); + } + + return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; + }; + + LanguageUtil.prototype.isWhitelisted = function isWhitelisted(code) { + if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { + code = this.getLanguagePartFromCode(code); + } + return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1; + }; + + LanguageUtil.prototype.getFallbackCodes = function getFallbackCodes(fallbacks, code) { + if (!fallbacks) return []; + if (typeof fallbacks === 'string') fallbacks = [fallbacks]; + if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; + + if (!code) return fallbacks.default || []; + + // asume we have an object defining fallbacks + var found = fallbacks[code]; + if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; + if (!found) found = fallbacks[this.formatLanguageCode(code)]; + if (!found) found = fallbacks.default; + + return found || []; + }; + + LanguageUtil.prototype.toResolveHierarchy = function toResolveHierarchy(code, fallbackCode) { + var _this = this; + + var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code); + + var codes = []; + var addCode = function addCode(c) { + if (!c) return; + if (_this.isWhitelisted(c)) { + codes.push(c); + } else { + _this.logger.warn('rejecting non-whitelisted language code: ' + c); + } + }; + + if (typeof code === 'string' && code.indexOf('-') > -1) { + if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); + if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); + if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); + } else if (typeof code === 'string') { + addCode(this.formatLanguageCode(code)); + } + + fallbackCodes.forEach(function (fc) { + if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); + }); + + return codes; + }; + + return LanguageUtil; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (LanguageUtil); + +/***/ }), + +/***/ 270: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4096,11 +4155,633 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _passwordSetter = __webpack_require__(53); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var FormValidator = function FormValidator(rules, handlers) { + // rules setted by user + this.rules = rules || []; + // custom callbacks + this.handlers = handlers || []; + // final fields to validate + this.fields = []; + + var self = this; + + _underscore2.default.each(this.rules, function (field) { + if ('name' in field && 'rules' in field) { + self._addField(field); + } + }); +}; + +// Validate method, argument is the serialize form +FormValidator.prototype.validate = function (inputs) { + var self = this; + // possible errors + this.errors = []; + // inputs present in form + this.inputs = {}; + + _underscore2.default.each(_underscore2.default.groupBy(inputs, function (input) { + return input.name; + }), function (fields, name) { + self.inputs[name] = fields; + }); + + this._validateForm(); + + return this; +}; + +FormValidator.prototype.getErrors = function () { + return this.errors; +}; + +FormValidator.prototype.hasErrors = function () { + return this.errors.length > 0; +}; + +FormValidator.prototype.getRules = function () { + return this.rules; +}; + +FormValidator.prototype._addField = function (field) { + this.fields.push({ + name: field.name, + rules: field.rules, + message: field.message || 'An error ocurred on input[name=' + field.name + '], you can edit this message by setting a "message" property in your rule definition object', + value: null, + type: field.type || 'text' + }); +}; + +FormValidator.prototype._validateForm = function () { + var self = this; + this.errors = []; + _underscore2.default.each(this.fields, function (field) { + if (_underscore2.default.has(self.inputs, field.name)) { + // values can be multiple + var values = []; + + _underscore2.default.each(self.inputs[field.name], function (field) { + return values.push(field.value); + }); + + field.value = values.join(','); + + self._validateField(field); + } else if (field.type === 'checkbox' || field.type === 'radio' || field.type === 'select' || field.type === 'multiple') { + field.value = ''; + self._validateField(field); + } + }); +}; + +FormValidator.prototype._validateField = function (field) { + var self = this; + var ruleRegex = /^(.+?)\[(.+)\]$/; + var rules = field.rules.split('|'); + + // Run through the rules and execute the validation methods as needed + _underscore2.default.every(rules, function (method) { + var param = null; + var failed = false; + var parts = ruleRegex.exec(method); + + // If the rule has a parameter (i.e. matches[param]) split it out + if (parts) { + method = parts[1]; + param = parts[2]; + } + + // If the hook is defined, run it to find any validation errors + if (typeof self._hooks[method] === 'function') { + if (!self._hooks[method].apply(self, [field, param])) { + failed = true; + } + } else if (method.substring(0, 9) === 'callback_') { + // Custom method. Execute the handler if it was registered + method = method.substring(9, method.length); + + if (typeof self.handlers[method] === 'function') { + if (this.handlers[method].apply(self, [field.value, param]) === false) { + failed = true; + } + } + } + + // If the hook failed, add a message to the errors array + if (failed) { + self.errors.push({ + name: field.name, + value: field.value, + message: field.message, + rule: method + }); + } + + // Breaks loop iteration + return failed; + }); +}; + +FormValidator.prototype.Regexp = { + numericRegex: /^[0-9]+$/, + integerRegex: /^\-?[0-9]+$/, + decimalRegex: /^\-?[0-9]*\.?[0-9]+$/, + emailRegex: /^[^@]+@[^@]+\.[^@]+$/, + alphaRegex: /^[a-z]+$/i, + alphaNumericRegex: /^[a-z0-9]+$/i, + alphaDashRegex: /^[a-z0-9_\-]+$/i, + naturalRegex: /^[0-9]+$/i, + naturalNoZeroRegex: /^[1-9][0-9]*$/i, + // IP v6 a v4 or hostname, by Mikulas Dite see http://stackoverflow.com/a/9209720/96656 + ipRegex: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,1}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,2}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$/i, + numericDashRegex: /^[\d\-\s]+$/, + urlRegex: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/ +}; + +// Object containing all of the validation hooks +FormValidator.prototype._hooks = { + required: function required(field) { + var value = field.value; + + return value !== null && value !== ''; + }, + equal: function equal(field, defaultName) { + return field.value === defaultName; + }, + matches: function matches(field, matchName) { + if (typeof this.inputs[matchName] === 'undefined') { + return false; + } + + var el = this.inputs[matchName].shift(); + + if (el) { + return field.value === el.value; + } + + return false; + }, + valid_email: function valid_email(field) { + return this.Regexp.emailRegex.test(field.value); + }, + valid_emails: function valid_emails(field) { + var result = field.value.split(','); + + for (var i = 0; i < result.length; i++) { + if (!this.Regexp.emailRegex.test(_jquery2.default.trim(result[i]))) { + return false; + } + } + + return true; + }, + min_length: function min_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length >= parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length >= parseInt(length, 10); + }, + max_length: function max_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length <= parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length <= parseInt(length, 10); + }, + exact_length: function exact_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length === parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length === parseInt(length, 10); + }, + greater_than: function greater_than(field, param) { + if (!this.Regexp.decimalRegex.test(field.value)) { + return false; + } + + return parseFloat(field.value) > parseFloat(param); + }, + less_than: function less_than(field, param) { + if (!this.Regexp.decimalRegex.test(field.value)) { + return false; + } + + return parseFloat(field.value) < parseFloat(param); + }, + alpha: function alpha(field) { + return this.Regexp.alphaRegex.test(field.value); + }, + alpha_numeric: function alpha_numeric(field) { + return this.Regexp.alphaNumericRegex.test(field.value); + }, + alpha_dash: function alpha_dash(field) { + return this.Regexp.alphaDashRegex.test(field.value); + }, + numeric: function numeric(field) { + return this.Regexp.numericRegex.test(field.value); + }, + integer: function integer(field) { + return this.Regexp.integerRegex.test(field.value); + }, + decimal: function decimal(field) { + return this.Regexp.decimalRegex.test(field.value); + }, + is_natural: function is_natural(field) { + return this.Regexp.naturalRegex.test(field.value); + }, + is_natural_no_zero: function is_natural_no_zero(field) { + return this.Regexp.naturalNoZeroRegex.test(field.value); + }, + valid_ip: function valid_ip(field) { + return this.Regexp.ipRegex.test(field.value); + }, + valid_url: function valid_url(field) { + return this.Regexp.urlRegex.test(field.value); + } +}; + +exports.default = FormValidator; + +/***/ }), + +/***/ 271: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _backbone = __webpack_require__(54); + +var _backbone2 = _interopRequireDefault(_backbone); + +var _error = __webpack_require__(272); + +var _error2 = _interopRequireDefault(_error); + +var _multiviews = __webpack_require__(273); + +var _multiviews2 = _interopRequireDefault(_multiviews); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var InputView = _backbone2.default.View.extend(_underscore2.default.extend({}, _multiviews2.default, { + initialize: function initialize(options) { + options = options || {}; + if (options.name === undefined) { + throw 'Missing name attribute in input view'; + } + + if (options.errorTemplate === undefined) { + throw 'Missing errorTemplate attribute in input view'; + } + + this.name = options.name; + + this.errorView = new _error2.default({ + name: this.name, + errorTemplate: options.errorTemplate, + onRenderError: options.onRenderError || null + }); + }, + render: function render() { + this._assignView({ '.error-view': this.errorView }); + }, + showErrors: function showErrors(errors) { + this.render(); + + this.errorView.renderErrors(errors); + + return this; + }, + resetErrors: function resetErrors() { + this.errorView.reset(); + } +})); /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +exports.default = InputView; + +/***/ }), + +/***/ 272: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _backbone = __webpack_require__(54); + +var _backbone2 = _interopRequireDefault(_backbone); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var ErrorView = _backbone2.default.View.extend({ + tagName: 'div', + initialize: function initialize(options) { + options = options || {}; + + if (options.name === undefined) { + throw 'Missing name attribute in error view'; + } + + if (options.errorTemplate === undefined) { + throw 'Missing errorTemplate attribute in error view'; + } + + this.name = options.name; + this.errorTemplate = options.errorTemplate; + + this.errors = options.errors || {}; + this.onRenderError = options.onRenderError || null; + }, + render: function render() { + if (this.errors.length > 0) { + var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { + errors: this.errors + }); + + this.$el.html(template); + + if (_underscore2.default.isFunction(this.onRenderError)) { + this.onRenderError(this.name, this.$el); + } + } else { + this.reset(); + } + + return this; + }, + renderErrors: function renderErrors(errors) { + this.errors = errors; + this.render(); + + return this; + }, + reset: function reset() { + this.$el.empty(); + } +}); /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +exports.default = ErrorView; + +/***/ }), + +/***/ 273: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + // bind a subview to a DOM element + _assignView: function _assignView(selector, view) { + var selectors; + if (_underscore2.default.isObject(selector)) { + selectors = selector; + } else { + selectors = {}; + selectors[selector] = view; + } + if (!selectors) return; + _underscore2.default.each(selectors, function (view, selector) { + view.setElement(this.$(selector)).render(); + }, this); + } +}; /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/***/ }), + +/***/ 274: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _form = __webpack_require__(43); + +var _form2 = _interopRequireDefault(_form); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var forgotPassword = function forgotPassword(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + new _form2.default({ + el: (0, _jquery2.default)('form[name=forgottenPasswordForm]'), + rules: [{ + name: 'email', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'email', + rules: 'valid_email', + message: localeService.t('validation_email') + }] + }); + }; + + return { initialize: initialize }; +}; +exports.default = forgotPassword; + +/***/ }), + +/***/ 275: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _passwordSetter = __webpack_require__(55); var _passwordSetter2 = _interopRequireDefault(_passwordSetter); -var _geonames = __webpack_require__(54); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var renewPassword = function renewPassword(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + + __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { + services.zxcvbn = __webpack_require__(57); + new _passwordSetter2.default({ + services: services, + el: (0, _jquery2.default)('form[name=passwordRenewForm]'), + rules: [{ + name: 'password[password]', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'password[password]', + rules: 'min_length[5]', + message: localeService.t('validation_length_min', { + postProcess: 'sprintf', + sprintf: ['5'] + }) + }, { + name: 'password[confirm]', + rules: 'matches[password[password]]', + message: localeService.t('password_match') + }] + }); + }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); + }; + + return { initialize: initialize }; +}; +exports.default = renewPassword; + +/***/ }), + +/***/ 276: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _passwordSetter = __webpack_require__(55); + +var _passwordSetter2 = _interopRequireDefault(_passwordSetter); + +var _geonames = __webpack_require__(56); var _geonames2 = _interopRequireDefault(_geonames); @@ -4190,7 +4871,7 @@ var regiser = function regiser(services) { var $form = (0, _jquery2.default)('form[name=registerForm]'); __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); + services.zxcvbn = __webpack_require__(57); new _passwordSetter2.default({ el: $form, rules: rules, @@ -4228,7 +4909,7 @@ exports.default = regiser; /***/ }), -/***/ 241: +/***/ 277: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4246,7 +4927,7 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -4347,7 +5028,7 @@ exports.default = registerProvider; /***/ }), -/***/ 242: +/***/ 278: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4361,7 +5042,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -4414,7 +5095,7 @@ exports.default = renewEmail; /***/ }), -/***/ 243: +/***/ 279: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4428,7 +5109,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _passwordSetter = __webpack_require__(53); +var _passwordSetter = __webpack_require__(55); var _passwordSetter2 = _interopRequireDefault(_passwordSetter); @@ -4451,7 +5132,7 @@ var changePassword = function changePassword(services) { var initialize = function initialize() { __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); + services.zxcvbn = __webpack_require__(57); new _passwordSetter2.default({ services: services, el: (0, _jquery2.default)('form[name=passwordChangeForm]'), @@ -4485,7 +5166,177 @@ exports.default = changePassword; /***/ }), -/***/ 244: +/***/ 28: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +// definition http://translate.sourceforge.net/wiki/l10n/pluralforms +/* eslint-disable */ +var sets = [{ lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'tg', 'ti', 'tr', 'uz', 'wa'], nr: [1, 2], fc: 1 }, { lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'es_ar', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'he', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt', 'pt_br', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'], nr: [1, 2], fc: 2 }, { lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'], nr: [1], fc: 3 }, { lngs: ['be', 'bs', 'dz', 'hr', 'ru', 'sr', 'uk'], nr: [1, 2, 5], fc: 4 }, { lngs: ['ar'], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ['cs', 'sk'], nr: [1, 2, 5], fc: 6 }, { lngs: ['csb', 'pl'], nr: [1, 2, 5], fc: 7 }, { lngs: ['cy'], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ['fr'], nr: [1, 2], fc: 9 }, { lngs: ['ga'], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ['gd'], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ['is'], nr: [1, 2], fc: 12 }, { lngs: ['jv'], nr: [0, 1], fc: 13 }, { lngs: ['kw'], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ['lt'], nr: [1, 2, 10], fc: 15 }, { lngs: ['lv'], nr: [1, 2, 0], fc: 16 }, { lngs: ['mk'], nr: [1, 2], fc: 17 }, { lngs: ['mnk'], nr: [0, 1, 2], fc: 18 }, { lngs: ['mt'], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ['or'], nr: [2, 1], fc: 2 }, { lngs: ['ro'], nr: [1, 2, 20], fc: 20 }, { lngs: ['sl'], nr: [5, 1, 2, 3], fc: 21 }]; + +var _rulesPluralsTypes = { + 1: function _(n) { + return Number(n > 1); + }, + 2: function _(n) { + return Number(n != 1); + }, + 3: function _(n) { + return 0; + }, + 4: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 5: function _(n) { + return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); + }, + 6: function _(n) { + return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); + }, + 7: function _(n) { + return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 8: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); + }, + 9: function _(n) { + return Number(n >= 2); + }, + 10: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); + }, + 11: function _(n) { + return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); + }, + 12: function _(n) { + return Number(n % 10 != 1 || n % 100 == 11); + }, + 13: function _(n) { + return Number(n !== 0); + }, + 14: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); + }, + 15: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 16: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); + }, + 17: function _(n) { + return Number(n == 1 || n % 10 == 1 ? 0 : 1); + }, + 18: function _(n) { + return Number(n == 0 ? 0 : n == 1 ? 1 : 2); + }, + 19: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); + }, + 20: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); + }, + 21: function _(n) { + return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); + } +}; +/* eslint-enable */ + +function createRules() { + var rules = {}; + sets.forEach(function (set) { + set.lngs.forEach(function (l) { + rules[l] = { + numbers: set.nr, + plurals: _rulesPluralsTypes[set.fc] + }; + }); + }); + return rules; +} + +var PluralResolver = function () { + function PluralResolver(languageUtils) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, PluralResolver); + + this.languageUtils = languageUtils; + this.options = options; + + this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('pluralResolver'); + + this.rules = createRules(); + } + + PluralResolver.prototype.addRule = function addRule(lng, obj) { + this.rules[lng] = obj; + }; + + PluralResolver.prototype.getRule = function getRule(code) { + return this.rules[this.languageUtils.getLanguagePartFromCode(code)]; + }; + + PluralResolver.prototype.needsPlural = function needsPlural(code) { + var rule = this.getRule(code); + + return rule && rule.numbers.length > 1; + }; + + PluralResolver.prototype.getSuffix = function getSuffix(code, count) { + var _this = this; + + var rule = this.getRule(code); + + if (rule) { + if (rule.numbers.length === 1) return ''; // only singular + + var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); + var suffix = rule.numbers[idx]; + + // special treatment for lngs only having singular and plural + if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { + if (suffix === 2) { + suffix = 'plural'; + } else if (suffix === 1) { + suffix = ''; + } + } + + var returnSuffix = function returnSuffix() { + return _this.options.prepend && suffix.toString() ? _this.options.prepend + suffix.toString() : suffix.toString(); + }; + + // COMPATIBILITY JSON + // v1 + if (this.options.compatibilityJSON === 'v1') { + if (suffix === 1) return ''; + if (typeof suffix === 'number') return '_plural_' + suffix.toString(); + return returnSuffix(); + } else if ( /* v2 */this.options.compatibilityJSON === 'v2' || rule.numbers.length === 2 && rule.numbers[0] === 1) { + return returnSuffix(); + } else if ( /* v3 - gettext index */rule.numbers.length === 2 && rule.numbers[0] === 1) { + return returnSuffix(); + } + return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); + } + + this.logger.warn('no plural rule found for: ' + code); + return ''; + }; + + return PluralResolver; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (PluralResolver); + +/***/ }), + +/***/ 280: /***/ (function(module, exports) { /*** IMPORTS FROM imports-loader ***/ @@ -5912,770 +6763,11 @@ exports.default = changePassword; /***/ }), -/***/ 25: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } - - - - -var ResourceStore = function (_EventEmitter) { - _inherits(ResourceStore, _EventEmitter); - - function ResourceStore() { - var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { ns: ['translation'], defaultNS: 'translation' }; - - _classCallCheck(this, ResourceStore); - - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - - _this.data = data; - _this.options = options; - return _this; - } - - ResourceStore.prototype.addNamespaces = function addNamespaces(ns) { - if (this.options.ns.indexOf(ns) < 0) { - this.options.ns.push(ns); - } - }; - - ResourceStore.prototype.removeNamespaces = function removeNamespaces(ns) { - var index = this.options.ns.indexOf(ns); - if (index > -1) { - this.options.ns.splice(index, 1); - } - }; - - ResourceStore.prototype.getResource = function getResource(lng, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - var keySeparator = options.keySeparator || this.options.keySeparator; - if (keySeparator === undefined) keySeparator = '.'; - - var path = [lng, ns]; - if (key && typeof key !== 'string') path = path.concat(key); - if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); - - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - } - - return __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path); - }; - - ResourceStore.prototype.addResource = function addResource(lng, ns, key, value) { - var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { silent: false }; - - var keySeparator = this.options.keySeparator; - if (keySeparator === undefined) keySeparator = '.'; - - var path = [lng, ns]; - if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); - - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - value = ns; - ns = path[1]; - } - - this.addNamespaces(ns); - - __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, value); - - if (!options.silent) this.emit('added', lng, ns, key, value); - }; - - ResourceStore.prototype.addResources = function addResources(lng, ns, resources) { - /* eslint no-restricted-syntax: 0 */ - for (var m in resources) { - if (typeof resources[m] === 'string') this.addResource(lng, ns, m, resources[m], { silent: true }); - } - this.emit('added', lng, ns, resources); - }; - - ResourceStore.prototype.addResourceBundle = function addResourceBundle(lng, ns, resources, deep, overwrite) { - var path = [lng, ns]; - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - deep = resources; - resources = ns; - ns = path[1]; - } - - this.addNamespaces(ns); - - var pack = __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path) || {}; - - if (deep) { - __WEBPACK_IMPORTED_MODULE_1__utils__["b" /* deepExtend */](pack, resources, overwrite); - } else { - pack = _extends({}, pack, resources); - } - - __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, pack); - - this.emit('added', lng, ns, resources); - }; - - ResourceStore.prototype.removeResourceBundle = function removeResourceBundle(lng, ns) { - if (this.hasResourceBundle(lng, ns)) { - delete this.data[lng][ns]; - } - this.removeNamespaces(ns); - - this.emit('removed', lng, ns); - }; - - ResourceStore.prototype.hasResourceBundle = function hasResourceBundle(lng, ns) { - return this.getResource(lng, ns) !== undefined; - }; - - ResourceStore.prototype.getResourceBundle = function getResourceBundle(lng, ns) { - if (!ns) ns = this.options.defaultNS; - - // COMPATIBILITY: remove extend in v2.1.0 - if (this.options.compatibilityAPI === 'v1') return _extends({}, this.getResource(lng, ns)); - - return this.getResource(lng, ns); - }; - - ResourceStore.prototype.toJSON = function toJSON() { - return this.data; - }; - - return ResourceStore; -}(__WEBPACK_IMPORTED_MODULE_0__EventEmitter__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (ResourceStore); - -/***/ }), - -/***/ 26: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } - - - - - - - -var Translator = function (_EventEmitter) { - _inherits(Translator, _EventEmitter); - - function Translator(services) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Translator); - - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - - __WEBPACK_IMPORTED_MODULE_4__utils__["a" /* copy */](['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector'], services, _this); - - _this.options = options; - _this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('translator'); - return _this; - } - - Translator.prototype.changeLanguage = function changeLanguage(lng) { - if (lng) this.language = lng; - }; - - Translator.prototype.exists = function exists(key) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { interpolation: {} }; - - if (this.options.compatibilityAPI === 'v1') { - options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); - } - - return this.resolve(key, options) !== undefined; - }; - - Translator.prototype.extractFromKey = function extractFromKey(key, options) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - if (nsSeparator === undefined) nsSeparator = ':'; - var keySeparator = options.keySeparator || this.options.keySeparator || '.'; - - var namespaces = options.ns || this.options.defaultNS; - if (nsSeparator && key.indexOf(nsSeparator) > -1) { - var parts = key.split(nsSeparator); - if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); - key = parts.join(keySeparator); - } - if (typeof namespaces === 'string') namespaces = [namespaces]; - - return { - key: key, - namespaces: namespaces - }; - }; - - Translator.prototype.translate = function translate(keys) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') { - /* eslint prefer-rest-params: 0 */ - options = this.options.overloadTranslationOptionHandler(arguments); - } else if (this.options.compatibilityAPI === 'v1') { - options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); - } - - // non valid keys handling - if (keys === undefined || keys === null || keys === '') return ''; - if (typeof keys === 'number') keys = String(keys); - if (typeof keys === 'string') keys = [keys]; - - // separators - var keySeparator = options.keySeparator || this.options.keySeparator || '.'; - - // get namespace(s) - - var _extractFromKey = this.extractFromKey(keys[keys.length - 1], options), - key = _extractFromKey.key, - namespaces = _extractFromKey.namespaces; - - var namespace = namespaces[namespaces.length - 1]; - - // return key on CIMode - var lng = options.lng || this.language; - var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; - if (lng && lng.toLowerCase() === 'cimode') { - if (appendNamespaceToCIMode) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - return namespace + nsSeparator + key; - } - - return key; - } - - // resolve from store - var res = this.resolve(keys, options); - - var resType = Object.prototype.toString.apply(res); - var noObject = ['[object Number]', '[object Function]', '[object RegExp]']; - var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; - - // object - if (res && typeof res !== 'string' && noObject.indexOf(resType) < 0 && !(joinArrays && resType === '[object Array]')) { - if (!options.returnObjects && !this.options.returnObjects) { - this.logger.warn('accessing an object - but returnObjects options is not enabled!'); - return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(key, res, options) : 'key \'' + key + ' (' + this.language + ')\' returned an object instead of string.'; - } - - // if we got a separator we loop over children - else we just return object as is - // as having it set to false means no hierarchy so no lookup for nested values - if (options.keySeparator || this.options.keySeparator) { - var copy = resType === '[object Array]' ? [] : {}; // apply child translation on a copy - - /* eslint no-restricted-syntax: 0 */ - for (var m in res) { - if (Object.prototype.hasOwnProperty.call(res, m)) { - copy[m] = this.translate('' + key + keySeparator + m, _extends({}, options, { joinArrays: false, ns: namespaces })); - } - } - res = copy; - } - } else if (joinArrays && resType === '[object Array]') { - // array special treatment - res = res.join(joinArrays); - if (res) res = this.extendTranslation(res, key, options); - } else { - // string, empty or null - var usedDefault = false; - var usedKey = false; - - // fallback value - if (!this.isValidLookup(res) && options.defaultValue !== undefined) { - usedDefault = true; - res = options.defaultValue; - } - if (!this.isValidLookup(res)) { - usedKey = true; - res = key; - } - - // save missing - if (usedKey || usedDefault) { - this.logger.log('missingKey', lng, namespace, key, res); - - var lngs = []; - var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); - if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { - for (var i = 0; i < fallbackLngs.length; i++) { - lngs.push(fallbackLngs[i]); - } - } else if (this.options.saveMissingTo === 'all') { - lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); - } else { - lngs.push(options.lng || this.language); - } - - if (this.options.saveMissing) { - if (this.options.missingKeyHandler) { - this.options.missingKeyHandler(lngs, namespace, key, res); - } else if (this.backendConnector && this.backendConnector.saveMissing) { - this.backendConnector.saveMissing(lngs, namespace, key, res); - } - } - - this.emit('missingKey', lngs, namespace, key, res); - } - - // extend - res = this.extendTranslation(res, key, options); - - // append namespace if still key - if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = namespace + ':' + key; - - // parseMissingKeyHandler - if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); - } - - // return - return res; - }; - - Translator.prototype.extendTranslation = function extendTranslation(res, key, options) { - var _this2 = this; - - if (options.interpolation) this.interpolator.init(_extends({}, options, { interpolation: _extends({}, this.options.interpolation, options.interpolation) })); - - // interpolate - var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; - if (this.options.interpolation.defaultVariables) data = _extends({}, this.options.interpolation.defaultVariables, data); - res = this.interpolator.interpolate(res, data, options.lng || this.language); - - // nesting - if (options.nest !== false) res = this.interpolator.nest(res, function () { - return _this2.translate.apply(_this2, arguments); - }, options); - - if (options.interpolation) this.interpolator.reset(); - - // post process - var postProcess = options.postProcess || this.options.postProcess; - var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess; - - if (res !== undefined && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { - res = __WEBPACK_IMPORTED_MODULE_2__postProcessor__["a" /* default */].handle(postProcessorNames, res, key, options, this); - } - - return res; - }; - - Translator.prototype.resolve = function resolve(keys) { - var _this3 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var found = void 0; - - if (typeof keys === 'string') keys = [keys]; - - // forEach possible key - keys.forEach(function (k) { - if (_this3.isValidLookup(found)) return; - - var extracted = _this3.extractFromKey(k, options); - var key = extracted.key; - var namespaces = extracted.namespaces; - if (_this3.options.fallbackNS) namespaces = namespaces.concat(_this3.options.fallbackNS); - - var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; - var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; - - var codes = options.lngs ? options.lngs : _this3.languageUtils.toResolveHierarchy(options.lng || _this3.language); - - namespaces.forEach(function (ns) { - if (_this3.isValidLookup(found)) return; - - codes.forEach(function (code) { - if (_this3.isValidLookup(found)) return; - - var finalKey = key; - var finalKeys = [finalKey]; - - var pluralSuffix = void 0; - if (needsPluralHandling) pluralSuffix = _this3.pluralResolver.getSuffix(code, options.count); - - // fallback for plural if context not found - if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); - - // get key for context if needed - if (needsContextHandling) finalKeys.push(finalKey += '' + _this3.options.contextSeparator + options.context); - - // get key for plural if needed - if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); - - // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only - var possibleKey = void 0; - /* eslint no-cond-assign: 0 */ - while (possibleKey = finalKeys.pop()) { - if (!_this3.isValidLookup(found)) { - found = _this3.getResource(code, ns, possibleKey, options); - } - } - }); - }); - }); - - return found; - }; - - Translator.prototype.isValidLookup = function isValidLookup(res) { - return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); - }; - - Translator.prototype.getResource = function getResource(code, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - return this.resourceStore.getResource(code, ns, key, options); - }; - - return Translator; -}(__WEBPACK_IMPORTED_MODULE_1__EventEmitter__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (Translator); - -/***/ }), - -/***/ 27: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -function capitalize(string) { - return string.charAt(0).toUpperCase() + string.slice(1); -} - -var LanguageUtil = function () { - function LanguageUtil(options) { - _classCallCheck(this, LanguageUtil); - - this.options = options; - - this.whitelist = this.options.whitelist || false; - this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('languageUtils'); - } - - LanguageUtil.prototype.getScriptPartFromCode = function getScriptPartFromCode(code) { - if (!code || code.indexOf('-') < 0) return null; - - var p = code.split('-'); - if (p.length === 2) return null; - p.pop(); - return this.formatLanguageCode(p.join('-')); - }; - - LanguageUtil.prototype.getLanguagePartFromCode = function getLanguagePartFromCode(code) { - if (!code || code.indexOf('-') < 0) return code; - - var p = code.split('-'); - return this.formatLanguageCode(p[0]); - }; - - LanguageUtil.prototype.formatLanguageCode = function formatLanguageCode(code) { - // http://www.iana.org/assignments/language-tags/language-tags.xhtml - if (typeof code === 'string' && code.indexOf('-') > -1) { - var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab']; - var p = code.split('-'); - - if (this.options.lowerCaseLng) { - p = p.map(function (part) { - return part.toLowerCase(); - }); - } else if (p.length === 2) { - p[0] = p[0].toLowerCase(); - p[1] = p[1].toUpperCase(); - - if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); - } else if (p.length === 3) { - p[0] = p[0].toLowerCase(); - - // if lenght 2 guess it's a country - if (p[1].length === 2) p[1] = p[1].toUpperCase(); - if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); - - if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); - if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase()); - } - - return p.join('-'); - } - - return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; - }; - - LanguageUtil.prototype.isWhitelisted = function isWhitelisted(code) { - if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { - code = this.getLanguagePartFromCode(code); - } - return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1; - }; - - LanguageUtil.prototype.getFallbackCodes = function getFallbackCodes(fallbacks, code) { - if (!fallbacks) return []; - if (typeof fallbacks === 'string') fallbacks = [fallbacks]; - if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; - - if (!code) return fallbacks.default || []; - - // asume we have an object defining fallbacks - var found = fallbacks[code]; - if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; - if (!found) found = fallbacks[this.formatLanguageCode(code)]; - if (!found) found = fallbacks.default; - - return found || []; - }; - - LanguageUtil.prototype.toResolveHierarchy = function toResolveHierarchy(code, fallbackCode) { - var _this = this; - - var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code); - - var codes = []; - var addCode = function addCode(c) { - if (!c) return; - if (_this.isWhitelisted(c)) { - codes.push(c); - } else { - _this.logger.warn('rejecting non-whitelisted language code: ' + c); - } - }; - - if (typeof code === 'string' && code.indexOf('-') > -1) { - if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); - if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); - if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); - } else if (typeof code === 'string') { - addCode(this.formatLanguageCode(code)); - } - - fallbackCodes.forEach(function (fc) { - if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); - }); - - return codes; - }; - - return LanguageUtil; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (LanguageUtil); - -/***/ }), - -/***/ 28: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -// definition http://translate.sourceforge.net/wiki/l10n/pluralforms -/* eslint-disable */ -var sets = [{ lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'tg', 'ti', 'tr', 'uz', 'wa'], nr: [1, 2], fc: 1 }, { lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'es_ar', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'he', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt', 'pt_br', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'], nr: [1, 2], fc: 2 }, { lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'], nr: [1], fc: 3 }, { lngs: ['be', 'bs', 'dz', 'hr', 'ru', 'sr', 'uk'], nr: [1, 2, 5], fc: 4 }, { lngs: ['ar'], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ['cs', 'sk'], nr: [1, 2, 5], fc: 6 }, { lngs: ['csb', 'pl'], nr: [1, 2, 5], fc: 7 }, { lngs: ['cy'], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ['fr'], nr: [1, 2], fc: 9 }, { lngs: ['ga'], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ['gd'], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ['is'], nr: [1, 2], fc: 12 }, { lngs: ['jv'], nr: [0, 1], fc: 13 }, { lngs: ['kw'], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ['lt'], nr: [1, 2, 10], fc: 15 }, { lngs: ['lv'], nr: [1, 2, 0], fc: 16 }, { lngs: ['mk'], nr: [1, 2], fc: 17 }, { lngs: ['mnk'], nr: [0, 1, 2], fc: 18 }, { lngs: ['mt'], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ['or'], nr: [2, 1], fc: 2 }, { lngs: ['ro'], nr: [1, 2, 20], fc: 20 }, { lngs: ['sl'], nr: [5, 1, 2, 3], fc: 21 }]; - -var _rulesPluralsTypes = { - 1: function _(n) { - return Number(n > 1); - }, - 2: function _(n) { - return Number(n != 1); - }, - 3: function _(n) { - return 0; - }, - 4: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 5: function _(n) { - return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); - }, - 6: function _(n) { - return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); - }, - 7: function _(n) { - return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 8: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); - }, - 9: function _(n) { - return Number(n >= 2); - }, - 10: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); - }, - 11: function _(n) { - return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); - }, - 12: function _(n) { - return Number(n % 10 != 1 || n % 100 == 11); - }, - 13: function _(n) { - return Number(n !== 0); - }, - 14: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); - }, - 15: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 16: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); - }, - 17: function _(n) { - return Number(n == 1 || n % 10 == 1 ? 0 : 1); - }, - 18: function _(n) { - return Number(n == 0 ? 0 : n == 1 ? 1 : 2); - }, - 19: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); - }, - 20: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); - }, - 21: function _(n) { - return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); - } -}; -/* eslint-enable */ - -function createRules() { - var rules = {}; - sets.forEach(function (set) { - set.lngs.forEach(function (l) { - rules[l] = { - numbers: set.nr, - plurals: _rulesPluralsTypes[set.fc] - }; - }); - }); - return rules; -} - -var PluralResolver = function () { - function PluralResolver(languageUtils) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, PluralResolver); - - this.languageUtils = languageUtils; - this.options = options; - - this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('pluralResolver'); - - this.rules = createRules(); - } - - PluralResolver.prototype.addRule = function addRule(lng, obj) { - this.rules[lng] = obj; - }; - - PluralResolver.prototype.getRule = function getRule(code) { - return this.rules[this.languageUtils.getLanguagePartFromCode(code)]; - }; - - PluralResolver.prototype.needsPlural = function needsPlural(code) { - var rule = this.getRule(code); - - return rule && rule.numbers.length > 1; - }; - - PluralResolver.prototype.getSuffix = function getSuffix(code, count) { - var _this = this; - - var rule = this.getRule(code); - - if (rule) { - if (rule.numbers.length === 1) return ''; // only singular - - var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); - var suffix = rule.numbers[idx]; - - // special treatment for lngs only having singular and plural - if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { - if (suffix === 2) { - suffix = 'plural'; - } else if (suffix === 1) { - suffix = ''; - } - } - - var returnSuffix = function returnSuffix() { - return _this.options.prepend && suffix.toString() ? _this.options.prepend + suffix.toString() : suffix.toString(); - }; - - // COMPATIBILITY JSON - // v1 - if (this.options.compatibilityJSON === 'v1') { - if (suffix === 1) return ''; - if (typeof suffix === 'number') return '_plural_' + suffix.toString(); - return returnSuffix(); - } else if ( /* v2 */this.options.compatibilityJSON === 'v2' || rule.numbers.length === 2 && rule.numbers[0] === 1) { - return returnSuffix(); - } else if ( /* v3 - gettext index */rule.numbers.length === 2 && rule.numbers[0] === 1) { - return returnSuffix(); - } - return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); - } - - this.logger.warn('no plural rule found for: ' + code); - return ''; - }; - - return PluralResolver; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (PluralResolver); - -/***/ }), - /***/ 29: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -6952,9 +7044,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -7247,7 +7339,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -7671,7 +7763,7 @@ exports.default = ajax; /***/ }), -/***/ 37: +/***/ 38: /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -22683,7 +22775,7 @@ $.widget( "ui.tooltip", { /***/ }), -/***/ 38: +/***/ 39: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -25055,11 +25147,11 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 42: +/***/ 43: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25077,15 +25169,15 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _backbone = __webpack_require__(52); +var _backbone = __webpack_require__(54); var _backbone2 = _interopRequireDefault(_backbone); -var _validator = __webpack_require__(234); +var _validator = __webpack_require__(270); var _validator2 = _interopRequireDefault(_validator); -var _input = __webpack_require__(235); +var _input = __webpack_require__(271); var _input2 = _interopRequireDefault(_input); @@ -25177,76 +25269,34 @@ exports.default = Form; /***/ }), /***/ 5: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ (function(module, exports) { -"use strict"; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; -var EventEmitter = function () { - function EventEmitter() { - _classCallCheck(this, EventEmitter); - - this.observers = {}; - } - - EventEmitter.prototype.on = function on(events, listener) { - var _this = this; - - events.split(' ').forEach(function (event) { - _this.observers[event] = _this.observers[event] || []; - _this.observers[event].push(listener); - }); - }; - - EventEmitter.prototype.off = function off(event, listener) { - var _this2 = this; - - if (!this.observers[event]) { - return; - } - - this.observers[event].forEach(function () { - if (!listener) { - delete _this2.observers[event]; - } else { - var index = _this2.observers[event].indexOf(listener); - if (index > -1) { - _this2.observers[event].splice(index, 1); - } - } - }); - }; - - EventEmitter.prototype.emit = function emit(event) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - if (this.observers[event]) { - var cloned = [].concat(this.observers[event]); - cloned.forEach(function (observer) { - observer.apply(undefined, args); - }); - } - - if (this.observers['*']) { - var _cloned = [].concat(this.observers['*']); - _cloned.forEach(function (observer) { - var _ref; - - observer.apply(observer, (_ref = [event]).concat.apply(_ref, args)); - }); - } - }; - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); /***/ }), -/***/ 52: +/***/ 54: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3 @@ -27171,11 +27221,11 @@ var EventEmitter = function () { return Backbone; }); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/***/ 53: +/***/ 55: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27193,7 +27243,7 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -27272,7 +27322,7 @@ exports.default = PasswordSetterForm; /***/ }), -/***/ 54: +/***/ 56: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27288,8 +27338,8 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(37); __webpack_require__(38); +__webpack_require__(39); var geonames = { init: function init($field, options) { @@ -27334,30 +27384,72 @@ exports.default = geonames; /***/ }), /***/ 6: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; +"use strict"; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var EventEmitter = function () { + function EventEmitter() { + _classCallCheck(this, EventEmitter); + + this.observers = {}; + } + + EventEmitter.prototype.on = function on(events, listener) { + var _this = this; + + events.split(' ').forEach(function (event) { + _this.observers[event] = _this.observers[event] || []; + _this.observers[event].push(listener); + }); + }; + + EventEmitter.prototype.off = function off(event, listener) { + var _this2 = this; + + if (!this.observers[event]) { + return; + } + + this.observers[event].forEach(function () { + if (!listener) { + delete _this2.observers[event]; + } else { + var index = _this2.observers[event].indexOf(listener); + if (index > -1) { + _this2.observers[event].splice(index, 1); + } + } + }); + }; + + EventEmitter.prototype.emit = function emit(event) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (this.observers[event]) { + var cloned = [].concat(this.observers[event]); + cloned.forEach(function (observer) { + observer.apply(undefined, args); + }); + } + + if (this.observers['*']) { + var _cloned = [].concat(this.observers['*']); + _cloned.forEach(function (observer) { + var _ref; + + observer.apply(observer, (_ref = [event]).concat.apply(_ref, args)); + }); + } + }; + + return EventEmitter; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); /***/ }), @@ -39754,128 +39846,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/authenticate.min.js b/Phraseanet-production-client/dist/authenticate.min.js index d76e6febc5..70d57d004d 100644 --- a/Phraseanet-production-client/dist/authenticate.min.js +++ b/Phraseanet-production-client/dist/authenticate.min.js @@ -152,7 +152,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 228); +/******/ return __webpack_require__(__webpack_require__.s = 264); /******/ }) /************************************************************************/ /******/ ({ @@ -165,31 +165,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -2317,7 +2409,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -2669,989 +2761,6 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; -/***/ }), - -/***/ 228: -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(229); - - -/***/ }), - -/***/ 229: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _bootstrap = __webpack_require__(230); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var authenticateApp = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.authenticateApp = authenticateApp; -} - -module.exports = authenticateApp; - -/***/ }), - -/***/ 230: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _config = __webpack_require__(231); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _authentication = __webpack_require__(232); - -var _authentication2 = _interopRequireDefault(_authentication); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Bootstrap = function () { - function Bootstrap(userConfig) { - var _this = this; - - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.localeService = new _locale2.default({ - configService: this.configService - }); - - this.localeService.fetchTranslations().then(function () { - _this.onConfigReady(); - }); - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this2 = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - // export translation for backward compatibility: - // window.language = this.localeService.getTranslations(); - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - var authService = (0, _authentication2.default)(_this2.appServices); - - authService.initialize(); - - switch (_this2.configService.get('state')) { - case 'login': - authService.login(); - break; - case 'forgotPassword': - authService.forgotPassword(); - break; - case 'renewPassword': - authService.renewPassword(); - break; - case 'register': - authService.register(); - break; - case 'registerProvider': - authService.registerProvider(); - break; - case 'renewEmail': - authService.renewEmail(); - break; - case 'changePassword': - authService.changePassword(); - break; - default: - } - }); - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 231: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/login/language.json' -}; - -exports.default = defaultConfig; - -/***/ }), - -/***/ 232: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _login = __webpack_require__(233); - -var _login2 = _interopRequireDefault(_login); - -var _forgotPassword = __webpack_require__(238); - -var _forgotPassword2 = _interopRequireDefault(_forgotPassword); - -var _renewPassword = __webpack_require__(239); - -var _renewPassword2 = _interopRequireDefault(_renewPassword); - -var _register = __webpack_require__(240); - -var _register2 = _interopRequireDefault(_register); - -var _registerProvider = __webpack_require__(241); - -var _registerProvider2 = _interopRequireDefault(_registerProvider); - -var _renewEmail = __webpack_require__(242); - -var _renewEmail2 = _interopRequireDefault(_renewEmail); - -var _changePassword = __webpack_require__(243); - -var _changePassword2 = _interopRequireDefault(_changePassword); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -__webpack_require__(244); // multiselect - -var authentication = function authentication(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - - var initialize = function initialize() { - // close alerts - (0, _jquery2.default)(document).on('click', '.alert .alert-block-close a', function (e) { - e.preventDefault(); - (0, _jquery2.default)(this).closest('.alert').alert('close'); - return false; - }); - - (0, _jquery2.default)('select[multiple="multiple"]').multiselect({ - buttonWidth: '100%', - buttonClass: 'btn btn-inverse', - maxHeight: 185, - includeSelectAllOption: true, - selectAllValue: 'all', - selectAllText: localeService.t('all_collections'), - buttonText: function buttonText(options, select) { - if (options.length === 0) { - return localeService.t('no_collection_selected') + ''; - } else { - return localeService.t(options.length === 1 ? 'one_collection_selected' : 'collections_selected', { - postProcess: 'sprintf', - sprintf: [options.length] - }) + ' '; - } - } - }); - (0, _jquery2.default)('form[name="registerForm"]').on('submit', function () { - // must deselect the 'select all' checkbox for server side validation. - (0, _jquery2.default)('select[multiple="multiple"]').multiselect('deselect', 'all'); - }); - }; - - var login = function login() { - // init login form - (0, _login2.default)(services).initialize(); - }; - var forgotPassword = function forgotPassword() { - // init login form - (0, _forgotPassword2.default)(services).initialize(); - }; - var renewPassword = function renewPassword() { - // init login form - (0, _renewPassword2.default)(services).initialize(); - }; - var register = function register() { - // init login form - (0, _register2.default)(services).initialize(); - }; - var registerProvider = function registerProvider() { - // init login form - (0, _registerProvider2.default)(services).initialize(); - }; - var renewEmail = function renewEmail() { - // init login form - (0, _renewEmail2.default)(services).initialize(); - }; - var changePassword = function changePassword() { - // init login form - (0, _changePassword2.default)(services).initialize(); - }; - - return { initialize: initialize, login: login, forgotPassword: forgotPassword, renewPassword: renewPassword, register: register, registerProvider: registerProvider, renewEmail: renewEmail, changePassword: changePassword }; -}; -exports.default = authentication; - -/***/ }), - -/***/ 233: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _form = __webpack_require__(42); - -var _form2 = _interopRequireDefault(_form); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var login = function login(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - - new _form2.default({ - el: (0, _jquery2.default)('form[name=loginForm]'), - rules: [{ - name: 'login', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'password', - rules: 'required', - message: localeService.t('validation_blank') - }] - }); - }; - - return { initialize: initialize }; -}; -exports.default = login; - -/***/ }), - -/***/ 234: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var FormValidator = function FormValidator(rules, handlers) { - // rules setted by user - this.rules = rules || []; - // custom callbacks - this.handlers = handlers || []; - // final fields to validate - this.fields = []; - - var self = this; - - _underscore2.default.each(this.rules, function (field) { - if ('name' in field && 'rules' in field) { - self._addField(field); - } - }); -}; - -// Validate method, argument is the serialize form -FormValidator.prototype.validate = function (inputs) { - var self = this; - // possible errors - this.errors = []; - // inputs present in form - this.inputs = {}; - - _underscore2.default.each(_underscore2.default.groupBy(inputs, function (input) { - return input.name; - }), function (fields, name) { - self.inputs[name] = fields; - }); - - this._validateForm(); - - return this; -}; - -FormValidator.prototype.getErrors = function () { - return this.errors; -}; - -FormValidator.prototype.hasErrors = function () { - return this.errors.length > 0; -}; - -FormValidator.prototype.getRules = function () { - return this.rules; -}; - -FormValidator.prototype._addField = function (field) { - this.fields.push({ - name: field.name, - rules: field.rules, - message: field.message || 'An error ocurred on input[name=' + field.name + '], you can edit this message by setting a "message" property in your rule definition object', - value: null, - type: field.type || 'text' - }); -}; - -FormValidator.prototype._validateForm = function () { - var self = this; - this.errors = []; - _underscore2.default.each(this.fields, function (field) { - if (_underscore2.default.has(self.inputs, field.name)) { - // values can be multiple - var values = []; - - _underscore2.default.each(self.inputs[field.name], function (field) { - return values.push(field.value); - }); - - field.value = values.join(','); - - self._validateField(field); - } else if (field.type === 'checkbox' || field.type === 'radio' || field.type === 'select' || field.type === 'multiple') { - field.value = ''; - self._validateField(field); - } - }); -}; - -FormValidator.prototype._validateField = function (field) { - var self = this; - var ruleRegex = /^(.+?)\[(.+)\]$/; - var rules = field.rules.split('|'); - - // Run through the rules and execute the validation methods as needed - _underscore2.default.every(rules, function (method) { - var param = null; - var failed = false; - var parts = ruleRegex.exec(method); - - // If the rule has a parameter (i.e. matches[param]) split it out - if (parts) { - method = parts[1]; - param = parts[2]; - } - - // If the hook is defined, run it to find any validation errors - if (typeof self._hooks[method] === 'function') { - if (!self._hooks[method].apply(self, [field, param])) { - failed = true; - } - } else if (method.substring(0, 9) === 'callback_') { - // Custom method. Execute the handler if it was registered - method = method.substring(9, method.length); - - if (typeof self.handlers[method] === 'function') { - if (this.handlers[method].apply(self, [field.value, param]) === false) { - failed = true; - } - } - } - - // If the hook failed, add a message to the errors array - if (failed) { - self.errors.push({ - name: field.name, - value: field.value, - message: field.message, - rule: method - }); - } - - // Breaks loop iteration - return failed; - }); -}; - -FormValidator.prototype.Regexp = { - numericRegex: /^[0-9]+$/, - integerRegex: /^\-?[0-9]+$/, - decimalRegex: /^\-?[0-9]*\.?[0-9]+$/, - emailRegex: /^[^@]+@[^@]+\.[^@]+$/, - alphaRegex: /^[a-z]+$/i, - alphaNumericRegex: /^[a-z0-9]+$/i, - alphaDashRegex: /^[a-z0-9_\-]+$/i, - naturalRegex: /^[0-9]+$/i, - naturalNoZeroRegex: /^[1-9][0-9]*$/i, - // IP v6 a v4 or hostname, by Mikulas Dite see http://stackoverflow.com/a/9209720/96656 - ipRegex: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,1}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,2}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$/i, - numericDashRegex: /^[\d\-\s]+$/, - urlRegex: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/ -}; - -// Object containing all of the validation hooks -FormValidator.prototype._hooks = { - required: function required(field) { - var value = field.value; - - return value !== null && value !== ''; - }, - equal: function equal(field, defaultName) { - return field.value === defaultName; - }, - matches: function matches(field, matchName) { - if (typeof this.inputs[matchName] === 'undefined') { - return false; - } - - var el = this.inputs[matchName].shift(); - - if (el) { - return field.value === el.value; - } - - return false; - }, - valid_email: function valid_email(field) { - return this.Regexp.emailRegex.test(field.value); - }, - valid_emails: function valid_emails(field) { - var result = field.value.split(','); - - for (var i = 0; i < result.length; i++) { - if (!this.Regexp.emailRegex.test(_jquery2.default.trim(result[i]))) { - return false; - } - } - - return true; - }, - min_length: function min_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length >= parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length >= parseInt(length, 10); - }, - max_length: function max_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length <= parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length <= parseInt(length, 10); - }, - exact_length: function exact_length(field, length) { - if (field.type === 'multiple') { - return _underscore2.default.filter(field.value.split(','), function (value) { - return value !== ''; - }).length === parseInt(length, 10); - } - - if (!this.Regexp.numericRegex.test(length)) { - return false; - } - - return field.value.length === parseInt(length, 10); - }, - greater_than: function greater_than(field, param) { - if (!this.Regexp.decimalRegex.test(field.value)) { - return false; - } - - return parseFloat(field.value) > parseFloat(param); - }, - less_than: function less_than(field, param) { - if (!this.Regexp.decimalRegex.test(field.value)) { - return false; - } - - return parseFloat(field.value) < parseFloat(param); - }, - alpha: function alpha(field) { - return this.Regexp.alphaRegex.test(field.value); - }, - alpha_numeric: function alpha_numeric(field) { - return this.Regexp.alphaNumericRegex.test(field.value); - }, - alpha_dash: function alpha_dash(field) { - return this.Regexp.alphaDashRegex.test(field.value); - }, - numeric: function numeric(field) { - return this.Regexp.numericRegex.test(field.value); - }, - integer: function integer(field) { - return this.Regexp.integerRegex.test(field.value); - }, - decimal: function decimal(field) { - return this.Regexp.decimalRegex.test(field.value); - }, - is_natural: function is_natural(field) { - return this.Regexp.naturalRegex.test(field.value); - }, - is_natural_no_zero: function is_natural_no_zero(field) { - return this.Regexp.naturalNoZeroRegex.test(field.value); - }, - valid_ip: function valid_ip(field) { - return this.Regexp.ipRegex.test(field.value); - }, - valid_url: function valid_url(field) { - return this.Regexp.urlRegex.test(field.value); - } -}; - -exports.default = FormValidator; - -/***/ }), - -/***/ 235: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -var _backbone = __webpack_require__(52); - -var _backbone2 = _interopRequireDefault(_backbone); - -var _error = __webpack_require__(236); - -var _error2 = _interopRequireDefault(_error); - -var _multiviews = __webpack_require__(237); - -var _multiviews2 = _interopRequireDefault(_multiviews); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var InputView = _backbone2.default.View.extend(_underscore2.default.extend({}, _multiviews2.default, { - initialize: function initialize(options) { - options = options || {}; - if (options.name === undefined) { - throw 'Missing name attribute in input view'; - } - - if (options.errorTemplate === undefined) { - throw 'Missing errorTemplate attribute in input view'; - } - - this.name = options.name; - - this.errorView = new _error2.default({ - name: this.name, - errorTemplate: options.errorTemplate, - onRenderError: options.onRenderError || null - }); - }, - render: function render() { - this._assignView({ '.error-view': this.errorView }); - }, - showErrors: function showErrors(errors) { - this.render(); - - this.errorView.renderErrors(errors); - - return this; - }, - resetErrors: function resetErrors() { - this.errorView.reset(); - } -})); /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -exports.default = InputView; - -/***/ }), - -/***/ 236: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -var _backbone = __webpack_require__(52); - -var _backbone2 = _interopRequireDefault(_backbone); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ErrorView = _backbone2.default.View.extend({ - tagName: 'div', - initialize: function initialize(options) { - options = options || {}; - - if (options.name === undefined) { - throw 'Missing name attribute in error view'; - } - - if (options.errorTemplate === undefined) { - throw 'Missing errorTemplate attribute in error view'; - } - - this.name = options.name; - this.errorTemplate = options.errorTemplate; - - this.errors = options.errors || {}; - this.onRenderError = options.onRenderError || null; - }, - render: function render() { - if (this.errors.length > 0) { - var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { - errors: this.errors - }); - - this.$el.html(template); - - if (_underscore2.default.isFunction(this.onRenderError)) { - this.onRenderError(this.name, this.$el); - } - } else { - this.reset(); - } - - return this; - }, - renderErrors: function renderErrors(errors) { - this.errors = errors; - this.render(); - - return this; - }, - reset: function reset() { - this.$el.empty(); - } -}); /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -exports.default = ErrorView; - -/***/ }), - -/***/ 237: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _underscore = __webpack_require__(2); - -var _underscore2 = _interopRequireDefault(_underscore); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - // bind a subview to a DOM element - _assignView: function _assignView(selector, view) { - var selectors; - if (_underscore2.default.isObject(selector)) { - selectors = selector; - } else { - selectors = {}; - selectors[selector] = view; - } - if (!selectors) return; - _underscore2.default.each(selectors, function (view, selector) { - view.setElement(this.$(selector)).render(); - }, this); - } -}; /* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/***/ }), - -/***/ 238: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _form = __webpack_require__(42); - -var _form2 = _interopRequireDefault(_form); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var forgotPassword = function forgotPassword(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - new _form2.default({ - el: (0, _jquery2.default)('form[name=forgottenPasswordForm]'), - rules: [{ - name: 'email', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'email', - rules: 'valid_email', - message: localeService.t('validation_email') - }] - }); - }; - - return { initialize: initialize }; -}; -exports.default = forgotPassword; - -/***/ }), - -/***/ 239: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _passwordSetter = __webpack_require__(53); - -var _passwordSetter2 = _interopRequireDefault(_passwordSetter); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * This file is part of Phraseanet - * - * (c) 2005-2016 Alchemy - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -var renewPassword = function renewPassword(services) { - var configService = services.configService, - localeService = services.localeService, - appEvents = services.appEvents; - - var initialize = function initialize() { - - __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); - new _passwordSetter2.default({ - services: services, - el: (0, _jquery2.default)('form[name=passwordRenewForm]'), - rules: [{ - name: 'password[password]', - rules: 'required', - message: localeService.t('validation_blank') - }, { - name: 'password[password]', - rules: 'min_length[5]', - message: localeService.t('validation_length_min', { - postProcess: 'sprintf', - sprintf: ['5'] - }) - }, { - name: 'password[confirm]', - rules: 'matches[password[password]]', - message: localeService.t('password_match') - }] - }); - }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); - }; - - return { initialize: initialize }; -}; -exports.default = renewPassword; - /***/ }), /***/ 24: @@ -3659,7 +2768,7 @@ exports.default = renewPassword; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -4078,7 +3187,957 @@ var I18n = function (_EventEmitter) { /***/ }), -/***/ 240: +/***/ 25: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + + + + +var ResourceStore = function (_EventEmitter) { + _inherits(ResourceStore, _EventEmitter); + + function ResourceStore() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { ns: ['translation'], defaultNS: 'translation' }; + + _classCallCheck(this, ResourceStore); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + _this.data = data; + _this.options = options; + return _this; + } + + ResourceStore.prototype.addNamespaces = function addNamespaces(ns) { + if (this.options.ns.indexOf(ns) < 0) { + this.options.ns.push(ns); + } + }; + + ResourceStore.prototype.removeNamespaces = function removeNamespaces(ns) { + var index = this.options.ns.indexOf(ns); + if (index > -1) { + this.options.ns.splice(index, 1); + } + }; + + ResourceStore.prototype.getResource = function getResource(lng, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var keySeparator = options.keySeparator || this.options.keySeparator; + if (keySeparator === undefined) keySeparator = '.'; + + var path = [lng, ns]; + if (key && typeof key !== 'string') path = path.concat(key); + if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); + + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + } + + return __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path); + }; + + ResourceStore.prototype.addResource = function addResource(lng, ns, key, value) { + var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { silent: false }; + + var keySeparator = this.options.keySeparator; + if (keySeparator === undefined) keySeparator = '.'; + + var path = [lng, ns]; + if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); + + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + value = ns; + ns = path[1]; + } + + this.addNamespaces(ns); + + __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, value); + + if (!options.silent) this.emit('added', lng, ns, key, value); + }; + + ResourceStore.prototype.addResources = function addResources(lng, ns, resources) { + /* eslint no-restricted-syntax: 0 */ + for (var m in resources) { + if (typeof resources[m] === 'string') this.addResource(lng, ns, m, resources[m], { silent: true }); + } + this.emit('added', lng, ns, resources); + }; + + ResourceStore.prototype.addResourceBundle = function addResourceBundle(lng, ns, resources, deep, overwrite) { + var path = [lng, ns]; + if (lng.indexOf('.') > -1) { + path = lng.split('.'); + deep = resources; + resources = ns; + ns = path[1]; + } + + this.addNamespaces(ns); + + var pack = __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path) || {}; + + if (deep) { + __WEBPACK_IMPORTED_MODULE_1__utils__["b" /* deepExtend */](pack, resources, overwrite); + } else { + pack = _extends({}, pack, resources); + } + + __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, pack); + + this.emit('added', lng, ns, resources); + }; + + ResourceStore.prototype.removeResourceBundle = function removeResourceBundle(lng, ns) { + if (this.hasResourceBundle(lng, ns)) { + delete this.data[lng][ns]; + } + this.removeNamespaces(ns); + + this.emit('removed', lng, ns); + }; + + ResourceStore.prototype.hasResourceBundle = function hasResourceBundle(lng, ns) { + return this.getResource(lng, ns) !== undefined; + }; + + ResourceStore.prototype.getResourceBundle = function getResourceBundle(lng, ns) { + if (!ns) ns = this.options.defaultNS; + + // COMPATIBILITY: remove extend in v2.1.0 + if (this.options.compatibilityAPI === 'v1') return _extends({}, this.getResource(lng, ns)); + + return this.getResource(lng, ns); + }; + + ResourceStore.prototype.toJSON = function toJSON() { + return this.data; + }; + + return ResourceStore; +}(__WEBPACK_IMPORTED_MODULE_0__EventEmitter__["a" /* default */]); + +/* harmony default export */ __webpack_exports__["a"] = (ResourceStore); + +/***/ }), + +/***/ 26: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + + + + + + + +var Translator = function (_EventEmitter) { + _inherits(Translator, _EventEmitter); + + function Translator(services) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Translator); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + __WEBPACK_IMPORTED_MODULE_4__utils__["a" /* copy */](['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector'], services, _this); + + _this.options = options; + _this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('translator'); + return _this; + } + + Translator.prototype.changeLanguage = function changeLanguage(lng) { + if (lng) this.language = lng; + }; + + Translator.prototype.exists = function exists(key) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { interpolation: {} }; + + if (this.options.compatibilityAPI === 'v1') { + options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); + } + + return this.resolve(key, options) !== undefined; + }; + + Translator.prototype.extractFromKey = function extractFromKey(key, options) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + if (nsSeparator === undefined) nsSeparator = ':'; + var keySeparator = options.keySeparator || this.options.keySeparator || '.'; + + var namespaces = options.ns || this.options.defaultNS; + if (nsSeparator && key.indexOf(nsSeparator) > -1) { + var parts = key.split(nsSeparator); + if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); + key = parts.join(keySeparator); + } + if (typeof namespaces === 'string') namespaces = [namespaces]; + + return { + key: key, + namespaces: namespaces + }; + }; + + Translator.prototype.translate = function translate(keys) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') { + /* eslint prefer-rest-params: 0 */ + options = this.options.overloadTranslationOptionHandler(arguments); + } else if (this.options.compatibilityAPI === 'v1') { + options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); + } + + // non valid keys handling + if (keys === undefined || keys === null || keys === '') return ''; + if (typeof keys === 'number') keys = String(keys); + if (typeof keys === 'string') keys = [keys]; + + // separators + var keySeparator = options.keySeparator || this.options.keySeparator || '.'; + + // get namespace(s) + + var _extractFromKey = this.extractFromKey(keys[keys.length - 1], options), + key = _extractFromKey.key, + namespaces = _extractFromKey.namespaces; + + var namespace = namespaces[namespaces.length - 1]; + + // return key on CIMode + var lng = options.lng || this.language; + var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; + if (lng && lng.toLowerCase() === 'cimode') { + if (appendNamespaceToCIMode) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + return namespace + nsSeparator + key; + } + + return key; + } + + // resolve from store + var res = this.resolve(keys, options); + + var resType = Object.prototype.toString.apply(res); + var noObject = ['[object Number]', '[object Function]', '[object RegExp]']; + var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; + + // object + if (res && typeof res !== 'string' && noObject.indexOf(resType) < 0 && !(joinArrays && resType === '[object Array]')) { + if (!options.returnObjects && !this.options.returnObjects) { + this.logger.warn('accessing an object - but returnObjects options is not enabled!'); + return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(key, res, options) : 'key \'' + key + ' (' + this.language + ')\' returned an object instead of string.'; + } + + // if we got a separator we loop over children - else we just return object as is + // as having it set to false means no hierarchy so no lookup for nested values + if (options.keySeparator || this.options.keySeparator) { + var copy = resType === '[object Array]' ? [] : {}; // apply child translation on a copy + + /* eslint no-restricted-syntax: 0 */ + for (var m in res) { + if (Object.prototype.hasOwnProperty.call(res, m)) { + copy[m] = this.translate('' + key + keySeparator + m, _extends({}, options, { joinArrays: false, ns: namespaces })); + } + } + res = copy; + } + } else if (joinArrays && resType === '[object Array]') { + // array special treatment + res = res.join(joinArrays); + if (res) res = this.extendTranslation(res, key, options); + } else { + // string, empty or null + var usedDefault = false; + var usedKey = false; + + // fallback value + if (!this.isValidLookup(res) && options.defaultValue !== undefined) { + usedDefault = true; + res = options.defaultValue; + } + if (!this.isValidLookup(res)) { + usedKey = true; + res = key; + } + + // save missing + if (usedKey || usedDefault) { + this.logger.log('missingKey', lng, namespace, key, res); + + var lngs = []; + var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); + if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { + for (var i = 0; i < fallbackLngs.length; i++) { + lngs.push(fallbackLngs[i]); + } + } else if (this.options.saveMissingTo === 'all') { + lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); + } else { + lngs.push(options.lng || this.language); + } + + if (this.options.saveMissing) { + if (this.options.missingKeyHandler) { + this.options.missingKeyHandler(lngs, namespace, key, res); + } else if (this.backendConnector && this.backendConnector.saveMissing) { + this.backendConnector.saveMissing(lngs, namespace, key, res); + } + } + + this.emit('missingKey', lngs, namespace, key, res); + } + + // extend + res = this.extendTranslation(res, key, options); + + // append namespace if still key + if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = namespace + ':' + key; + + // parseMissingKeyHandler + if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); + } + + // return + return res; + }; + + Translator.prototype.extendTranslation = function extendTranslation(res, key, options) { + var _this2 = this; + + if (options.interpolation) this.interpolator.init(_extends({}, options, { interpolation: _extends({}, this.options.interpolation, options.interpolation) })); + + // interpolate + var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; + if (this.options.interpolation.defaultVariables) data = _extends({}, this.options.interpolation.defaultVariables, data); + res = this.interpolator.interpolate(res, data, options.lng || this.language); + + // nesting + if (options.nest !== false) res = this.interpolator.nest(res, function () { + return _this2.translate.apply(_this2, arguments); + }, options); + + if (options.interpolation) this.interpolator.reset(); + + // post process + var postProcess = options.postProcess || this.options.postProcess; + var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess; + + if (res !== undefined && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { + res = __WEBPACK_IMPORTED_MODULE_2__postProcessor__["a" /* default */].handle(postProcessorNames, res, key, options, this); + } + + return res; + }; + + Translator.prototype.resolve = function resolve(keys) { + var _this3 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var found = void 0; + + if (typeof keys === 'string') keys = [keys]; + + // forEach possible key + keys.forEach(function (k) { + if (_this3.isValidLookup(found)) return; + + var extracted = _this3.extractFromKey(k, options); + var key = extracted.key; + var namespaces = extracted.namespaces; + if (_this3.options.fallbackNS) namespaces = namespaces.concat(_this3.options.fallbackNS); + + var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; + var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; + + var codes = options.lngs ? options.lngs : _this3.languageUtils.toResolveHierarchy(options.lng || _this3.language); + + namespaces.forEach(function (ns) { + if (_this3.isValidLookup(found)) return; + + codes.forEach(function (code) { + if (_this3.isValidLookup(found)) return; + + var finalKey = key; + var finalKeys = [finalKey]; + + var pluralSuffix = void 0; + if (needsPluralHandling) pluralSuffix = _this3.pluralResolver.getSuffix(code, options.count); + + // fallback for plural if context not found + if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); + + // get key for context if needed + if (needsContextHandling) finalKeys.push(finalKey += '' + _this3.options.contextSeparator + options.context); + + // get key for plural if needed + if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); + + // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only + var possibleKey = void 0; + /* eslint no-cond-assign: 0 */ + while (possibleKey = finalKeys.pop()) { + if (!_this3.isValidLookup(found)) { + found = _this3.getResource(code, ns, possibleKey, options); + } + } + }); + }); + }); + + return found; + }; + + Translator.prototype.isValidLookup = function isValidLookup(res) { + return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); + }; + + Translator.prototype.getResource = function getResource(code, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + return this.resourceStore.getResource(code, ns, key, options); + }; + + return Translator; +}(__WEBPACK_IMPORTED_MODULE_1__EventEmitter__["a" /* default */]); + +/* harmony default export */ __webpack_exports__["a"] = (Translator); + +/***/ }), + +/***/ 264: +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(265); + + +/***/ }), + +/***/ 265: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _bootstrap = __webpack_require__(266); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var authenticateApp = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.authenticateApp = authenticateApp; +} + +module.exports = authenticateApp; + +/***/ }), + +/***/ 266: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +var _config = __webpack_require__(267); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _authentication = __webpack_require__(268); + +var _authentication2 = _interopRequireDefault(_authentication); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Bootstrap = function () { + function Bootstrap(userConfig) { + var _this = this; + + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.localeService = new _locale2.default({ + configService: this.configService + }); + + this.localeService.fetchTranslations().then(function () { + _this.onConfigReady(); + }); + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this2 = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + // export translation for backward compatibility: + // window.language = this.localeService.getTranslations(); + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + var authService = (0, _authentication2.default)(_this2.appServices); + + authService.initialize(); + + switch (_this2.configService.get('state')) { + case 'login': + authService.login(); + break; + case 'forgotPassword': + authService.forgotPassword(); + break; + case 'renewPassword': + authService.renewPassword(); + break; + case 'register': + authService.register(); + break; + case 'registerProvider': + authService.registerProvider(); + break; + case 'renewEmail': + authService.renewEmail(); + break; + case 'changePassword': + authService.changePassword(); + break; + default: + } + }); + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 267: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/login/language.json' +}; + +exports.default = defaultConfig; + +/***/ }), + +/***/ 268: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _login = __webpack_require__(269); + +var _login2 = _interopRequireDefault(_login); + +var _forgotPassword = __webpack_require__(274); + +var _forgotPassword2 = _interopRequireDefault(_forgotPassword); + +var _renewPassword = __webpack_require__(275); + +var _renewPassword2 = _interopRequireDefault(_renewPassword); + +var _register = __webpack_require__(276); + +var _register2 = _interopRequireDefault(_register); + +var _registerProvider = __webpack_require__(277); + +var _registerProvider2 = _interopRequireDefault(_registerProvider); + +var _renewEmail = __webpack_require__(278); + +var _renewEmail2 = _interopRequireDefault(_renewEmail); + +var _changePassword = __webpack_require__(279); + +var _changePassword2 = _interopRequireDefault(_changePassword); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +__webpack_require__(280); // multiselect + +var authentication = function authentication(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + + var initialize = function initialize() { + // close alerts + (0, _jquery2.default)(document).on('click', '.alert .alert-block-close a', function (e) { + e.preventDefault(); + (0, _jquery2.default)(this).closest('.alert').alert('close'); + return false; + }); + + (0, _jquery2.default)('select[multiple="multiple"]').multiselect({ + buttonWidth: '100%', + buttonClass: 'btn btn-inverse', + maxHeight: 185, + includeSelectAllOption: true, + selectAllValue: 'all', + selectAllText: localeService.t('all_collections'), + buttonText: function buttonText(options, select) { + if (options.length === 0) { + return localeService.t('no_collection_selected') + ''; + } else { + return localeService.t(options.length === 1 ? 'one_collection_selected' : 'collections_selected', { + postProcess: 'sprintf', + sprintf: [options.length] + }) + ' '; + } + } + }); + (0, _jquery2.default)('form[name="registerForm"]').on('submit', function () { + // must deselect the 'select all' checkbox for server side validation. + (0, _jquery2.default)('select[multiple="multiple"]').multiselect('deselect', 'all'); + }); + }; + + var login = function login() { + // init login form + (0, _login2.default)(services).initialize(); + }; + var forgotPassword = function forgotPassword() { + // init login form + (0, _forgotPassword2.default)(services).initialize(); + }; + var renewPassword = function renewPassword() { + // init login form + (0, _renewPassword2.default)(services).initialize(); + }; + var register = function register() { + // init login form + (0, _register2.default)(services).initialize(); + }; + var registerProvider = function registerProvider() { + // init login form + (0, _registerProvider2.default)(services).initialize(); + }; + var renewEmail = function renewEmail() { + // init login form + (0, _renewEmail2.default)(services).initialize(); + }; + var changePassword = function changePassword() { + // init login form + (0, _changePassword2.default)(services).initialize(); + }; + + return { initialize: initialize, login: login, forgotPassword: forgotPassword, renewPassword: renewPassword, register: register, registerProvider: registerProvider, renewEmail: renewEmail, changePassword: changePassword }; +}; +exports.default = authentication; + +/***/ }), + +/***/ 269: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _form = __webpack_require__(43); + +var _form2 = _interopRequireDefault(_form); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var login = function login(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + + new _form2.default({ + el: (0, _jquery2.default)('form[name=loginForm]'), + rules: [{ + name: 'login', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'password', + rules: 'required', + message: localeService.t('validation_blank') + }] + }); + }; + + return { initialize: initialize }; +}; +exports.default = login; + +/***/ }), + +/***/ 27: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + +var LanguageUtil = function () { + function LanguageUtil(options) { + _classCallCheck(this, LanguageUtil); + + this.options = options; + + this.whitelist = this.options.whitelist || false; + this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('languageUtils'); + } + + LanguageUtil.prototype.getScriptPartFromCode = function getScriptPartFromCode(code) { + if (!code || code.indexOf('-') < 0) return null; + + var p = code.split('-'); + if (p.length === 2) return null; + p.pop(); + return this.formatLanguageCode(p.join('-')); + }; + + LanguageUtil.prototype.getLanguagePartFromCode = function getLanguagePartFromCode(code) { + if (!code || code.indexOf('-') < 0) return code; + + var p = code.split('-'); + return this.formatLanguageCode(p[0]); + }; + + LanguageUtil.prototype.formatLanguageCode = function formatLanguageCode(code) { + // http://www.iana.org/assignments/language-tags/language-tags.xhtml + if (typeof code === 'string' && code.indexOf('-') > -1) { + var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab']; + var p = code.split('-'); + + if (this.options.lowerCaseLng) { + p = p.map(function (part) { + return part.toLowerCase(); + }); + } else if (p.length === 2) { + p[0] = p[0].toLowerCase(); + p[1] = p[1].toUpperCase(); + + if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); + } else if (p.length === 3) { + p[0] = p[0].toLowerCase(); + + // if lenght 2 guess it's a country + if (p[1].length === 2) p[1] = p[1].toUpperCase(); + if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); + + if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); + if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase()); + } + + return p.join('-'); + } + + return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; + }; + + LanguageUtil.prototype.isWhitelisted = function isWhitelisted(code) { + if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { + code = this.getLanguagePartFromCode(code); + } + return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1; + }; + + LanguageUtil.prototype.getFallbackCodes = function getFallbackCodes(fallbacks, code) { + if (!fallbacks) return []; + if (typeof fallbacks === 'string') fallbacks = [fallbacks]; + if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; + + if (!code) return fallbacks.default || []; + + // asume we have an object defining fallbacks + var found = fallbacks[code]; + if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; + if (!found) found = fallbacks[this.formatLanguageCode(code)]; + if (!found) found = fallbacks.default; + + return found || []; + }; + + LanguageUtil.prototype.toResolveHierarchy = function toResolveHierarchy(code, fallbackCode) { + var _this = this; + + var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code); + + var codes = []; + var addCode = function addCode(c) { + if (!c) return; + if (_this.isWhitelisted(c)) { + codes.push(c); + } else { + _this.logger.warn('rejecting non-whitelisted language code: ' + c); + } + }; + + if (typeof code === 'string' && code.indexOf('-') > -1) { + if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); + if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); + if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); + } else if (typeof code === 'string') { + addCode(this.formatLanguageCode(code)); + } + + fallbackCodes.forEach(function (fc) { + if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); + }); + + return codes; + }; + + return LanguageUtil; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (LanguageUtil); + +/***/ }), + +/***/ 270: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4096,11 +4155,633 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _passwordSetter = __webpack_require__(53); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var FormValidator = function FormValidator(rules, handlers) { + // rules setted by user + this.rules = rules || []; + // custom callbacks + this.handlers = handlers || []; + // final fields to validate + this.fields = []; + + var self = this; + + _underscore2.default.each(this.rules, function (field) { + if ('name' in field && 'rules' in field) { + self._addField(field); + } + }); +}; + +// Validate method, argument is the serialize form +FormValidator.prototype.validate = function (inputs) { + var self = this; + // possible errors + this.errors = []; + // inputs present in form + this.inputs = {}; + + _underscore2.default.each(_underscore2.default.groupBy(inputs, function (input) { + return input.name; + }), function (fields, name) { + self.inputs[name] = fields; + }); + + this._validateForm(); + + return this; +}; + +FormValidator.prototype.getErrors = function () { + return this.errors; +}; + +FormValidator.prototype.hasErrors = function () { + return this.errors.length > 0; +}; + +FormValidator.prototype.getRules = function () { + return this.rules; +}; + +FormValidator.prototype._addField = function (field) { + this.fields.push({ + name: field.name, + rules: field.rules, + message: field.message || 'An error ocurred on input[name=' + field.name + '], you can edit this message by setting a "message" property in your rule definition object', + value: null, + type: field.type || 'text' + }); +}; + +FormValidator.prototype._validateForm = function () { + var self = this; + this.errors = []; + _underscore2.default.each(this.fields, function (field) { + if (_underscore2.default.has(self.inputs, field.name)) { + // values can be multiple + var values = []; + + _underscore2.default.each(self.inputs[field.name], function (field) { + return values.push(field.value); + }); + + field.value = values.join(','); + + self._validateField(field); + } else if (field.type === 'checkbox' || field.type === 'radio' || field.type === 'select' || field.type === 'multiple') { + field.value = ''; + self._validateField(field); + } + }); +}; + +FormValidator.prototype._validateField = function (field) { + var self = this; + var ruleRegex = /^(.+?)\[(.+)\]$/; + var rules = field.rules.split('|'); + + // Run through the rules and execute the validation methods as needed + _underscore2.default.every(rules, function (method) { + var param = null; + var failed = false; + var parts = ruleRegex.exec(method); + + // If the rule has a parameter (i.e. matches[param]) split it out + if (parts) { + method = parts[1]; + param = parts[2]; + } + + // If the hook is defined, run it to find any validation errors + if (typeof self._hooks[method] === 'function') { + if (!self._hooks[method].apply(self, [field, param])) { + failed = true; + } + } else if (method.substring(0, 9) === 'callback_') { + // Custom method. Execute the handler if it was registered + method = method.substring(9, method.length); + + if (typeof self.handlers[method] === 'function') { + if (this.handlers[method].apply(self, [field.value, param]) === false) { + failed = true; + } + } + } + + // If the hook failed, add a message to the errors array + if (failed) { + self.errors.push({ + name: field.name, + value: field.value, + message: field.message, + rule: method + }); + } + + // Breaks loop iteration + return failed; + }); +}; + +FormValidator.prototype.Regexp = { + numericRegex: /^[0-9]+$/, + integerRegex: /^\-?[0-9]+$/, + decimalRegex: /^\-?[0-9]*\.?[0-9]+$/, + emailRegex: /^[^@]+@[^@]+\.[^@]+$/, + alphaRegex: /^[a-z]+$/i, + alphaNumericRegex: /^[a-z0-9]+$/i, + alphaDashRegex: /^[a-z0-9_\-]+$/i, + naturalRegex: /^[0-9]+$/i, + naturalNoZeroRegex: /^[1-9][0-9]*$/i, + // IP v6 a v4 or hostname, by Mikulas Dite see http://stackoverflow.com/a/9209720/96656 + ipRegex: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,1}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,2}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$/i, + numericDashRegex: /^[\d\-\s]+$/, + urlRegex: /^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/ +}; + +// Object containing all of the validation hooks +FormValidator.prototype._hooks = { + required: function required(field) { + var value = field.value; + + return value !== null && value !== ''; + }, + equal: function equal(field, defaultName) { + return field.value === defaultName; + }, + matches: function matches(field, matchName) { + if (typeof this.inputs[matchName] === 'undefined') { + return false; + } + + var el = this.inputs[matchName].shift(); + + if (el) { + return field.value === el.value; + } + + return false; + }, + valid_email: function valid_email(field) { + return this.Regexp.emailRegex.test(field.value); + }, + valid_emails: function valid_emails(field) { + var result = field.value.split(','); + + for (var i = 0; i < result.length; i++) { + if (!this.Regexp.emailRegex.test(_jquery2.default.trim(result[i]))) { + return false; + } + } + + return true; + }, + min_length: function min_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length >= parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length >= parseInt(length, 10); + }, + max_length: function max_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length <= parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length <= parseInt(length, 10); + }, + exact_length: function exact_length(field, length) { + if (field.type === 'multiple') { + return _underscore2.default.filter(field.value.split(','), function (value) { + return value !== ''; + }).length === parseInt(length, 10); + } + + if (!this.Regexp.numericRegex.test(length)) { + return false; + } + + return field.value.length === parseInt(length, 10); + }, + greater_than: function greater_than(field, param) { + if (!this.Regexp.decimalRegex.test(field.value)) { + return false; + } + + return parseFloat(field.value) > parseFloat(param); + }, + less_than: function less_than(field, param) { + if (!this.Regexp.decimalRegex.test(field.value)) { + return false; + } + + return parseFloat(field.value) < parseFloat(param); + }, + alpha: function alpha(field) { + return this.Regexp.alphaRegex.test(field.value); + }, + alpha_numeric: function alpha_numeric(field) { + return this.Regexp.alphaNumericRegex.test(field.value); + }, + alpha_dash: function alpha_dash(field) { + return this.Regexp.alphaDashRegex.test(field.value); + }, + numeric: function numeric(field) { + return this.Regexp.numericRegex.test(field.value); + }, + integer: function integer(field) { + return this.Regexp.integerRegex.test(field.value); + }, + decimal: function decimal(field) { + return this.Regexp.decimalRegex.test(field.value); + }, + is_natural: function is_natural(field) { + return this.Regexp.naturalRegex.test(field.value); + }, + is_natural_no_zero: function is_natural_no_zero(field) { + return this.Regexp.naturalNoZeroRegex.test(field.value); + }, + valid_ip: function valid_ip(field) { + return this.Regexp.ipRegex.test(field.value); + }, + valid_url: function valid_url(field) { + return this.Regexp.urlRegex.test(field.value); + } +}; + +exports.default = FormValidator; + +/***/ }), + +/***/ 271: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _backbone = __webpack_require__(54); + +var _backbone2 = _interopRequireDefault(_backbone); + +var _error = __webpack_require__(272); + +var _error2 = _interopRequireDefault(_error); + +var _multiviews = __webpack_require__(273); + +var _multiviews2 = _interopRequireDefault(_multiviews); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var InputView = _backbone2.default.View.extend(_underscore2.default.extend({}, _multiviews2.default, { + initialize: function initialize(options) { + options = options || {}; + if (options.name === undefined) { + throw 'Missing name attribute in input view'; + } + + if (options.errorTemplate === undefined) { + throw 'Missing errorTemplate attribute in input view'; + } + + this.name = options.name; + + this.errorView = new _error2.default({ + name: this.name, + errorTemplate: options.errorTemplate, + onRenderError: options.onRenderError || null + }); + }, + render: function render() { + this._assignView({ '.error-view': this.errorView }); + }, + showErrors: function showErrors(errors) { + this.render(); + + this.errorView.renderErrors(errors); + + return this; + }, + resetErrors: function resetErrors() { + this.errorView.reset(); + } +})); /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +exports.default = InputView; + +/***/ }), + +/***/ 272: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _backbone = __webpack_require__(54); + +var _backbone2 = _interopRequireDefault(_backbone); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var ErrorView = _backbone2.default.View.extend({ + tagName: 'div', + initialize: function initialize(options) { + options = options || {}; + + if (options.name === undefined) { + throw 'Missing name attribute in error view'; + } + + if (options.errorTemplate === undefined) { + throw 'Missing errorTemplate attribute in error view'; + } + + this.name = options.name; + this.errorTemplate = options.errorTemplate; + + this.errors = options.errors || {}; + this.onRenderError = options.onRenderError || null; + }, + render: function render() { + if (this.errors.length > 0) { + var template = _underscore2.default.template((0, _jquery2.default)(this.errorTemplate).html(), { + errors: this.errors + }); + + this.$el.html(template); + + if (_underscore2.default.isFunction(this.onRenderError)) { + this.onRenderError(this.name, this.$el); + } + } else { + this.reset(); + } + + return this; + }, + renderErrors: function renderErrors(errors) { + this.errors = errors; + this.render(); + + return this; + }, + reset: function reset() { + this.$el.empty(); + } +}); /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +exports.default = ErrorView; + +/***/ }), + +/***/ 273: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + // bind a subview to a DOM element + _assignView: function _assignView(selector, view) { + var selectors; + if (_underscore2.default.isObject(selector)) { + selectors = selector; + } else { + selectors = {}; + selectors[selector] = view; + } + if (!selectors) return; + _underscore2.default.each(selectors, function (view, selector) { + view.setElement(this.$(selector)).render(); + }, this); + } +}; /* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/***/ }), + +/***/ 274: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _form = __webpack_require__(43); + +var _form2 = _interopRequireDefault(_form); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var forgotPassword = function forgotPassword(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + new _form2.default({ + el: (0, _jquery2.default)('form[name=forgottenPasswordForm]'), + rules: [{ + name: 'email', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'email', + rules: 'valid_email', + message: localeService.t('validation_email') + }] + }); + }; + + return { initialize: initialize }; +}; +exports.default = forgotPassword; + +/***/ }), + +/***/ 275: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _passwordSetter = __webpack_require__(55); var _passwordSetter2 = _interopRequireDefault(_passwordSetter); -var _geonames = __webpack_require__(54); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * This file is part of Phraseanet + * + * (c) 2005-2016 Alchemy + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +var renewPassword = function renewPassword(services) { + var configService = services.configService, + localeService = services.localeService, + appEvents = services.appEvents; + + var initialize = function initialize() { + + __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { + services.zxcvbn = __webpack_require__(57); + new _passwordSetter2.default({ + services: services, + el: (0, _jquery2.default)('form[name=passwordRenewForm]'), + rules: [{ + name: 'password[password]', + rules: 'required', + message: localeService.t('validation_blank') + }, { + name: 'password[password]', + rules: 'min_length[5]', + message: localeService.t('validation_length_min', { + postProcess: 'sprintf', + sprintf: ['5'] + }) + }, { + name: 'password[confirm]', + rules: 'matches[password[password]]', + message: localeService.t('password_match') + }] + }); + }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); + }; + + return { initialize: initialize }; +}; +exports.default = renewPassword; + +/***/ }), + +/***/ 276: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _underscore = __webpack_require__(2); + +var _underscore2 = _interopRequireDefault(_underscore); + +var _passwordSetter = __webpack_require__(55); + +var _passwordSetter2 = _interopRequireDefault(_passwordSetter); + +var _geonames = __webpack_require__(56); var _geonames2 = _interopRequireDefault(_geonames); @@ -4190,7 +4871,7 @@ var regiser = function regiser(services) { var $form = (0, _jquery2.default)('form[name=registerForm]'); __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); + services.zxcvbn = __webpack_require__(57); new _passwordSetter2.default({ el: $form, rules: rules, @@ -4228,7 +4909,7 @@ exports.default = regiser; /***/ }), -/***/ 241: +/***/ 277: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4246,7 +4927,7 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -4347,7 +5028,7 @@ exports.default = registerProvider; /***/ }), -/***/ 242: +/***/ 278: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4361,7 +5042,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -4414,7 +5095,7 @@ exports.default = renewEmail; /***/ }), -/***/ 243: +/***/ 279: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4428,7 +5109,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _passwordSetter = __webpack_require__(53); +var _passwordSetter = __webpack_require__(55); var _passwordSetter2 = _interopRequireDefault(_passwordSetter); @@ -4451,7 +5132,7 @@ var changePassword = function changePassword(services) { var initialize = function initialize() { __webpack_require__.e/* require.ensure */(0/* duplicate */).then((function () { - services.zxcvbn = __webpack_require__(55); + services.zxcvbn = __webpack_require__(57); new _passwordSetter2.default({ services: services, el: (0, _jquery2.default)('form[name=passwordChangeForm]'), @@ -4485,7 +5166,177 @@ exports.default = changePassword; /***/ }), -/***/ 244: +/***/ 28: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +// definition http://translate.sourceforge.net/wiki/l10n/pluralforms +/* eslint-disable */ +var sets = [{ lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'tg', 'ti', 'tr', 'uz', 'wa'], nr: [1, 2], fc: 1 }, { lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'es_ar', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'he', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt', 'pt_br', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'], nr: [1, 2], fc: 2 }, { lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'], nr: [1], fc: 3 }, { lngs: ['be', 'bs', 'dz', 'hr', 'ru', 'sr', 'uk'], nr: [1, 2, 5], fc: 4 }, { lngs: ['ar'], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ['cs', 'sk'], nr: [1, 2, 5], fc: 6 }, { lngs: ['csb', 'pl'], nr: [1, 2, 5], fc: 7 }, { lngs: ['cy'], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ['fr'], nr: [1, 2], fc: 9 }, { lngs: ['ga'], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ['gd'], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ['is'], nr: [1, 2], fc: 12 }, { lngs: ['jv'], nr: [0, 1], fc: 13 }, { lngs: ['kw'], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ['lt'], nr: [1, 2, 10], fc: 15 }, { lngs: ['lv'], nr: [1, 2, 0], fc: 16 }, { lngs: ['mk'], nr: [1, 2], fc: 17 }, { lngs: ['mnk'], nr: [0, 1, 2], fc: 18 }, { lngs: ['mt'], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ['or'], nr: [2, 1], fc: 2 }, { lngs: ['ro'], nr: [1, 2, 20], fc: 20 }, { lngs: ['sl'], nr: [5, 1, 2, 3], fc: 21 }]; + +var _rulesPluralsTypes = { + 1: function _(n) { + return Number(n > 1); + }, + 2: function _(n) { + return Number(n != 1); + }, + 3: function _(n) { + return 0; + }, + 4: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 5: function _(n) { + return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); + }, + 6: function _(n) { + return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); + }, + 7: function _(n) { + return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 8: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); + }, + 9: function _(n) { + return Number(n >= 2); + }, + 10: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); + }, + 11: function _(n) { + return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); + }, + 12: function _(n) { + return Number(n % 10 != 1 || n % 100 == 11); + }, + 13: function _(n) { + return Number(n !== 0); + }, + 14: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); + }, + 15: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 16: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); + }, + 17: function _(n) { + return Number(n == 1 || n % 10 == 1 ? 0 : 1); + }, + 18: function _(n) { + return Number(n == 0 ? 0 : n == 1 ? 1 : 2); + }, + 19: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); + }, + 20: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); + }, + 21: function _(n) { + return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); + } +}; +/* eslint-enable */ + +function createRules() { + var rules = {}; + sets.forEach(function (set) { + set.lngs.forEach(function (l) { + rules[l] = { + numbers: set.nr, + plurals: _rulesPluralsTypes[set.fc] + }; + }); + }); + return rules; +} + +var PluralResolver = function () { + function PluralResolver(languageUtils) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, PluralResolver); + + this.languageUtils = languageUtils; + this.options = options; + + this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('pluralResolver'); + + this.rules = createRules(); + } + + PluralResolver.prototype.addRule = function addRule(lng, obj) { + this.rules[lng] = obj; + }; + + PluralResolver.prototype.getRule = function getRule(code) { + return this.rules[this.languageUtils.getLanguagePartFromCode(code)]; + }; + + PluralResolver.prototype.needsPlural = function needsPlural(code) { + var rule = this.getRule(code); + + return rule && rule.numbers.length > 1; + }; + + PluralResolver.prototype.getSuffix = function getSuffix(code, count) { + var _this = this; + + var rule = this.getRule(code); + + if (rule) { + if (rule.numbers.length === 1) return ''; // only singular + + var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); + var suffix = rule.numbers[idx]; + + // special treatment for lngs only having singular and plural + if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { + if (suffix === 2) { + suffix = 'plural'; + } else if (suffix === 1) { + suffix = ''; + } + } + + var returnSuffix = function returnSuffix() { + return _this.options.prepend && suffix.toString() ? _this.options.prepend + suffix.toString() : suffix.toString(); + }; + + // COMPATIBILITY JSON + // v1 + if (this.options.compatibilityJSON === 'v1') { + if (suffix === 1) return ''; + if (typeof suffix === 'number') return '_plural_' + suffix.toString(); + return returnSuffix(); + } else if ( /* v2 */this.options.compatibilityJSON === 'v2' || rule.numbers.length === 2 && rule.numbers[0] === 1) { + return returnSuffix(); + } else if ( /* v3 - gettext index */rule.numbers.length === 2 && rule.numbers[0] === 1) { + return returnSuffix(); + } + return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); + } + + this.logger.warn('no plural rule found for: ' + code); + return ''; + }; + + return PluralResolver; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (PluralResolver); + +/***/ }), + +/***/ 280: /***/ (function(module, exports) { /*** IMPORTS FROM imports-loader ***/ @@ -5912,770 +6763,11 @@ exports.default = changePassword; /***/ }), -/***/ 25: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } - - - - -var ResourceStore = function (_EventEmitter) { - _inherits(ResourceStore, _EventEmitter); - - function ResourceStore() { - var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { ns: ['translation'], defaultNS: 'translation' }; - - _classCallCheck(this, ResourceStore); - - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - - _this.data = data; - _this.options = options; - return _this; - } - - ResourceStore.prototype.addNamespaces = function addNamespaces(ns) { - if (this.options.ns.indexOf(ns) < 0) { - this.options.ns.push(ns); - } - }; - - ResourceStore.prototype.removeNamespaces = function removeNamespaces(ns) { - var index = this.options.ns.indexOf(ns); - if (index > -1) { - this.options.ns.splice(index, 1); - } - }; - - ResourceStore.prototype.getResource = function getResource(lng, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - var keySeparator = options.keySeparator || this.options.keySeparator; - if (keySeparator === undefined) keySeparator = '.'; - - var path = [lng, ns]; - if (key && typeof key !== 'string') path = path.concat(key); - if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); - - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - } - - return __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path); - }; - - ResourceStore.prototype.addResource = function addResource(lng, ns, key, value) { - var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { silent: false }; - - var keySeparator = this.options.keySeparator; - if (keySeparator === undefined) keySeparator = '.'; - - var path = [lng, ns]; - if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); - - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - value = ns; - ns = path[1]; - } - - this.addNamespaces(ns); - - __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, value); - - if (!options.silent) this.emit('added', lng, ns, key, value); - }; - - ResourceStore.prototype.addResources = function addResources(lng, ns, resources) { - /* eslint no-restricted-syntax: 0 */ - for (var m in resources) { - if (typeof resources[m] === 'string') this.addResource(lng, ns, m, resources[m], { silent: true }); - } - this.emit('added', lng, ns, resources); - }; - - ResourceStore.prototype.addResourceBundle = function addResourceBundle(lng, ns, resources, deep, overwrite) { - var path = [lng, ns]; - if (lng.indexOf('.') > -1) { - path = lng.split('.'); - deep = resources; - resources = ns; - ns = path[1]; - } - - this.addNamespaces(ns); - - var pack = __WEBPACK_IMPORTED_MODULE_1__utils__["d" /* getPath */](this.data, path) || {}; - - if (deep) { - __WEBPACK_IMPORTED_MODULE_1__utils__["b" /* deepExtend */](pack, resources, overwrite); - } else { - pack = _extends({}, pack, resources); - } - - __WEBPACK_IMPORTED_MODULE_1__utils__["h" /* setPath */](this.data, path, pack); - - this.emit('added', lng, ns, resources); - }; - - ResourceStore.prototype.removeResourceBundle = function removeResourceBundle(lng, ns) { - if (this.hasResourceBundle(lng, ns)) { - delete this.data[lng][ns]; - } - this.removeNamespaces(ns); - - this.emit('removed', lng, ns); - }; - - ResourceStore.prototype.hasResourceBundle = function hasResourceBundle(lng, ns) { - return this.getResource(lng, ns) !== undefined; - }; - - ResourceStore.prototype.getResourceBundle = function getResourceBundle(lng, ns) { - if (!ns) ns = this.options.defaultNS; - - // COMPATIBILITY: remove extend in v2.1.0 - if (this.options.compatibilityAPI === 'v1') return _extends({}, this.getResource(lng, ns)); - - return this.getResource(lng, ns); - }; - - ResourceStore.prototype.toJSON = function toJSON() { - return this.data; - }; - - return ResourceStore; -}(__WEBPACK_IMPORTED_MODULE_0__EventEmitter__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (ResourceStore); - -/***/ }), - -/***/ 26: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } - - - - - - - -var Translator = function (_EventEmitter) { - _inherits(Translator, _EventEmitter); - - function Translator(services) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Translator); - - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - - __WEBPACK_IMPORTED_MODULE_4__utils__["a" /* copy */](['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector'], services, _this); - - _this.options = options; - _this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('translator'); - return _this; - } - - Translator.prototype.changeLanguage = function changeLanguage(lng) { - if (lng) this.language = lng; - }; - - Translator.prototype.exists = function exists(key) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { interpolation: {} }; - - if (this.options.compatibilityAPI === 'v1') { - options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); - } - - return this.resolve(key, options) !== undefined; - }; - - Translator.prototype.extractFromKey = function extractFromKey(key, options) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - if (nsSeparator === undefined) nsSeparator = ':'; - var keySeparator = options.keySeparator || this.options.keySeparator || '.'; - - var namespaces = options.ns || this.options.defaultNS; - if (nsSeparator && key.indexOf(nsSeparator) > -1) { - var parts = key.split(nsSeparator); - if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); - key = parts.join(keySeparator); - } - if (typeof namespaces === 'string') namespaces = [namespaces]; - - return { - key: key, - namespaces: namespaces - }; - }; - - Translator.prototype.translate = function translate(keys) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') { - /* eslint prefer-rest-params: 0 */ - options = this.options.overloadTranslationOptionHandler(arguments); - } else if (this.options.compatibilityAPI === 'v1') { - options = __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__["d" /* convertTOptions */](options); - } - - // non valid keys handling - if (keys === undefined || keys === null || keys === '') return ''; - if (typeof keys === 'number') keys = String(keys); - if (typeof keys === 'string') keys = [keys]; - - // separators - var keySeparator = options.keySeparator || this.options.keySeparator || '.'; - - // get namespace(s) - - var _extractFromKey = this.extractFromKey(keys[keys.length - 1], options), - key = _extractFromKey.key, - namespaces = _extractFromKey.namespaces; - - var namespace = namespaces[namespaces.length - 1]; - - // return key on CIMode - var lng = options.lng || this.language; - var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; - if (lng && lng.toLowerCase() === 'cimode') { - if (appendNamespaceToCIMode) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - return namespace + nsSeparator + key; - } - - return key; - } - - // resolve from store - var res = this.resolve(keys, options); - - var resType = Object.prototype.toString.apply(res); - var noObject = ['[object Number]', '[object Function]', '[object RegExp]']; - var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; - - // object - if (res && typeof res !== 'string' && noObject.indexOf(resType) < 0 && !(joinArrays && resType === '[object Array]')) { - if (!options.returnObjects && !this.options.returnObjects) { - this.logger.warn('accessing an object - but returnObjects options is not enabled!'); - return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(key, res, options) : 'key \'' + key + ' (' + this.language + ')\' returned an object instead of string.'; - } - - // if we got a separator we loop over children - else we just return object as is - // as having it set to false means no hierarchy so no lookup for nested values - if (options.keySeparator || this.options.keySeparator) { - var copy = resType === '[object Array]' ? [] : {}; // apply child translation on a copy - - /* eslint no-restricted-syntax: 0 */ - for (var m in res) { - if (Object.prototype.hasOwnProperty.call(res, m)) { - copy[m] = this.translate('' + key + keySeparator + m, _extends({}, options, { joinArrays: false, ns: namespaces })); - } - } - res = copy; - } - } else if (joinArrays && resType === '[object Array]') { - // array special treatment - res = res.join(joinArrays); - if (res) res = this.extendTranslation(res, key, options); - } else { - // string, empty or null - var usedDefault = false; - var usedKey = false; - - // fallback value - if (!this.isValidLookup(res) && options.defaultValue !== undefined) { - usedDefault = true; - res = options.defaultValue; - } - if (!this.isValidLookup(res)) { - usedKey = true; - res = key; - } - - // save missing - if (usedKey || usedDefault) { - this.logger.log('missingKey', lng, namespace, key, res); - - var lngs = []; - var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); - if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { - for (var i = 0; i < fallbackLngs.length; i++) { - lngs.push(fallbackLngs[i]); - } - } else if (this.options.saveMissingTo === 'all') { - lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); - } else { - lngs.push(options.lng || this.language); - } - - if (this.options.saveMissing) { - if (this.options.missingKeyHandler) { - this.options.missingKeyHandler(lngs, namespace, key, res); - } else if (this.backendConnector && this.backendConnector.saveMissing) { - this.backendConnector.saveMissing(lngs, namespace, key, res); - } - } - - this.emit('missingKey', lngs, namespace, key, res); - } - - // extend - res = this.extendTranslation(res, key, options); - - // append namespace if still key - if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = namespace + ':' + key; - - // parseMissingKeyHandler - if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); - } - - // return - return res; - }; - - Translator.prototype.extendTranslation = function extendTranslation(res, key, options) { - var _this2 = this; - - if (options.interpolation) this.interpolator.init(_extends({}, options, { interpolation: _extends({}, this.options.interpolation, options.interpolation) })); - - // interpolate - var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; - if (this.options.interpolation.defaultVariables) data = _extends({}, this.options.interpolation.defaultVariables, data); - res = this.interpolator.interpolate(res, data, options.lng || this.language); - - // nesting - if (options.nest !== false) res = this.interpolator.nest(res, function () { - return _this2.translate.apply(_this2, arguments); - }, options); - - if (options.interpolation) this.interpolator.reset(); - - // post process - var postProcess = options.postProcess || this.options.postProcess; - var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess; - - if (res !== undefined && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { - res = __WEBPACK_IMPORTED_MODULE_2__postProcessor__["a" /* default */].handle(postProcessorNames, res, key, options, this); - } - - return res; - }; - - Translator.prototype.resolve = function resolve(keys) { - var _this3 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var found = void 0; - - if (typeof keys === 'string') keys = [keys]; - - // forEach possible key - keys.forEach(function (k) { - if (_this3.isValidLookup(found)) return; - - var extracted = _this3.extractFromKey(k, options); - var key = extracted.key; - var namespaces = extracted.namespaces; - if (_this3.options.fallbackNS) namespaces = namespaces.concat(_this3.options.fallbackNS); - - var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; - var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; - - var codes = options.lngs ? options.lngs : _this3.languageUtils.toResolveHierarchy(options.lng || _this3.language); - - namespaces.forEach(function (ns) { - if (_this3.isValidLookup(found)) return; - - codes.forEach(function (code) { - if (_this3.isValidLookup(found)) return; - - var finalKey = key; - var finalKeys = [finalKey]; - - var pluralSuffix = void 0; - if (needsPluralHandling) pluralSuffix = _this3.pluralResolver.getSuffix(code, options.count); - - // fallback for plural if context not found - if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); - - // get key for context if needed - if (needsContextHandling) finalKeys.push(finalKey += '' + _this3.options.contextSeparator + options.context); - - // get key for plural if needed - if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); - - // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only - var possibleKey = void 0; - /* eslint no-cond-assign: 0 */ - while (possibleKey = finalKeys.pop()) { - if (!_this3.isValidLookup(found)) { - found = _this3.getResource(code, ns, possibleKey, options); - } - } - }); - }); - }); - - return found; - }; - - Translator.prototype.isValidLookup = function isValidLookup(res) { - return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); - }; - - Translator.prototype.getResource = function getResource(code, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - return this.resourceStore.getResource(code, ns, key, options); - }; - - return Translator; -}(__WEBPACK_IMPORTED_MODULE_1__EventEmitter__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (Translator); - -/***/ }), - -/***/ 27: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -function capitalize(string) { - return string.charAt(0).toUpperCase() + string.slice(1); -} - -var LanguageUtil = function () { - function LanguageUtil(options) { - _classCallCheck(this, LanguageUtil); - - this.options = options; - - this.whitelist = this.options.whitelist || false; - this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('languageUtils'); - } - - LanguageUtil.prototype.getScriptPartFromCode = function getScriptPartFromCode(code) { - if (!code || code.indexOf('-') < 0) return null; - - var p = code.split('-'); - if (p.length === 2) return null; - p.pop(); - return this.formatLanguageCode(p.join('-')); - }; - - LanguageUtil.prototype.getLanguagePartFromCode = function getLanguagePartFromCode(code) { - if (!code || code.indexOf('-') < 0) return code; - - var p = code.split('-'); - return this.formatLanguageCode(p[0]); - }; - - LanguageUtil.prototype.formatLanguageCode = function formatLanguageCode(code) { - // http://www.iana.org/assignments/language-tags/language-tags.xhtml - if (typeof code === 'string' && code.indexOf('-') > -1) { - var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab']; - var p = code.split('-'); - - if (this.options.lowerCaseLng) { - p = p.map(function (part) { - return part.toLowerCase(); - }); - } else if (p.length === 2) { - p[0] = p[0].toLowerCase(); - p[1] = p[1].toUpperCase(); - - if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); - } else if (p.length === 3) { - p[0] = p[0].toLowerCase(); - - // if lenght 2 guess it's a country - if (p[1].length === 2) p[1] = p[1].toUpperCase(); - if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); - - if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); - if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase()); - } - - return p.join('-'); - } - - return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; - }; - - LanguageUtil.prototype.isWhitelisted = function isWhitelisted(code) { - if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { - code = this.getLanguagePartFromCode(code); - } - return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1; - }; - - LanguageUtil.prototype.getFallbackCodes = function getFallbackCodes(fallbacks, code) { - if (!fallbacks) return []; - if (typeof fallbacks === 'string') fallbacks = [fallbacks]; - if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; - - if (!code) return fallbacks.default || []; - - // asume we have an object defining fallbacks - var found = fallbacks[code]; - if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; - if (!found) found = fallbacks[this.formatLanguageCode(code)]; - if (!found) found = fallbacks.default; - - return found || []; - }; - - LanguageUtil.prototype.toResolveHierarchy = function toResolveHierarchy(code, fallbackCode) { - var _this = this; - - var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code); - - var codes = []; - var addCode = function addCode(c) { - if (!c) return; - if (_this.isWhitelisted(c)) { - codes.push(c); - } else { - _this.logger.warn('rejecting non-whitelisted language code: ' + c); - } - }; - - if (typeof code === 'string' && code.indexOf('-') > -1) { - if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); - if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); - if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); - } else if (typeof code === 'string') { - addCode(this.formatLanguageCode(code)); - } - - fallbackCodes.forEach(function (fc) { - if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); - }); - - return codes; - }; - - return LanguageUtil; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (LanguageUtil); - -/***/ }), - -/***/ 28: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -// definition http://translate.sourceforge.net/wiki/l10n/pluralforms -/* eslint-disable */ -var sets = [{ lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'tg', 'ti', 'tr', 'uz', 'wa'], nr: [1, 2], fc: 1 }, { lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'es_ar', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'he', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt', 'pt_br', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'], nr: [1, 2], fc: 2 }, { lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'], nr: [1], fc: 3 }, { lngs: ['be', 'bs', 'dz', 'hr', 'ru', 'sr', 'uk'], nr: [1, 2, 5], fc: 4 }, { lngs: ['ar'], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ['cs', 'sk'], nr: [1, 2, 5], fc: 6 }, { lngs: ['csb', 'pl'], nr: [1, 2, 5], fc: 7 }, { lngs: ['cy'], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ['fr'], nr: [1, 2], fc: 9 }, { lngs: ['ga'], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ['gd'], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ['is'], nr: [1, 2], fc: 12 }, { lngs: ['jv'], nr: [0, 1], fc: 13 }, { lngs: ['kw'], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ['lt'], nr: [1, 2, 10], fc: 15 }, { lngs: ['lv'], nr: [1, 2, 0], fc: 16 }, { lngs: ['mk'], nr: [1, 2], fc: 17 }, { lngs: ['mnk'], nr: [0, 1, 2], fc: 18 }, { lngs: ['mt'], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ['or'], nr: [2, 1], fc: 2 }, { lngs: ['ro'], nr: [1, 2, 20], fc: 20 }, { lngs: ['sl'], nr: [5, 1, 2, 3], fc: 21 }]; - -var _rulesPluralsTypes = { - 1: function _(n) { - return Number(n > 1); - }, - 2: function _(n) { - return Number(n != 1); - }, - 3: function _(n) { - return 0; - }, - 4: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 5: function _(n) { - return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); - }, - 6: function _(n) { - return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); - }, - 7: function _(n) { - return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 8: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); - }, - 9: function _(n) { - return Number(n >= 2); - }, - 10: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); - }, - 11: function _(n) { - return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); - }, - 12: function _(n) { - return Number(n % 10 != 1 || n % 100 == 11); - }, - 13: function _(n) { - return Number(n !== 0); - }, - 14: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); - }, - 15: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 16: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); - }, - 17: function _(n) { - return Number(n == 1 || n % 10 == 1 ? 0 : 1); - }, - 18: function _(n) { - return Number(n == 0 ? 0 : n == 1 ? 1 : 2); - }, - 19: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); - }, - 20: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); - }, - 21: function _(n) { - return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); - } -}; -/* eslint-enable */ - -function createRules() { - var rules = {}; - sets.forEach(function (set) { - set.lngs.forEach(function (l) { - rules[l] = { - numbers: set.nr, - plurals: _rulesPluralsTypes[set.fc] - }; - }); - }); - return rules; -} - -var PluralResolver = function () { - function PluralResolver(languageUtils) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, PluralResolver); - - this.languageUtils = languageUtils; - this.options = options; - - this.logger = __WEBPACK_IMPORTED_MODULE_0__logger__["a" /* default */].create('pluralResolver'); - - this.rules = createRules(); - } - - PluralResolver.prototype.addRule = function addRule(lng, obj) { - this.rules[lng] = obj; - }; - - PluralResolver.prototype.getRule = function getRule(code) { - return this.rules[this.languageUtils.getLanguagePartFromCode(code)]; - }; - - PluralResolver.prototype.needsPlural = function needsPlural(code) { - var rule = this.getRule(code); - - return rule && rule.numbers.length > 1; - }; - - PluralResolver.prototype.getSuffix = function getSuffix(code, count) { - var _this = this; - - var rule = this.getRule(code); - - if (rule) { - if (rule.numbers.length === 1) return ''; // only singular - - var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); - var suffix = rule.numbers[idx]; - - // special treatment for lngs only having singular and plural - if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { - if (suffix === 2) { - suffix = 'plural'; - } else if (suffix === 1) { - suffix = ''; - } - } - - var returnSuffix = function returnSuffix() { - return _this.options.prepend && suffix.toString() ? _this.options.prepend + suffix.toString() : suffix.toString(); - }; - - // COMPATIBILITY JSON - // v1 - if (this.options.compatibilityJSON === 'v1') { - if (suffix === 1) return ''; - if (typeof suffix === 'number') return '_plural_' + suffix.toString(); - return returnSuffix(); - } else if ( /* v2 */this.options.compatibilityJSON === 'v2' || rule.numbers.length === 2 && rule.numbers[0] === 1) { - return returnSuffix(); - } else if ( /* v3 - gettext index */rule.numbers.length === 2 && rule.numbers[0] === 1) { - return returnSuffix(); - } - return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); - } - - this.logger.warn('no plural rule found for: ' + code); - return ''; - }; - - return PluralResolver; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (PluralResolver); - -/***/ }), - /***/ 29: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -6952,9 +7044,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -7247,7 +7339,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -7671,7 +7763,7 @@ exports.default = ajax; /***/ }), -/***/ 37: +/***/ 38: /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -22683,7 +22775,7 @@ $.widget( "ui.tooltip", { /***/ }), -/***/ 38: +/***/ 39: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -25055,11 +25147,11 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 42: +/***/ 43: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25077,15 +25169,15 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _backbone = __webpack_require__(52); +var _backbone = __webpack_require__(54); var _backbone2 = _interopRequireDefault(_backbone); -var _validator = __webpack_require__(234); +var _validator = __webpack_require__(270); var _validator2 = _interopRequireDefault(_validator); -var _input = __webpack_require__(235); +var _input = __webpack_require__(271); var _input2 = _interopRequireDefault(_input); @@ -25177,76 +25269,34 @@ exports.default = Form; /***/ }), /***/ 5: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ (function(module, exports) { -"use strict"; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; -var EventEmitter = function () { - function EventEmitter() { - _classCallCheck(this, EventEmitter); - - this.observers = {}; - } - - EventEmitter.prototype.on = function on(events, listener) { - var _this = this; - - events.split(' ').forEach(function (event) { - _this.observers[event] = _this.observers[event] || []; - _this.observers[event].push(listener); - }); - }; - - EventEmitter.prototype.off = function off(event, listener) { - var _this2 = this; - - if (!this.observers[event]) { - return; - } - - this.observers[event].forEach(function () { - if (!listener) { - delete _this2.observers[event]; - } else { - var index = _this2.observers[event].indexOf(listener); - if (index > -1) { - _this2.observers[event].splice(index, 1); - } - } - }); - }; - - EventEmitter.prototype.emit = function emit(event) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - if (this.observers[event]) { - var cloned = [].concat(this.observers[event]); - cloned.forEach(function (observer) { - observer.apply(undefined, args); - }); - } - - if (this.observers['*']) { - var _cloned = [].concat(this.observers['*']); - _cloned.forEach(function (observer) { - var _ref; - - observer.apply(observer, (_ref = [event]).concat.apply(_ref, args)); - }); - } - }; - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); /***/ }), -/***/ 52: +/***/ 54: /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3 @@ -27171,11 +27221,11 @@ var EventEmitter = function () { return Backbone; }); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/***/ 53: +/***/ 55: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27193,7 +27243,7 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _form = __webpack_require__(42); +var _form = __webpack_require__(43); var _form2 = _interopRequireDefault(_form); @@ -27272,7 +27322,7 @@ exports.default = PasswordSetterForm; /***/ }), -/***/ 54: +/***/ 56: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27288,8 +27338,8 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(37); __webpack_require__(38); +__webpack_require__(39); var geonames = { init: function init($field, options) { @@ -27334,30 +27384,72 @@ exports.default = geonames; /***/ }), /***/ 6: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; +"use strict"; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var EventEmitter = function () { + function EventEmitter() { + _classCallCheck(this, EventEmitter); + + this.observers = {}; + } + + EventEmitter.prototype.on = function on(events, listener) { + var _this = this; + + events.split(' ').forEach(function (event) { + _this.observers[event] = _this.observers[event] || []; + _this.observers[event].push(listener); + }); + }; + + EventEmitter.prototype.off = function off(event, listener) { + var _this2 = this; + + if (!this.observers[event]) { + return; + } + + this.observers[event].forEach(function () { + if (!listener) { + delete _this2.observers[event]; + } else { + var index = _this2.observers[event].indexOf(listener); + if (index > -1) { + _this2.observers[event].splice(index, 1); + } + } + }); + }; + + EventEmitter.prototype.emit = function emit(event) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (this.observers[event]) { + var cloned = [].concat(this.observers[event]); + cloned.forEach(function (observer) { + observer.apply(undefined, args); + }); + } + + if (this.observers['*']) { + var _cloned = [].concat(this.observers['*']); + _cloned.forEach(function (observer) { + var _ref; + + observer.apply(observer, (_ref = [event]).concat.apply(_ref, args)); + }); + } + }; + + return EventEmitter; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); /***/ }), @@ -39754,128 +39846,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/commons.js b/Phraseanet-production-client/dist/commons.js index d228d2bcd7..cdfc325af2 100644 --- a/Phraseanet-production-client/dist/commons.js +++ b/Phraseanet-production-client/dist/commons.js @@ -2173,7 +2173,7 @@ exports.default = dialog; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /* 3 */ @@ -4257,10 +4257,37 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /* 5 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4328,33 +4355,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { @@ -16749,10 +16749,38 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), /* 8 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 9 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16996,7 +17024,7 @@ var ReactiveTest = Rx.ReactiveTest = { /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17115,34 +17143,6 @@ function escape(data) { return data; } -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - /***/ }), /* 11 */, /* 12 */ @@ -20316,7 +20316,7 @@ process.umask = function() { return 0; }; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -20738,8 +20738,8 @@ var I18n = function (_EventEmitter) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -20890,10 +20890,10 @@ var ResourceStore = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -21493,7 +21493,7 @@ var PluralResolver = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -21668,9 +21668,9 @@ var Interpolator = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -21962,7 +21962,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -22380,7 +22380,8 @@ function ajax(url, options, callback, data, cache) { exports.default = ajax; /***/ }), -/* 37 */ +/* 37 */, +/* 38 */ /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -37391,7 +37392,6 @@ $.widget( "ui.tooltip", { /***/ }), -/* 38 */, /* 39 */, /* 40 */, /* 41 */, @@ -37409,7 +37409,9 @@ $.widget( "ui.tooltip", { /* 53 */, /* 54 */, /* 55 */, -/* 56 */ +/* 56 */, +/* 57 */, +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37540,8 +37542,6 @@ var utilsModule = function () { exports.default = utilsModule; /***/ }), -/* 57 */, -/* 58 */, /* 59 */, /* 60 */, /* 61 */, @@ -37557,7 +37557,12 @@ exports.default = utilsModule; /* 71 */, /* 72 */, /* 73 */, -/* 74 */ +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; diff --git a/Phraseanet-production-client/dist/commons.min.js b/Phraseanet-production-client/dist/commons.min.js index 59e7ce168f..4986c12201 100644 --- a/Phraseanet-production-client/dist/commons.min.js +++ b/Phraseanet-production-client/dist/commons.min.js @@ -2173,7 +2173,7 @@ exports.default = dialog; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /* 3 */ @@ -4257,10 +4257,37 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /* 5 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4328,33 +4355,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { @@ -16749,10 +16749,38 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), /* 8 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 9 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16996,7 +17024,7 @@ var ReactiveTest = Rx.ReactiveTest = { /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -17115,34 +17143,6 @@ function escape(data) { return data; } -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - /***/ }), /* 11 */, /* 12 */ @@ -20316,7 +20316,7 @@ process.umask = function() { return 0; }; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -20738,8 +20738,8 @@ var I18n = function (_EventEmitter) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -20890,10 +20890,10 @@ var ResourceStore = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -21493,7 +21493,7 @@ var PluralResolver = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -21668,9 +21668,9 @@ var Interpolator = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -21962,7 +21962,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -22380,7 +22380,8 @@ function ajax(url, options, callback, data, cache) { exports.default = ajax; /***/ }), -/* 37 */ +/* 37 */, +/* 38 */ /***/ (function(module, exports, __webpack_require__) { var jQuery = __webpack_require__(0); @@ -37391,7 +37392,6 @@ $.widget( "ui.tooltip", { /***/ }), -/* 38 */, /* 39 */, /* 40 */, /* 41 */, @@ -37409,7 +37409,9 @@ $.widget( "ui.tooltip", { /* 53 */, /* 54 */, /* 55 */, -/* 56 */ +/* 56 */, +/* 57 */, +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37540,8 +37542,6 @@ var utilsModule = function () { exports.default = utilsModule; /***/ }), -/* 57 */, -/* 58 */, /* 59 */, /* 60 */, /* 61 */, @@ -37557,7 +37557,12 @@ exports.default = utilsModule; /* 71 */, /* 72 */, /* 73 */, -/* 74 */ +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; diff --git a/Phraseanet-production-client/dist/lazy-0.js b/Phraseanet-production-client/dist/lazy-0.js index 8f1efec256..91f50fa487 100644 --- a/Phraseanet-production-client/dist/lazy-0.js +++ b/Phraseanet-production-client/dist/lazy-0.js @@ -1,12 +1,12 @@ webpackJsonpapp([0],{ -/***/ 288: +/***/ 324: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var BRUTEFORCE_CARDINALITY, MIN_GUESSES_BEFORE_GROWING_SEQUENCE, MIN_SUBMATCH_GUESSES_MULTI_CHAR, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, adjacency_graphs, calc_average_degree, k, scoring, v; -adjacency_graphs = __webpack_require__(319); +adjacency_graphs = __webpack_require__(355); calc_average_degree = function(graph) { var average, k, key, n, neighbors, v; @@ -493,7 +493,7 @@ module.exports = scoring; /***/ }), -/***/ 319: +/***/ 355: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -736,17 +736,17 @@ module.exports = adjacency_graphs; /***/ }), -/***/ 427: +/***/ 462: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var DATE_MAX_YEAR, DATE_MIN_YEAR, DATE_SPLITS, GRAPHS, L33T_TABLE, RANKED_DICTIONARIES, REGEXEN, adjacency_graphs, build_ranked_dict, frequency_lists, lst, matching, name, scoring; -frequency_lists = __webpack_require__(428); +frequency_lists = __webpack_require__(463); -adjacency_graphs = __webpack_require__(319); +adjacency_graphs = __webpack_require__(355); -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); build_ranked_dict = function(ordered_list) { var i, len1, o, result, word; @@ -1439,7 +1439,7 @@ module.exports = matching; /***/ }), -/***/ 428: +/***/ 463: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -1461,7 +1461,7 @@ module.exports = frequency_lists; /***/ }), -/***/ 429: +/***/ 464: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -1525,13 +1525,13 @@ module.exports = time_estimates; /***/ }), -/***/ 430: +/***/ 465: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var feedback, scoring; -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); feedback = { default_feedback: { @@ -1641,19 +1641,19 @@ module.exports = feedback; /***/ }), -/***/ 55: +/***/ 57: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var feedback, matching, scoring, time, time_estimates, zxcvbn; -matching = __webpack_require__(427); +matching = __webpack_require__(462); -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); -time_estimates = __webpack_require__(429); +time_estimates = __webpack_require__(464); -feedback = __webpack_require__(430); +feedback = __webpack_require__(465); time = function() { return (new Date()).getTime(); diff --git a/Phraseanet-production-client/dist/lazy-0.min.js b/Phraseanet-production-client/dist/lazy-0.min.js index 8f1efec256..91f50fa487 100644 --- a/Phraseanet-production-client/dist/lazy-0.min.js +++ b/Phraseanet-production-client/dist/lazy-0.min.js @@ -1,12 +1,12 @@ webpackJsonpapp([0],{ -/***/ 288: +/***/ 324: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var BRUTEFORCE_CARDINALITY, MIN_GUESSES_BEFORE_GROWING_SEQUENCE, MIN_SUBMATCH_GUESSES_MULTI_CHAR, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, adjacency_graphs, calc_average_degree, k, scoring, v; -adjacency_graphs = __webpack_require__(319); +adjacency_graphs = __webpack_require__(355); calc_average_degree = function(graph) { var average, k, key, n, neighbors, v; @@ -493,7 +493,7 @@ module.exports = scoring; /***/ }), -/***/ 319: +/***/ 355: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -736,17 +736,17 @@ module.exports = adjacency_graphs; /***/ }), -/***/ 427: +/***/ 462: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var DATE_MAX_YEAR, DATE_MIN_YEAR, DATE_SPLITS, GRAPHS, L33T_TABLE, RANKED_DICTIONARIES, REGEXEN, adjacency_graphs, build_ranked_dict, frequency_lists, lst, matching, name, scoring; -frequency_lists = __webpack_require__(428); +frequency_lists = __webpack_require__(463); -adjacency_graphs = __webpack_require__(319); +adjacency_graphs = __webpack_require__(355); -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); build_ranked_dict = function(ordered_list) { var i, len1, o, result, word; @@ -1439,7 +1439,7 @@ module.exports = matching; /***/ }), -/***/ 428: +/***/ 463: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -1461,7 +1461,7 @@ module.exports = frequency_lists; /***/ }), -/***/ 429: +/***/ 464: /***/ (function(module, exports) { // Generated by CoffeeScript 1.10.0 @@ -1525,13 +1525,13 @@ module.exports = time_estimates; /***/ }), -/***/ 430: +/***/ 465: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var feedback, scoring; -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); feedback = { default_feedback: { @@ -1641,19 +1641,19 @@ module.exports = feedback; /***/ }), -/***/ 55: +/***/ 57: /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 1.10.0 var feedback, matching, scoring, time, time_estimates, zxcvbn; -matching = __webpack_require__(427); +matching = __webpack_require__(462); -scoring = __webpack_require__(288); +scoring = __webpack_require__(324); -time_estimates = __webpack_require__(429); +time_estimates = __webpack_require__(464); -feedback = __webpack_require__(430); +feedback = __webpack_require__(465); time = function() { return (new Date()).getTime(); diff --git a/Phraseanet-production-client/dist/lazy-1.js b/Phraseanet-production-client/dist/lazy-1.js index 08160784a8..9e48ef7034 100644 --- a/Phraseanet-production-client/dist/lazy-1.js +++ b/Phraseanet-production-client/dist/lazy-1.js @@ -1,35 +1,35 @@ webpackJsonpapp([1],{ -/***/ 268: +/***/ 304: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_global_window__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document__ = __webpack_require__(83); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_global_document__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml__ = __webpack_require__(89); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_tsml__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__ = __webpack_require__(90); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode__ = __webpack_require__(321); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode__ = __webpack_require__(357); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_keycode__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr__ = __webpack_require__(86); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr__ = __webpack_require__(91); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_xhr__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__ = __webpack_require__(289); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__ = __webpack_require__(325); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit__ = __webpack_require__(325); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit__ = __webpack_require__(361); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_url_toolkit__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_m3u8_parser__ = __webpack_require__(326); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_mpd_parser__ = __webpack_require__(327); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__ = __webpack_require__(274); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_m3u8_parser__ = __webpack_require__(362); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_mpd_parser__ = __webpack_require__(363); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__ = __webpack_require__(310); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__ = __webpack_require__(329); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__ = __webpack_require__(365); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__ = __webpack_require__(343); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__ = __webpack_require__(379); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_aes_decrypter__ = __webpack_require__(345); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_aes_decrypter__ = __webpack_require__(381); /** * @license * Video.js 7.5.5 @@ -45062,7 +45062,7 @@ if (videojs$1.registerPlugin) { /***/ }), -/***/ 269: +/***/ 305: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45187,7 +45187,7 @@ module.exports = Stream; /***/ }), -/***/ 271: +/***/ 307: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45202,7 +45202,7 @@ module.exports = { /***/ }), -/***/ 274: +/***/ 310: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45216,7 +45216,7 @@ module.exports = { */ -var toUnsigned = __webpack_require__(328).toUnsigned; +var toUnsigned = __webpack_require__(364).toUnsigned; var findBox, parseType, timescale, startTime, getVideoTrackIds; // Find the data for a box specified by its path @@ -45440,7 +45440,7 @@ module.exports = { /***/ }), -/***/ 277: +/***/ 313: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45456,16 +45456,16 @@ module.exports = { */ -var Stream = __webpack_require__(269); -var mp4 = __webpack_require__(290); -var frameUtils = __webpack_require__(330); -var audioFrameUtils = __webpack_require__(331); -var trackDecodeInfo = __webpack_require__(334); -var m2ts = __webpack_require__(335); -var AdtsStream = __webpack_require__(337); -var H264Stream = __webpack_require__(338).H264Stream; -var AacStream = __webpack_require__(340); -var isLikelyAacData = __webpack_require__(278).isLikelyAacData; +var Stream = __webpack_require__(305); +var mp4 = __webpack_require__(326); +var frameUtils = __webpack_require__(366); +var audioFrameUtils = __webpack_require__(367); +var trackDecodeInfo = __webpack_require__(370); +var m2ts = __webpack_require__(371); +var AdtsStream = __webpack_require__(373); +var H264Stream = __webpack_require__(374).H264Stream; +var AacStream = __webpack_require__(376); +var isLikelyAacData = __webpack_require__(314).isLikelyAacData; // constants var AUDIO_PROPERTIES = [ @@ -46549,7 +46549,7 @@ module.exports = { /***/ }), -/***/ 278: +/***/ 314: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46728,7 +46728,7 @@ module.exports = { /***/ }), -/***/ 279: +/***/ 315: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46808,7 +46808,7 @@ exports.formatToFixedDecimals = formatToFixedDecimals; /***/ }), -/***/ 289: +/***/ 325: /***/ (function(module, exports, __webpack_require__) { /** @@ -46832,12 +46832,12 @@ exports.formatToFixedDecimals = formatToFixedDecimals; // forth between JSON. If we don't then it's not that big of a deal since we're // off browser. -var window = __webpack_require__(43); +var window = __webpack_require__(44); var vttjs = module.exports = { - WebVTT: __webpack_require__(322), - VTTCue: __webpack_require__(323), - VTTRegion: __webpack_require__(324) + WebVTT: __webpack_require__(358), + VTTCue: __webpack_require__(359), + VTTRegion: __webpack_require__(360) }; window.vttjs = vttjs; @@ -46865,7 +46865,7 @@ if (!window.VTTCue) { /***/ }), -/***/ 290: +/***/ 326: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47643,7 +47643,7 @@ module.exports = { /***/ }), -/***/ 291: +/***/ 327: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47666,8 +47666,8 @@ module.exports = { // Link To Transport // ----------------- -var Stream = __webpack_require__(269); -var cea708Parser = __webpack_require__(292); +var Stream = __webpack_require__(305); +var cea708Parser = __webpack_require__(328); var CaptionStream = function() { @@ -48478,7 +48478,7 @@ module.exports = { /***/ }), -/***/ 292: +/***/ 328: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48672,7 +48672,7 @@ module.exports = { /***/ }), -/***/ 293: +/***/ 329: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48689,7 +48689,7 @@ module.exports = { -var Stream = __webpack_require__(269); +var Stream = __webpack_require__(305); var MAX_TS = 8589934592; @@ -48764,7 +48764,7 @@ module.exports = { /***/ }), -/***/ 294: +/***/ 330: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48776,7 +48776,7 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); @@ -48827,7 +48827,7 @@ exports.default = HotkeyModal; /***/ }), -/***/ 295: +/***/ 331: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48849,17 +48849,17 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeItem = __webpack_require__(351); +var _rangeItem = __webpack_require__(387); var _rangeItem2 = _interopRequireDefault(_rangeItem); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); -var _alert = __webpack_require__(44); +var _alert = __webpack_require__(46); var _alert2 = _interopRequireDefault(_alert); @@ -48875,7 +48875,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); /** * VideoJs Range Collection @@ -49408,7 +49408,7 @@ exports.default = RangeCollection; /***/ }), -/***/ 320: +/***/ 356: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49426,35 +49426,35 @@ var _rx = __webpack_require__(7); var Rx = _interopRequireWildcard(_rx); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _hotkeysModal = __webpack_require__(294); +var _hotkeysModal = __webpack_require__(330); var _hotkeysModal2 = _interopRequireDefault(_hotkeysModal); -var _hotkeysModalButton = __webpack_require__(347); +var _hotkeysModalButton = __webpack_require__(383); var _hotkeysModalButton2 = _interopRequireDefault(_hotkeysModalButton); -var _rangeBarCollection = __webpack_require__(348); +var _rangeBarCollection = __webpack_require__(384); var _rangeBarCollection2 = _interopRequireDefault(_rangeBarCollection); -var _rangeCollection = __webpack_require__(295); +var _rangeCollection = __webpack_require__(331); var _rangeCollection2 = _interopRequireDefault(_rangeCollection); -var _rangeControlBar = __webpack_require__(353); +var _rangeControlBar = __webpack_require__(389); var _rangeControlBar2 = _interopRequireDefault(_rangeControlBar); -var _videojsVtt = __webpack_require__(289); +var _videojsVtt = __webpack_require__(325); -var _hotkeys = __webpack_require__(354); +var _hotkeys = __webpack_require__(390); -var _rangeItemContainer = __webpack_require__(355); +var _rangeItemContainer = __webpack_require__(391); var _rangeItemContainer2 = _interopRequireDefault(_rangeItemContainer); @@ -49467,7 +49467,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable quotes */ -__webpack_require__(356); +__webpack_require__(392); // import rangeControls from './oldControlBar'; @@ -49777,7 +49777,7 @@ exports.default = plugin; /***/ }), -/***/ 321: +/***/ 357: /***/ (function(module, exports) { // Source: http://jsfiddle.net/vWx8V/ @@ -49959,7 +49959,7 @@ for (var alias in aliases) { /***/ }), -/***/ 322: +/***/ 358: /***/ (function(module, exports) { /** @@ -51274,7 +51274,7 @@ module.exports = WebVTT; /***/ }), -/***/ 323: +/***/ 359: /***/ (function(module, exports) { /** @@ -51562,7 +51562,7 @@ module.exports = VTTCue; /***/ }), -/***/ 324: +/***/ 360: /***/ (function(module, exports) { /** @@ -51703,7 +51703,7 @@ module.exports = VTTRegion; /***/ }), -/***/ 325: +/***/ 361: /***/ (function(module, exports, __webpack_require__) { // see https://tools.ietf.org/html/rfc1808 @@ -51873,7 +51873,7 @@ module.exports = VTTRegion; /***/ }), -/***/ 326: +/***/ 362: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53154,14 +53154,14 @@ function (_Stream) { /***/ }), -/***/ 327: +/***/ 363: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export VERSION */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return parseUTCTiming; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_global_window__); /*! @name mpd-parser @version 0.7.0 @license Apache-2.0 */ @@ -55004,11 +55004,11 @@ var parseUTCTiming = function parseUTCTiming(manifestString) { -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(5))) /***/ }), -/***/ 328: +/***/ 364: /***/ (function(module, exports) { var toUnsigned = function(value) { @@ -55022,22 +55022,22 @@ module.exports = { /***/ }), -/***/ 329: +/***/ 365: /***/ (function(module, exports, __webpack_require__) { module.exports = { - generator: __webpack_require__(290), - probe: __webpack_require__(274), - Transmuxer: __webpack_require__(277).Transmuxer, - AudioSegmentStream: __webpack_require__(277).AudioSegmentStream, - VideoSegmentStream: __webpack_require__(277).VideoSegmentStream, - CaptionParser: __webpack_require__(341) + generator: __webpack_require__(326), + probe: __webpack_require__(310), + Transmuxer: __webpack_require__(313).Transmuxer, + AudioSegmentStream: __webpack_require__(313).AudioSegmentStream, + VideoSegmentStream: __webpack_require__(313).VideoSegmentStream, + CaptionParser: __webpack_require__(377) }; /***/ }), -/***/ 330: +/***/ 366: /***/ (function(module, exports) { // Convert an array of nal units into an array of frames with each frame being @@ -55303,11 +55303,11 @@ module.exports = { /***/ }), -/***/ 331: +/***/ 367: /***/ (function(module, exports, __webpack_require__) { -var coneOfSilence = __webpack_require__(332); -var clock = __webpack_require__(333); +var coneOfSilence = __webpack_require__(368); +var clock = __webpack_require__(369); var ONE_SECOND_IN_TS = 90000; // 90kHz clock @@ -55456,7 +55456,7 @@ module.exports = { /***/ }), -/***/ 332: +/***/ 368: /***/ (function(module, exports) { var highPrefix = [33, 16, 5, 32, 164, 27]; @@ -55498,7 +55498,7 @@ module.exports = makeTable(coneOfSilence); /***/ }), -/***/ 333: +/***/ 369: /***/ (function(module, exports) { var @@ -55546,7 +55546,7 @@ module.exports = { /***/ }), -/***/ 334: +/***/ 370: /***/ (function(module, exports) { var ONE_SECOND_IN_TS = 90000; // 90kHz clock @@ -55654,7 +55654,7 @@ module.exports = { /***/ }), -/***/ 335: +/***/ 371: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55669,12 +55669,12 @@ module.exports = { * Media Source Extensions. */ -var Stream = __webpack_require__(269), - CaptionStream = __webpack_require__(291), - StreamTypes = __webpack_require__(271), - TimestampRolloverStream = __webpack_require__(293).TimestampRolloverStream; +var Stream = __webpack_require__(305), + CaptionStream = __webpack_require__(327), + StreamTypes = __webpack_require__(307), + TimestampRolloverStream = __webpack_require__(329).TimestampRolloverStream; -var m2tsStreamTypes = __webpack_require__(271); +var m2tsStreamTypes = __webpack_require__(307); // object types var TransportPacketStream, TransportParseStream, ElementaryStream; @@ -56167,7 +56167,7 @@ var m2ts = { TimestampRolloverStream: TimestampRolloverStream, CaptionStream: CaptionStream.CaptionStream, Cea608Stream: CaptionStream.Cea608Stream, - MetadataStream: __webpack_require__(336) + MetadataStream: __webpack_require__(372) }; for (var type in StreamTypes) { @@ -56181,7 +56181,7 @@ module.exports = m2ts; /***/ }), -/***/ 336: +/***/ 372: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56192,8 +56192,8 @@ module.exports = m2ts; */ var - Stream = __webpack_require__(269), - StreamTypes = __webpack_require__(271), + Stream = __webpack_require__(305), + StreamTypes = __webpack_require__(307), // return a percent-encoded representation of the specified byte range // @see http://en.wikipedia.org/wiki/Percent-encoding percentEncode = function(bytes, start, end) { @@ -56437,13 +56437,13 @@ module.exports = MetadataStream; /***/ }), -/***/ 337: +/***/ 373: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Stream = __webpack_require__(269); +var Stream = __webpack_require__(305); var AdtsStream; @@ -56577,14 +56577,14 @@ module.exports = AdtsStream; /***/ }), -/***/ 338: +/***/ 374: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Stream = __webpack_require__(269); -var ExpGolomb = __webpack_require__(339); +var Stream = __webpack_require__(305); +var ExpGolomb = __webpack_require__(375); var H264Stream, NalByteStream; var PROFILES_WITH_OPTIONAL_SPS_DATA; @@ -57030,7 +57030,7 @@ module.exports = { /***/ }), -/***/ 339: +/***/ 375: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57185,7 +57185,7 @@ module.exports = ExpGolomb; /***/ }), -/***/ 340: +/***/ 376: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57200,8 +57200,8 @@ module.exports = ExpGolomb; * Media Source Extensions. */ -var Stream = __webpack_require__(269); -var aacUtils = __webpack_require__(278); +var Stream = __webpack_require__(305); +var aacUtils = __webpack_require__(314); // Constants var AacStream; @@ -57314,7 +57314,7 @@ module.exports = AacStream; /***/ }), -/***/ 341: +/***/ 377: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57329,10 +57329,10 @@ module.exports = AacStream; */ -var discardEmulationPreventionBytes = __webpack_require__(292).discardEmulationPreventionBytes; -var CaptionStream = __webpack_require__(291).CaptionStream; -var probe = __webpack_require__(274); -var inspect = __webpack_require__(342); +var discardEmulationPreventionBytes = __webpack_require__(328).discardEmulationPreventionBytes; +var CaptionStream = __webpack_require__(327).CaptionStream; +var probe = __webpack_require__(310); +var inspect = __webpack_require__(378); /** * Maps an offset in the mdat to a sample based on the the size of the samples. @@ -57762,7 +57762,7 @@ module.exports = CaptionParser; /***/ }), -/***/ 342: +/***/ 378: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57781,7 +57781,7 @@ var inspectMp4, textifyMp4, - parseType = __webpack_require__(274).parseType, + parseType = __webpack_require__(310).parseType, parseMp4Date = function(seconds) { return new Date(seconds * 1000 - 2082844800000); }, @@ -58617,7 +58617,7 @@ module.exports = { /***/ }), -/***/ 343: +/***/ 379: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58631,11 +58631,11 @@ module.exports = { */ -var StreamTypes = __webpack_require__(271); -var handleRollover = __webpack_require__(293).handleRollover; +var StreamTypes = __webpack_require__(307); +var handleRollover = __webpack_require__(329).handleRollover; var probe = {}; -probe.ts = __webpack_require__(344); -probe.aac = __webpack_require__(278); +probe.ts = __webpack_require__(380); +probe.aac = __webpack_require__(314); var @@ -59131,7 +59131,7 @@ module.exports = { /***/ }), -/***/ 344: +/***/ 380: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59145,7 +59145,7 @@ module.exports = { */ -var StreamTypes = __webpack_require__(271); +var StreamTypes = __webpack_require__(307); var parsePid = function(packet) { var pid = packet[1] & 0x1f; @@ -59426,14 +59426,14 @@ module.exports = { /***/ }), -/***/ 345: +/***/ 381: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return decrypt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Decrypter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncStream; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pkcs7__ = __webpack_require__(346); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pkcs7__ = __webpack_require__(382); var classCallCheck = function (instance, Constructor) { @@ -60074,7 +60074,7 @@ var Decrypter = function () { /***/ }), -/***/ 346: +/***/ 382: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -60127,7 +60127,7 @@ var version = "1.0.2"; /***/ }), -/***/ 347: +/***/ 383: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60145,11 +60145,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _hotkeysModal = __webpack_require__(294); +var _hotkeysModal = __webpack_require__(330); var _hotkeysModal2 = _interopRequireDefault(_hotkeysModal); @@ -60235,7 +60235,7 @@ exports.default = HotkeysModalButton; /***/ }), -/***/ 348: +/***/ 384: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60249,11 +60249,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeBar = __webpack_require__(349); +var _rangeBar = __webpack_require__(385); var _rangeBar2 = _interopRequireDefault(_rangeBar); @@ -60329,7 +60329,7 @@ exports.default = RangeBarCollection; /***/ }), -/***/ 349: +/***/ 385: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60347,11 +60347,11 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _nouislider = __webpack_require__(350); +var _nouislider = __webpack_require__(386); var _nouislider2 = _interopRequireDefault(_nouislider); @@ -60495,7 +60495,7 @@ exports.default = RangeBar; /***/ }), -/***/ 350: +/***/ 386: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! nouislider - 9.2.0 - 2017-01-11 10:35:34 */ @@ -62650,7 +62650,7 @@ function closure ( target, options, originalOptions ){ /***/ }), -/***/ 351: +/***/ 387: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62672,13 +62672,13 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); -var _sortableComponent = __webpack_require__(352); +var _sortableComponent = __webpack_require__(388); var _sortableComponent2 = _interopRequireDefault(_sortableComponent); @@ -62822,7 +62822,7 @@ exports.default = RangeItem; /***/ }), -/***/ 352: +/***/ 388: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63103,7 +63103,7 @@ exports.default = SortableComponent; /***/ }), -/***/ 353: +/***/ 389: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63125,11 +63125,11 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63573,7 +63573,7 @@ exports.default = RangeControlBar; /***/ }), -/***/ 354: +/***/ 390: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63828,7 +63828,7 @@ exports.hotkeys = hotkeys; /***/ }), -/***/ 355: +/***/ 391: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63850,11 +63850,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeCollection = __webpack_require__(295); +var _rangeCollection = __webpack_require__(331); var _rangeCollection2 = _interopRequireDefault(_rangeCollection); @@ -63954,23 +63954,23 @@ exports.default = RangeItemContainer; /***/ }), -/***/ 356: +/***/ 392: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 357: +/***/ 393: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* videojs-hotkeys v0.2.21 - https://github.com/ctd1500/videojs-hotkeys */ -!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(268)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){return t(e.default||e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), +!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(304)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){return t(e.default||e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):"undefined"!=typeof module&&module.exports?module.exports=t(require("video.js")):t(videojs)}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.21"});(e.registerPlugin||e.plugin)("hotkeys",function(t){var r=this,n=r.el(),o=document,u={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},l=e.mergeOptions||e.util.mergeOptions,i=(t=l(u,t||{})).volumeStep,c=t.seekStep,a=t.enableMute,s=t.enableVolumeScroll,m=t.enableFullscreen,y=t.enableNumbers,f=t.enableJogStyle,v=t.alwaysCaptureHotkeys,d=t.enableModifiersForNumbers,p=t.enableInactiveFocus,b=t.skipInitialFocus;n.hasAttribute("tabIndex")||n.setAttribute("tabIndex","-1"),n.style.outline="none",!v&&r.autoplay()||b||r.one("play",function(){n.focus()}),p&&r.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){r.off("useractive",e),o.activeElement.parentElement==n.querySelector(".vjs-control-bar")&&n.focus()},10);r.one("useractive",e)}),r.on("play",function(){var e=n.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var h=function(e){if(r.controls()){var t=o.activeElement;if((v||t==n||t==n.querySelector(".vjs-tech")||t==n.querySelector(".iframeblocker")||t==n.querySelector(".vjs-control-bar"))&&s){e=window.event||e;var u=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==u?r.volume(r.volume()+i):-1==u&&r.volume(r.volume()-i)}}},w=function(e,r){return t.playPauseKey(e,r)?1:t.rewindKey(e,r)?2:t.forwardKey(e,r)?3:t.volumeUpKey(e,r)?4:t.volumeDownKey(e,r)?5:t.muteKey(e,r)?6:t.fullscreenKey(e,r)?7:void 0};return r.on("keydown",function(e){var u,l,s=e.which,p=e.preventDefault,b=r.duration();if(r.controls()){var h=o.activeElement;if(v||h==n||h==n.querySelector(".vjs-tech")||h==n.querySelector(".vjs-control-bar")||h==n.querySelector(".iframeblocker"))switch(w(e,r)){case 1:p(),v&&e.stopPropagation(),r.paused()?r.play():r.pause();break;case 2:u=!r.paused(),p(),u&&r.pause(),l=r.currentTime()-c,r.currentTime()<=c&&(l=0),r.currentTime(l),u&&r.play();break;case 3:u=!r.paused(),p(),u&&r.pause(),(l=r.currentTime()+c)>=b&&(l=u?b-.001:b),r.currentTime(l),u&&r.play();break;case 5:p(),f?(l=r.currentTime()-1,r.currentTime()<=1&&(l=0),r.currentTime(l)):r.volume(r.volume()-i);break;case 4:p(),f?((l=r.currentTime()+1)>=b&&(l=b),r.currentTime(l)):r.volume(r.volume()+i);break;case 6:a&&r.muted(!r.muted());break;case 7:m&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen());break;default:if((s>47&&s<59||s>95&&s<106)&&(d||!(e.metaKey||e.ctrlKey||e.altKey))&&y){var k=48;s>95&&(k=96);var K=s-k;p(),r.currentTime(r.duration()*K*.1)}for(var S in t.customKeys){var F=t.customKeys[S];F&&F.key&&F.handler&&F.key(e)&&(p(),F.handler(r,t,e))}}}}),r.on("dblclick",function(e){if(r.controls()){var t=e.relatedTarget||e.toElement||o.activeElement;t!=n&&t!=n.querySelector(".vjs-tech")&&t!=n.querySelector(".iframeblocker")||m&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen())}}),r.on("mousewheel",h),r.on("DOMMouseScroll",h),this})}); /***/ }), -/***/ 87: +/***/ 92: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63988,17 +63988,17 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _index = __webpack_require__(320); +var _index = __webpack_require__(356); var _index2 = _interopRequireDefault(_index); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var hotkeys = __webpack_require__(357); +var hotkeys = __webpack_require__(393); // require('video.js').default; diff --git a/Phraseanet-production-client/dist/lazy-1.min.js b/Phraseanet-production-client/dist/lazy-1.min.js index 08160784a8..9e48ef7034 100644 --- a/Phraseanet-production-client/dist/lazy-1.min.js +++ b/Phraseanet-production-client/dist/lazy-1.min.js @@ -1,35 +1,35 @@ webpackJsonpapp([1],{ -/***/ 268: +/***/ 304: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_global_window__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document__ = __webpack_require__(83); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_global_document___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_global_document__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml__ = __webpack_require__(89); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tsml___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_tsml__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__ = __webpack_require__(90); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_safe_json_parse_tuple__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode__ = __webpack_require__(321); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode__ = __webpack_require__(357); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_keycode___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_keycode__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr__ = __webpack_require__(86); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr__ = __webpack_require__(91); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_xhr___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_xhr__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__ = __webpack_require__(289); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__ = __webpack_require__(325); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_videojs_vtt_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit__ = __webpack_require__(325); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit__ = __webpack_require__(361); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_url_toolkit___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_url_toolkit__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_m3u8_parser__ = __webpack_require__(326); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_mpd_parser__ = __webpack_require__(327); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__ = __webpack_require__(274); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_m3u8_parser__ = __webpack_require__(362); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_mpd_parser__ = __webpack_require__(363); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__ = __webpack_require__(310); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_mux_js_lib_mp4_probe__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__ = __webpack_require__(329); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__ = __webpack_require__(365); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_mux_js_lib_mp4__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__ = __webpack_require__(343); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__ = __webpack_require__(379); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_mux_js_lib_tools_ts_inspector_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_aes_decrypter__ = __webpack_require__(345); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_aes_decrypter__ = __webpack_require__(381); /** * @license * Video.js 7.5.5 @@ -45062,7 +45062,7 @@ if (videojs$1.registerPlugin) { /***/ }), -/***/ 269: +/***/ 305: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45187,7 +45187,7 @@ module.exports = Stream; /***/ }), -/***/ 271: +/***/ 307: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45202,7 +45202,7 @@ module.exports = { /***/ }), -/***/ 274: +/***/ 310: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45216,7 +45216,7 @@ module.exports = { */ -var toUnsigned = __webpack_require__(328).toUnsigned; +var toUnsigned = __webpack_require__(364).toUnsigned; var findBox, parseType, timescale, startTime, getVideoTrackIds; // Find the data for a box specified by its path @@ -45440,7 +45440,7 @@ module.exports = { /***/ }), -/***/ 277: +/***/ 313: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45456,16 +45456,16 @@ module.exports = { */ -var Stream = __webpack_require__(269); -var mp4 = __webpack_require__(290); -var frameUtils = __webpack_require__(330); -var audioFrameUtils = __webpack_require__(331); -var trackDecodeInfo = __webpack_require__(334); -var m2ts = __webpack_require__(335); -var AdtsStream = __webpack_require__(337); -var H264Stream = __webpack_require__(338).H264Stream; -var AacStream = __webpack_require__(340); -var isLikelyAacData = __webpack_require__(278).isLikelyAacData; +var Stream = __webpack_require__(305); +var mp4 = __webpack_require__(326); +var frameUtils = __webpack_require__(366); +var audioFrameUtils = __webpack_require__(367); +var trackDecodeInfo = __webpack_require__(370); +var m2ts = __webpack_require__(371); +var AdtsStream = __webpack_require__(373); +var H264Stream = __webpack_require__(374).H264Stream; +var AacStream = __webpack_require__(376); +var isLikelyAacData = __webpack_require__(314).isLikelyAacData; // constants var AUDIO_PROPERTIES = [ @@ -46549,7 +46549,7 @@ module.exports = { /***/ }), -/***/ 278: +/***/ 314: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46728,7 +46728,7 @@ module.exports = { /***/ }), -/***/ 279: +/***/ 315: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46808,7 +46808,7 @@ exports.formatToFixedDecimals = formatToFixedDecimals; /***/ }), -/***/ 289: +/***/ 325: /***/ (function(module, exports, __webpack_require__) { /** @@ -46832,12 +46832,12 @@ exports.formatToFixedDecimals = formatToFixedDecimals; // forth between JSON. If we don't then it's not that big of a deal since we're // off browser. -var window = __webpack_require__(43); +var window = __webpack_require__(44); var vttjs = module.exports = { - WebVTT: __webpack_require__(322), - VTTCue: __webpack_require__(323), - VTTRegion: __webpack_require__(324) + WebVTT: __webpack_require__(358), + VTTCue: __webpack_require__(359), + VTTRegion: __webpack_require__(360) }; window.vttjs = vttjs; @@ -46865,7 +46865,7 @@ if (!window.VTTCue) { /***/ }), -/***/ 290: +/***/ 326: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47643,7 +47643,7 @@ module.exports = { /***/ }), -/***/ 291: +/***/ 327: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47666,8 +47666,8 @@ module.exports = { // Link To Transport // ----------------- -var Stream = __webpack_require__(269); -var cea708Parser = __webpack_require__(292); +var Stream = __webpack_require__(305); +var cea708Parser = __webpack_require__(328); var CaptionStream = function() { @@ -48478,7 +48478,7 @@ module.exports = { /***/ }), -/***/ 292: +/***/ 328: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48672,7 +48672,7 @@ module.exports = { /***/ }), -/***/ 293: +/***/ 329: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48689,7 +48689,7 @@ module.exports = { -var Stream = __webpack_require__(269); +var Stream = __webpack_require__(305); var MAX_TS = 8589934592; @@ -48764,7 +48764,7 @@ module.exports = { /***/ }), -/***/ 294: +/***/ 330: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48776,7 +48776,7 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); @@ -48827,7 +48827,7 @@ exports.default = HotkeyModal; /***/ }), -/***/ 295: +/***/ 331: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48849,17 +48849,17 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeItem = __webpack_require__(351); +var _rangeItem = __webpack_require__(387); var _rangeItem2 = _interopRequireDefault(_rangeItem); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); -var _alert = __webpack_require__(44); +var _alert = __webpack_require__(46); var _alert2 = _interopRequireDefault(_alert); @@ -48875,7 +48875,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); /** * VideoJs Range Collection @@ -49408,7 +49408,7 @@ exports.default = RangeCollection; /***/ }), -/***/ 320: +/***/ 356: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49426,35 +49426,35 @@ var _rx = __webpack_require__(7); var Rx = _interopRequireWildcard(_rx); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _hotkeysModal = __webpack_require__(294); +var _hotkeysModal = __webpack_require__(330); var _hotkeysModal2 = _interopRequireDefault(_hotkeysModal); -var _hotkeysModalButton = __webpack_require__(347); +var _hotkeysModalButton = __webpack_require__(383); var _hotkeysModalButton2 = _interopRequireDefault(_hotkeysModalButton); -var _rangeBarCollection = __webpack_require__(348); +var _rangeBarCollection = __webpack_require__(384); var _rangeBarCollection2 = _interopRequireDefault(_rangeBarCollection); -var _rangeCollection = __webpack_require__(295); +var _rangeCollection = __webpack_require__(331); var _rangeCollection2 = _interopRequireDefault(_rangeCollection); -var _rangeControlBar = __webpack_require__(353); +var _rangeControlBar = __webpack_require__(389); var _rangeControlBar2 = _interopRequireDefault(_rangeControlBar); -var _videojsVtt = __webpack_require__(289); +var _videojsVtt = __webpack_require__(325); -var _hotkeys = __webpack_require__(354); +var _hotkeys = __webpack_require__(390); -var _rangeItemContainer = __webpack_require__(355); +var _rangeItemContainer = __webpack_require__(391); var _rangeItemContainer2 = _interopRequireDefault(_rangeItemContainer); @@ -49467,7 +49467,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable quotes */ -__webpack_require__(356); +__webpack_require__(392); // import rangeControls from './oldControlBar'; @@ -49777,7 +49777,7 @@ exports.default = plugin; /***/ }), -/***/ 321: +/***/ 357: /***/ (function(module, exports) { // Source: http://jsfiddle.net/vWx8V/ @@ -49959,7 +49959,7 @@ for (var alias in aliases) { /***/ }), -/***/ 322: +/***/ 358: /***/ (function(module, exports) { /** @@ -51274,7 +51274,7 @@ module.exports = WebVTT; /***/ }), -/***/ 323: +/***/ 359: /***/ (function(module, exports) { /** @@ -51562,7 +51562,7 @@ module.exports = VTTCue; /***/ }), -/***/ 324: +/***/ 360: /***/ (function(module, exports) { /** @@ -51703,7 +51703,7 @@ module.exports = VTTRegion; /***/ }), -/***/ 325: +/***/ 361: /***/ (function(module, exports, __webpack_require__) { // see https://tools.ietf.org/html/rfc1808 @@ -51873,7 +51873,7 @@ module.exports = VTTRegion; /***/ }), -/***/ 326: +/***/ 362: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53154,14 +53154,14 @@ function (_Stream) { /***/ }), -/***/ 327: +/***/ 363: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export VERSION */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return parseUTCTiming; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_global_window___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_global_window__); /*! @name mpd-parser @version 0.7.0 @license Apache-2.0 */ @@ -55004,11 +55004,11 @@ var parseUTCTiming = function parseUTCTiming(manifestString) { -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(5))) /***/ }), -/***/ 328: +/***/ 364: /***/ (function(module, exports) { var toUnsigned = function(value) { @@ -55022,22 +55022,22 @@ module.exports = { /***/ }), -/***/ 329: +/***/ 365: /***/ (function(module, exports, __webpack_require__) { module.exports = { - generator: __webpack_require__(290), - probe: __webpack_require__(274), - Transmuxer: __webpack_require__(277).Transmuxer, - AudioSegmentStream: __webpack_require__(277).AudioSegmentStream, - VideoSegmentStream: __webpack_require__(277).VideoSegmentStream, - CaptionParser: __webpack_require__(341) + generator: __webpack_require__(326), + probe: __webpack_require__(310), + Transmuxer: __webpack_require__(313).Transmuxer, + AudioSegmentStream: __webpack_require__(313).AudioSegmentStream, + VideoSegmentStream: __webpack_require__(313).VideoSegmentStream, + CaptionParser: __webpack_require__(377) }; /***/ }), -/***/ 330: +/***/ 366: /***/ (function(module, exports) { // Convert an array of nal units into an array of frames with each frame being @@ -55303,11 +55303,11 @@ module.exports = { /***/ }), -/***/ 331: +/***/ 367: /***/ (function(module, exports, __webpack_require__) { -var coneOfSilence = __webpack_require__(332); -var clock = __webpack_require__(333); +var coneOfSilence = __webpack_require__(368); +var clock = __webpack_require__(369); var ONE_SECOND_IN_TS = 90000; // 90kHz clock @@ -55456,7 +55456,7 @@ module.exports = { /***/ }), -/***/ 332: +/***/ 368: /***/ (function(module, exports) { var highPrefix = [33, 16, 5, 32, 164, 27]; @@ -55498,7 +55498,7 @@ module.exports = makeTable(coneOfSilence); /***/ }), -/***/ 333: +/***/ 369: /***/ (function(module, exports) { var @@ -55546,7 +55546,7 @@ module.exports = { /***/ }), -/***/ 334: +/***/ 370: /***/ (function(module, exports) { var ONE_SECOND_IN_TS = 90000; // 90kHz clock @@ -55654,7 +55654,7 @@ module.exports = { /***/ }), -/***/ 335: +/***/ 371: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55669,12 +55669,12 @@ module.exports = { * Media Source Extensions. */ -var Stream = __webpack_require__(269), - CaptionStream = __webpack_require__(291), - StreamTypes = __webpack_require__(271), - TimestampRolloverStream = __webpack_require__(293).TimestampRolloverStream; +var Stream = __webpack_require__(305), + CaptionStream = __webpack_require__(327), + StreamTypes = __webpack_require__(307), + TimestampRolloverStream = __webpack_require__(329).TimestampRolloverStream; -var m2tsStreamTypes = __webpack_require__(271); +var m2tsStreamTypes = __webpack_require__(307); // object types var TransportPacketStream, TransportParseStream, ElementaryStream; @@ -56167,7 +56167,7 @@ var m2ts = { TimestampRolloverStream: TimestampRolloverStream, CaptionStream: CaptionStream.CaptionStream, Cea608Stream: CaptionStream.Cea608Stream, - MetadataStream: __webpack_require__(336) + MetadataStream: __webpack_require__(372) }; for (var type in StreamTypes) { @@ -56181,7 +56181,7 @@ module.exports = m2ts; /***/ }), -/***/ 336: +/***/ 372: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56192,8 +56192,8 @@ module.exports = m2ts; */ var - Stream = __webpack_require__(269), - StreamTypes = __webpack_require__(271), + Stream = __webpack_require__(305), + StreamTypes = __webpack_require__(307), // return a percent-encoded representation of the specified byte range // @see http://en.wikipedia.org/wiki/Percent-encoding percentEncode = function(bytes, start, end) { @@ -56437,13 +56437,13 @@ module.exports = MetadataStream; /***/ }), -/***/ 337: +/***/ 373: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Stream = __webpack_require__(269); +var Stream = __webpack_require__(305); var AdtsStream; @@ -56577,14 +56577,14 @@ module.exports = AdtsStream; /***/ }), -/***/ 338: +/***/ 374: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Stream = __webpack_require__(269); -var ExpGolomb = __webpack_require__(339); +var Stream = __webpack_require__(305); +var ExpGolomb = __webpack_require__(375); var H264Stream, NalByteStream; var PROFILES_WITH_OPTIONAL_SPS_DATA; @@ -57030,7 +57030,7 @@ module.exports = { /***/ }), -/***/ 339: +/***/ 375: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57185,7 +57185,7 @@ module.exports = ExpGolomb; /***/ }), -/***/ 340: +/***/ 376: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57200,8 +57200,8 @@ module.exports = ExpGolomb; * Media Source Extensions. */ -var Stream = __webpack_require__(269); -var aacUtils = __webpack_require__(278); +var Stream = __webpack_require__(305); +var aacUtils = __webpack_require__(314); // Constants var AacStream; @@ -57314,7 +57314,7 @@ module.exports = AacStream; /***/ }), -/***/ 341: +/***/ 377: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57329,10 +57329,10 @@ module.exports = AacStream; */ -var discardEmulationPreventionBytes = __webpack_require__(292).discardEmulationPreventionBytes; -var CaptionStream = __webpack_require__(291).CaptionStream; -var probe = __webpack_require__(274); -var inspect = __webpack_require__(342); +var discardEmulationPreventionBytes = __webpack_require__(328).discardEmulationPreventionBytes; +var CaptionStream = __webpack_require__(327).CaptionStream; +var probe = __webpack_require__(310); +var inspect = __webpack_require__(378); /** * Maps an offset in the mdat to a sample based on the the size of the samples. @@ -57762,7 +57762,7 @@ module.exports = CaptionParser; /***/ }), -/***/ 342: +/***/ 378: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57781,7 +57781,7 @@ var inspectMp4, textifyMp4, - parseType = __webpack_require__(274).parseType, + parseType = __webpack_require__(310).parseType, parseMp4Date = function(seconds) { return new Date(seconds * 1000 - 2082844800000); }, @@ -58617,7 +58617,7 @@ module.exports = { /***/ }), -/***/ 343: +/***/ 379: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58631,11 +58631,11 @@ module.exports = { */ -var StreamTypes = __webpack_require__(271); -var handleRollover = __webpack_require__(293).handleRollover; +var StreamTypes = __webpack_require__(307); +var handleRollover = __webpack_require__(329).handleRollover; var probe = {}; -probe.ts = __webpack_require__(344); -probe.aac = __webpack_require__(278); +probe.ts = __webpack_require__(380); +probe.aac = __webpack_require__(314); var @@ -59131,7 +59131,7 @@ module.exports = { /***/ }), -/***/ 344: +/***/ 380: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59145,7 +59145,7 @@ module.exports = { */ -var StreamTypes = __webpack_require__(271); +var StreamTypes = __webpack_require__(307); var parsePid = function(packet) { var pid = packet[1] & 0x1f; @@ -59426,14 +59426,14 @@ module.exports = { /***/ }), -/***/ 345: +/***/ 381: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return decrypt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Decrypter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncStream; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pkcs7__ = __webpack_require__(346); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pkcs7__ = __webpack_require__(382); var classCallCheck = function (instance, Constructor) { @@ -60074,7 +60074,7 @@ var Decrypter = function () { /***/ }), -/***/ 346: +/***/ 382: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -60127,7 +60127,7 @@ var version = "1.0.2"; /***/ }), -/***/ 347: +/***/ 383: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60145,11 +60145,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _hotkeysModal = __webpack_require__(294); +var _hotkeysModal = __webpack_require__(330); var _hotkeysModal2 = _interopRequireDefault(_hotkeysModal); @@ -60235,7 +60235,7 @@ exports.default = HotkeysModalButton; /***/ }), -/***/ 348: +/***/ 384: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60249,11 +60249,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeBar = __webpack_require__(349); +var _rangeBar = __webpack_require__(385); var _rangeBar2 = _interopRequireDefault(_rangeBar); @@ -60329,7 +60329,7 @@ exports.default = RangeBarCollection; /***/ }), -/***/ 349: +/***/ 385: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60347,11 +60347,11 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _nouislider = __webpack_require__(350); +var _nouislider = __webpack_require__(386); var _nouislider2 = _interopRequireDefault(_nouislider); @@ -60495,7 +60495,7 @@ exports.default = RangeBar; /***/ }), -/***/ 350: +/***/ 386: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! nouislider - 9.2.0 - 2017-01-11 10:35:34 */ @@ -62650,7 +62650,7 @@ function closure ( target, options, originalOptions ){ /***/ }), -/***/ 351: +/***/ 387: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62672,13 +62672,13 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); -var _sortableComponent = __webpack_require__(352); +var _sortableComponent = __webpack_require__(388); var _sortableComponent2 = _interopRequireDefault(_sortableComponent); @@ -62822,7 +62822,7 @@ exports.default = RangeItem; /***/ }), -/***/ 352: +/***/ 388: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63103,7 +63103,7 @@ exports.default = SortableComponent; /***/ }), -/***/ 353: +/***/ 389: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63125,11 +63125,11 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _utils = __webpack_require__(279); +var _utils = __webpack_require__(315); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63573,7 +63573,7 @@ exports.default = RangeControlBar; /***/ }), -/***/ 354: +/***/ 390: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63828,7 +63828,7 @@ exports.hotkeys = hotkeys; /***/ }), -/***/ 355: +/***/ 391: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63850,11 +63850,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); -var _rangeCollection = __webpack_require__(295); +var _rangeCollection = __webpack_require__(331); var _rangeCollection2 = _interopRequireDefault(_rangeCollection); @@ -63954,23 +63954,23 @@ exports.default = RangeItemContainer; /***/ }), -/***/ 356: +/***/ 392: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 357: +/***/ 393: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* videojs-hotkeys v0.2.21 - https://github.com/ctd1500/videojs-hotkeys */ -!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(268)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){return t(e.default||e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), +!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(304)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){return t(e.default||e)}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):"undefined"!=typeof module&&module.exports?module.exports=t(require("video.js")):t(videojs)}(0,function(e){"use strict";"undefined"!=typeof window&&(window.videojs_hotkeys={version:"0.2.21"});(e.registerPlugin||e.plugin)("hotkeys",function(t){var r=this,n=r.el(),o=document,u={volumeStep:.1,seekStep:5,enableMute:!0,enableVolumeScroll:!0,enableFullscreen:!0,enableNumbers:!0,enableJogStyle:!1,alwaysCaptureHotkeys:!1,enableModifiersForNumbers:!0,enableInactiveFocus:!0,skipInitialFocus:!1,playPauseKey:function(e){return 32===e.which||179===e.which},rewindKey:function(e){return 37===e.which||177===e.which},forwardKey:function(e){return 39===e.which||176===e.which},volumeUpKey:function(e){return 38===e.which},volumeDownKey:function(e){return 40===e.which},muteKey:function(e){return 77===e.which},fullscreenKey:function(e){return 70===e.which},customKeys:{}},l=e.mergeOptions||e.util.mergeOptions,i=(t=l(u,t||{})).volumeStep,c=t.seekStep,a=t.enableMute,s=t.enableVolumeScroll,m=t.enableFullscreen,y=t.enableNumbers,f=t.enableJogStyle,v=t.alwaysCaptureHotkeys,d=t.enableModifiersForNumbers,p=t.enableInactiveFocus,b=t.skipInitialFocus;n.hasAttribute("tabIndex")||n.setAttribute("tabIndex","-1"),n.style.outline="none",!v&&r.autoplay()||b||r.one("play",function(){n.focus()}),p&&r.on("userinactive",function(){var e=function(){clearTimeout(t)},t=setTimeout(function(){r.off("useractive",e),o.activeElement.parentElement==n.querySelector(".vjs-control-bar")&&n.focus()},10);r.one("useractive",e)}),r.on("play",function(){var e=n.querySelector(".iframeblocker");e&&""===e.style.display&&(e.style.display="block",e.style.bottom="39px")});var h=function(e){if(r.controls()){var t=o.activeElement;if((v||t==n||t==n.querySelector(".vjs-tech")||t==n.querySelector(".iframeblocker")||t==n.querySelector(".vjs-control-bar"))&&s){e=window.event||e;var u=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));e.preventDefault(),1==u?r.volume(r.volume()+i):-1==u&&r.volume(r.volume()-i)}}},w=function(e,r){return t.playPauseKey(e,r)?1:t.rewindKey(e,r)?2:t.forwardKey(e,r)?3:t.volumeUpKey(e,r)?4:t.volumeDownKey(e,r)?5:t.muteKey(e,r)?6:t.fullscreenKey(e,r)?7:void 0};return r.on("keydown",function(e){var u,l,s=e.which,p=e.preventDefault,b=r.duration();if(r.controls()){var h=o.activeElement;if(v||h==n||h==n.querySelector(".vjs-tech")||h==n.querySelector(".vjs-control-bar")||h==n.querySelector(".iframeblocker"))switch(w(e,r)){case 1:p(),v&&e.stopPropagation(),r.paused()?r.play():r.pause();break;case 2:u=!r.paused(),p(),u&&r.pause(),l=r.currentTime()-c,r.currentTime()<=c&&(l=0),r.currentTime(l),u&&r.play();break;case 3:u=!r.paused(),p(),u&&r.pause(),(l=r.currentTime()+c)>=b&&(l=u?b-.001:b),r.currentTime(l),u&&r.play();break;case 5:p(),f?(l=r.currentTime()-1,r.currentTime()<=1&&(l=0),r.currentTime(l)):r.volume(r.volume()-i);break;case 4:p(),f?((l=r.currentTime()+1)>=b&&(l=b),r.currentTime(l)):r.volume(r.volume()+i);break;case 6:a&&r.muted(!r.muted());break;case 7:m&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen());break;default:if((s>47&&s<59||s>95&&s<106)&&(d||!(e.metaKey||e.ctrlKey||e.altKey))&&y){var k=48;s>95&&(k=96);var K=s-k;p(),r.currentTime(r.duration()*K*.1)}for(var S in t.customKeys){var F=t.customKeys[S];F&&F.key&&F.handler&&F.key(e)&&(p(),F.handler(r,t,e))}}}}),r.on("dblclick",function(e){if(r.controls()){var t=e.relatedTarget||e.toElement||o.activeElement;t!=n&&t!=n.querySelector(".vjs-tech")&&t!=n.querySelector(".iframeblocker")||m&&(r.isFullscreen()?r.exitFullscreen():r.requestFullscreen())}}),r.on("mousewheel",h),r.on("DOMMouseScroll",h),this})}); /***/ }), -/***/ 87: +/***/ 92: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63988,17 +63988,17 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _index = __webpack_require__(320); +var _index = __webpack_require__(356); var _index2 = _interopRequireDefault(_index); -var _video = __webpack_require__(268); +var _video = __webpack_require__(304); var _video2 = _interopRequireDefault(_video); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var hotkeys = __webpack_require__(357); +var hotkeys = __webpack_require__(393); // require('video.js').default; diff --git a/Phraseanet-production-client/dist/lazy-2.js b/Phraseanet-production-client/dist/lazy-2.js index c59a82e38e..2747403824 100644 --- a/Phraseanet-production-client/dist/lazy-2.js +++ b/Phraseanet-production-client/dist/lazy-2.js @@ -1,6 +1,6 @@ webpackJsonpapp([2],{ -/***/ 422: +/***/ 457: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -153,7 +153,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* /***/ }), -/***/ 423: +/***/ 458: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/ @@ -739,7 +739,7 @@ var widget = $.widget; /***/ }), -/***/ 424: +/***/ 459: /***/ (function(module, exports, __webpack_require__) { /*** IMPORTS FROM imports-loader ***/ @@ -969,7 +969,7 @@ var $ = __webpack_require__(0); /***/ }), -/***/ 425: +/***/ 460: /***/ (function(module, exports, __webpack_require__) { /*** IMPORTS FROM imports-loader ***/ @@ -1003,7 +1003,7 @@ var $ = __webpack_require__(0); // Node/CommonJS: factory( __webpack_require__(0), - __webpack_require__(426) + __webpack_require__(461) ); } else { // Browser globals: @@ -2464,7 +2464,7 @@ var $ = __webpack_require__(0); /***/ }), -/***/ 426: +/***/ 461: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28 @@ -3046,7 +3046,7 @@ var widget = $.widget; /***/ }), -/***/ 88: +/***/ 94: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3062,13 +3062,13 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var loadImage = __webpack_require__(422); +var loadImage = __webpack_require__(457); /* The jQuery UI widget factory, can be omitted if jQuery UI is already included */ -__webpack_require__(423); +__webpack_require__(458); /* The Iframe Transport is required for browsers without support for XHR file uploads */ -__webpack_require__(424); +__webpack_require__(459); /* The basic File Upload plugin */ -__webpack_require__(425); +__webpack_require__(460); /** * UPLOADER MANAGER diff --git a/Phraseanet-production-client/dist/lazy-2.min.js b/Phraseanet-production-client/dist/lazy-2.min.js index c59a82e38e..2747403824 100644 --- a/Phraseanet-production-client/dist/lazy-2.min.js +++ b/Phraseanet-production-client/dist/lazy-2.min.js @@ -1,6 +1,6 @@ webpackJsonpapp([2],{ -/***/ 422: +/***/ 457: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -153,7 +153,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* /***/ }), -/***/ 423: +/***/ 458: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/ @@ -739,7 +739,7 @@ var widget = $.widget; /***/ }), -/***/ 424: +/***/ 459: /***/ (function(module, exports, __webpack_require__) { /*** IMPORTS FROM imports-loader ***/ @@ -969,7 +969,7 @@ var $ = __webpack_require__(0); /***/ }), -/***/ 425: +/***/ 460: /***/ (function(module, exports, __webpack_require__) { /*** IMPORTS FROM imports-loader ***/ @@ -1003,7 +1003,7 @@ var $ = __webpack_require__(0); // Node/CommonJS: factory( __webpack_require__(0), - __webpack_require__(426) + __webpack_require__(461) ); } else { // Browser globals: @@ -2464,7 +2464,7 @@ var $ = __webpack_require__(0); /***/ }), -/***/ 426: +/***/ 461: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28 @@ -3046,7 +3046,7 @@ var widget = $.widget; /***/ }), -/***/ 88: +/***/ 94: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3062,13 +3062,13 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var loadImage = __webpack_require__(422); +var loadImage = __webpack_require__(457); /* The jQuery UI widget factory, can be omitted if jQuery UI is already included */ -__webpack_require__(423); +__webpack_require__(458); /* The Iframe Transport is required for browsers without support for XHR file uploads */ -__webpack_require__(424); +__webpack_require__(459); /* The basic File Upload plugin */ -__webpack_require__(425); +__webpack_require__(460); /** * UPLOADER MANAGER diff --git a/Phraseanet-production-client/dist/lazy-3.js b/Phraseanet-production-client/dist/lazy-3.js index b9d41b1824..7702ea9917 100644 --- a/Phraseanet-production-client/dist/lazy-3.js +++ b/Phraseanet-production-client/dist/lazy-3.js @@ -1,19 +1,19 @@ -webpackJsonpapp([3],Array(259).concat([ -/* 259 */ +webpackJsonpapp([3],Array(295).concat([ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var leaflet = __webpack_require__(358); +var leaflet = __webpack_require__(394); -__webpack_require__(359); +__webpack_require__(395); module.exports = leaflet; /***/ }), -/* 260 */ +/* 296 */ /***/ (function(module, exports) { /* @@ -27,7 +27,7 @@ module.exports = leaflet; L.DomEvent.off(this._container,"touchmove",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if("undefined"!=typeof t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if("touch"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var o=this._map.mouseEventToContainerPoint(i),n=this._map.mouseEventToLayerPoint(i),s=this._map.layerPointToLatLng(n);this._map.fire(e,{latlng:s,layerPoint:n,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&500>i||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){var e="touchstart";this._touchEvent(t,e)}},_onTouchEnd:function(t){if(this._map._loaded){var e="touchend";this._touchEvent(t,e)}},_onTouchCancel:function(t){if(this._map._loaded){var e="touchcancel";this._detectIE()&&(e="pointercancel"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){var e="touchleave";this._touchEvent(t,e)}},_onTouchMove:function(t){if(this._map._loaded){var e="touchmove";this._touchEvent(t,e)}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf("MSIE ");if(i>0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var o=e.indexOf("Trident/");if(o>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):!1}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e.concat(["touchcancel"]),L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var o=e.indexOf("Trident/");if(o>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):!1}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;o>i;i++)e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,n=0,s=L.LatLng.DEG_TO_RAD;if(o>2){for(var a=0;o>a;a++)e=t[a],i=t[(a+1)%o],n+=(i.lng-e.lng)*s*(2+Math.sin(e.lat*s)+Math.sin(i.lat*s));n=6378137*n*6378137/2}return Math.abs(n)},readableArea:function(t,e){var i;return e?i=t>=1e4?(1e-4*t).toFixed(2)+" ha":t.toFixed(2)+" m²":(t/=.836127,i=t>=3097600?(t/3097600).toFixed(2)+" mi²":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd²"),i},readableDistance:function(t,e,i){var o;if(e)o=t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m";else if(t*=1.09361,t>1760)o=(t/1760).toFixed(2)+" miles";else{var n=" yd";i&&(t=3*t,n=" ft"),o=Math.ceil(t)+n}return o}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._originalPoints,n=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=n-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return this._map?this.newPointIntersects(this._map.latLngToLayerPoint(t),e):!1},newPointIntersects:function(t,e){var i=this._originalPoints,o=i?i.length:0,n=i?i[o-1]:null,s=o-2;return this._tooFewPointsForIntersection(1)?!1:this._lineSegmentsIntersectsRange(n,t,s,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._originalPoints,i=e?e.length:0;return i+=t||0,!this._originalPoints||3>=i},_lineSegmentsIntersectsRange:function(t,e,i,o){var n,s,a=this._originalPoints;o=o||0;for(var r=i;r>o;r--)if(n=a[r-1],s=a[r],L.LineUtil.segmentsIntersect(t,e,n,s))return!0;return!1}}),L.Polygon.include({intersects:function(){var t,e,i,o,n,s=this._originalPoints;return this._tooFewPointsForIntersection()?!1:(t=L.Polyline.prototype.intersects.call(this))?!0:(e=s.length,i=s[0],o=s[e-1],n=e-2,this._lineSegmentsIntersectsRange(o,i,n,1))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,t);var e;this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),o=!1,n="leaflet-draw-toolbar-top";for(var s in this._toolbars)this._toolbars.hasOwnProperty(s)&&(e=this._toolbars[s].addToolbar(t),e&&(o||(L.DomUtil.hasClass(e,n)||L.DomUtil.addClass(e.childNodes[0],n),o=!0),i.appendChild(e)));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),o=0,n=this._toolbarClass||"",s=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;ee;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,o,n){var s=t.type;this._modes[s]={},this._modes[s].handler=t,this._modes[s].button=this._createButton({type:s,title:n,className:o+"-"+s,container:e,callback:this._modes[s].handler.enable,context:this._modes[s].handler}),this._modes[s].buttonIndex=i,this._modes[s].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container);return e.href="#",t.text&&(e.innerHTML=t.text),t.title&&(e.title=t.title),L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,"click",t.callback,t.context),e},_disposeButton:function(t,e){L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,"click",e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){var e,i,o,n,s=this._actionsContainer,a=this.getActions(t),r=a.length;for(i=0,o=this._actionButtons.length;o>i;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];s.firstChild;)s.removeChild(s.firstChild);for(var h=0;r>h;h++)"enabled"in a[h]&&!a[h].enabled||(e=L.DomUtil.create("li","",s),n=this._createButton({title:a[h].title,text:a[h].text,container:e,callback:a[h].callback,context:a[h].context}),this._actionButtons.push({button:n,callback:a[h].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block"},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom")}}),L.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?''+t.subtext+"
":"")+""+t.text+"",this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(i.style.visibility="inherit",L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){L.setOptions(this,t);for(var e in this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},featureGroup:null},initialize:function(t){t.edit&&("undefined"==typeof t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(){return[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}]},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=this.options.featureGroup,i=0!==e.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:editstart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:editstop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Tooltip(this._map),this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on("click",this._editStyle,this).on("draw:editvertex",this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer(function(e){e.edited&&(t.addLayer(e),e.edited=!1)}),this._map.fire("draw:edited",{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:t instanceof L.Marker&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):t instanceof L.Marker&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,i=t.layer||t.target||t;this._backupLayer(i),this.options.selectedPathOptions&&(e=L.Util.extend({},this.options.selectedPathOptions),e.maintainColor&&(e.color=i.options.color,e.fillColor=i.options.fillColor),i.options.original=L.extend({},i.options),i.options.editing=e),this.isMarker?(i.dragging.enable(),i.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):i.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:deletestart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:deletestop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire("draw:deleted",{layers:this._deletedLayers})},_enableLayerDelete:function(t){var e=t.layer||t.target||t;e.on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document); /***/ }), -/* 261 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -42,7 +42,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ var L; if (true) { // AMD - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(296)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(332)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -562,27 +562,27 @@ for (i = 0, l = classes.length; i < l; i++) { /***/ }), -/* 262 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var makeClient = __webpack_require__(267); -var xtend = __webpack_require__(316).extendMutable; -var getUser = __webpack_require__(315); -var MapboxGeocoding = __webpack_require__(394); -var MapboxSurface = __webpack_require__(395); -var MapboxDirections = __webpack_require__(396); -var MapboxUploads = __webpack_require__(397); -var MapboxMatching = __webpack_require__(398); -var MapboxDatasets = __webpack_require__(399); -var MapboxMatrix = __webpack_require__(401); -var MapboxTilestats = __webpack_require__(402); -var MapboxStyles = __webpack_require__(403); -var MapboxStatic = __webpack_require__(408); -var MapboxTilesets = __webpack_require__(411); -var MapboxTokens = __webpack_require__(412); +var makeClient = __webpack_require__(303); +var xtend = __webpack_require__(352).extendMutable; +var getUser = __webpack_require__(351); +var MapboxGeocoding = __webpack_require__(430); +var MapboxSurface = __webpack_require__(431); +var MapboxDirections = __webpack_require__(432); +var MapboxUploads = __webpack_require__(433); +var MapboxMatching = __webpack_require__(434); +var MapboxDatasets = __webpack_require__(435); +var MapboxMatrix = __webpack_require__(437); +var MapboxTilestats = __webpack_require__(438); +var MapboxStyles = __webpack_require__(439); +var MapboxStatic = __webpack_require__(444); +var MapboxTilesets = __webpack_require__(447); +var MapboxTokens = __webpack_require__(448); /** @@ -628,7 +628,7 @@ module.exports = MapboxClient; /***/ }), -/* 263 */ +/* 299 */ /***/ (function(module, exports) { /** @@ -891,23 +891,23 @@ if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { /***/ }), -/* 264 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const projectVersion = __webpack_require__(413).version; -const _ = __webpack_require__(414); -const EventEmitter = __webpack_require__(415); -const turfCircle = __webpack_require__(416); -const turfBbox = __webpack_require__(417); -const turfBboxPoly = __webpack_require__(418); -const turfTruncate = __webpack_require__(419); -const turfDestination = __webpack_require__(317); -const turfDistance = __webpack_require__(420); -const turfBearing = __webpack_require__(421); -const turfHelpers = __webpack_require__(273); +const projectVersion = __webpack_require__(449).version; +const _ = __webpack_require__(450); +const EventEmitter = __webpack_require__(93); +const turfCircle = __webpack_require__(451); +const turfBbox = __webpack_require__(452); +const turfBboxPoly = __webpack_require__(453); +const turfTruncate = __webpack_require__(454); +const turfDestination = __webpack_require__(353); +const turfDistance = __webpack_require__(455); +const turfBearing = __webpack_require__(456); +const turfHelpers = __webpack_require__(309); if (window && typeof window.MapboxCircle === 'function') { throw new TypeError('mapbox-gl-circle-' + window.MapboxCircle.VERSION + ' already loaded'); @@ -2263,14 +2263,14 @@ module.exports = exports = MapboxCircle; /***/ }), -/* 265 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { !function(t,e){ true?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.turf={})}(this,function(t){"use strict";function e(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&N(r),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");i&&N(i);var s;switch(t){case"Point":s=r(e).geometry;break;case"LineString":s=a(e).geometry;break;case"Polygon":s=o(e).geometry;break;case"MultiPoint":s=l(e).geometry;break;case"MultiLineString":s=h(e).geometry;break;case"MultiPolygon":s=p(e).geometry;break;default:throw new Error(t+" is invalid")}return i&&(s.bbox=i),s}function r(t,n,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(t[0])||!b(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map(function(t){return r(t,e)}),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function y(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function _(t,e){return v(y(t,e))}function m(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null===t||void 0===t)throw new Error("radians is required");return 180*(t%(2*Math.PI))/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return d(y(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=Bo[e||"meters"];if(!r)throw new Error("invalid original units");var i=Bo[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function b(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function N(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!b(t))throw new Error("bbox must only contain numbers")})}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function S(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,h,l=0,p=0,f=t.type,g="FeatureCollection"===f,d="Feature"===f,y=g?t.features.length:1,_=0;_t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&b(e[0])&&b(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function U(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return Y(e),e;throw new Error("No valid coordinates")}function Y(t){if(t.length>1&&b(t[0])&&b(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Y(t[0]);throw new Error("coordinates must only contain numbers")}function V(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function H(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function W(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0;r=0&&d>=0&&d=0;h--)if(Math.abs(e[h][0][0]-u)<=1e-7&&Math.abs(e[h][0][1]-c)<=1e-7){for(var l=s.path.length-2;l>=0;--l)e[h].unshift(s.path[l]);a=!0;break}a||(e[n++]=s.path)}})}),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o=e?8:0,a|=c>=e?4:0,a|=h>=e?2:0;var p=!1;if(5===(a|=l>=e?1:0)||10===a){var f=(u+c+h+l)/4;5===a&&fe?1:0};r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);it(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(ot(t,n,e),i(t[r],h)>0&&ot(t,n,r);l0;)p--}0===i(t[n],h)?ot(t,n,p):ot(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function ot(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function st(t,e){if(!(this instanceof st))return new st(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function at(t,e){ut(t,0,t.children.length,e,t)}function ut(t,e,n,r,i){i||(i=yt(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s=t.minX&&e.maxY>=t.minY}function yt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _t(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Yo(t,o,e,n,i),s.push(e,o,o,n))}function mt(t,e){return e={exports:{}},t(e,e.exports),e.exports}function vt(t,e){if(!(this instanceof vt))return new vt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return te?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function xt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;oo||a.push({node:h,dist:l})}for(;a.length&&!a.peek().node.children;){var p=a.pop(),f=p.node,g=St(f,e,n),d=St(f,r,i);if(p.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u0!=os(t,e,r)>0&&os(n,r,t)>0!=os(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function It(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Nt(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function Ct(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function St(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return o=t[0]-r,s=t[1]-i,o*o+s*s}function Mt(t,e,n,r,i,o,s,a){var u,c,h,l,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,m=p*p+f*f,v=p*g+f*d,x=g*g+d*d,E=p*y+f*_,w=g*y+d*_,b=m*x-v*v,I=b,N=b;0===b?(c=0,I=1,l=w,N=x):(l=m*w-v*E,(c=v*w-x*E)<0?(c=0,l=w,N=x):c>I&&(c=I,l=w+v,N=x)),l<0?(l=0,-E<0?c=0:-E>m?c=I:(c=-E,I=m)):l>N&&(l=N,-E+v<0?c=0:-E+v>m?c=I:(c=-E+v,I=m)),u=0===c?0:c/I;var C=(1-(h=0===l?0:l/N))*i+h*s-((1-u)*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return C*C+S*S}function Lt(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(S(t,function(t){r.push([t[0],t[1]])}),!r.length)return null;var i=ss(r,n);return i.length>3?o([i]):null}function Pt(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=X(t),o=U(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var u=0,c=!1;ut[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Rt(t,e){var n=[];return A(e,function(e){O(t,function(t){Pt(t,e)&&n.push(t)})}),c(n)}function Tt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Dt);var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;for(;a--;)t[a].yl&&(l=t[a].y);var p,f=c-u,g=l-h,d=f>g?f:g,y=.5*(c+u),_=.5*(l+h),m=[new At({x:y-20*d,y:_-d,__sentinel:!0},{x:y,y:_+20*d,__sentinel:!0},{x:y+20*d,y:_-d,__sentinel:!0})],v=[],x=[];a=t.length;for(;a--;){for(x.length=0,p=m.length;p--;)(f=t[a].x-m[p].x)>0&&f*f>m[p].r?(v.push(m[p]),m.splice(p,1)):(g=t[a].y-m[p].y,f*f+g*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1)));for(Ft(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new At(e,n,r))}Array.prototype.push.apply(v,m),a=v.length;for(;a--;)(v[a].a.__sentinel||v[a].b.__sentinel||v[a].c.__sentinel)&&v.splice(a,1);return v}(t.features.map(function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r})).map(function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)}))}function At(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),h=a*(t.x+n.x)+u*(t.y+n.y),l=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*h)/l,this.y=(o*h-a*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Dt(t,e){return e.x-t.x}function Ft(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],i=t[--r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function qt(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units,i=X(t),o=X(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return d(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r)}function Gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Bt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return Bt(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return zt(t);default:throw new Error("unknown GeoJSON type")}}function Bt(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=kt(t.properties),e.geometry=zt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:r.length?e[n]=r.map(function(t){return t}):e[n]=kt(r):e[n]=r}),e):e}function zt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return zt(t)}),e):(e.coordinates=jt(t.coordinates),e)}function jt(t){return"object"!=typeof t[0]?t.slice():t.map(function(t){return jt(t)})}function Xt(t,e){function n(t,e){e.length&&e.pop();for(var n=c[t<0?~t:t],r=0,i=n.length;r1)for(var s,a,u=1,c=i(r[0]);uc&&(a=r[0],r[0]=r[u],r[u]=a,c=s);return r})}}function Yt(t,e,n){for(var r,i=e+(n---e>>1);e=Math.abs(h)?c>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function ne(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function re(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return o=t.x-r,s=t.y-i,o*o+s*s}function ie(t,e,n,r,i){for(var o,s=r,a=e+1;as&&(o=a,s=u)}s>r&&(o-e>1&&ie(t,e,o,r,i),i.push(t[o]),n-o>1&&ie(t,o,n,r,i))}function oe(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;oe&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),t=function(t,e){var n=t.length-1,r=[t[0]];return ie(t,0,n,e,r),r.push(t[n]),r}(t,r)}function se(t,e,n){return oe(t.map(function(t){return{x:t[0],y:t[1],z:t[2]}}),e,n).map(function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]})}function ae(t,e,n){return t.map(function(t){var r=t.map(function(t){return{x:t[0],y:t[1]}});if(r.length<4)throw new Error("invalid polygon");for(var i=oe(r,e,n).map(function(t){return[t.x,t.y]});!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=oe(r,e-=.01*e,n).map(function(t){return[t.x,t.y]});return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i})}function ue(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!b(n))throw new Error("resolution must be an number");if(!b(r))throw new Error("sharpness must be an number");for(var i=[],o=new bs({points:J(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),duration:n,sharpness:r}),s=0;s=qt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function pe(t,e,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");var o=i.units,s=i.properties,a=X(t),u=x(a[0]),c=x(a[1]),h=x(n),l=y(e,o),p=Math.asin(Math.sin(c)*Math.cos(l)+Math.cos(c)*Math.sin(l)*Math.cos(h));return r([v(u+Math.atan2(Math.sin(h)*Math.sin(l)*Math.cos(c),Math.cos(l)-Math.sin(c)*Math.sin(p))),v(p)],s)}function fe(t,e,n){var r=(n=n||{}).steps||64,i=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");r=r||64,i=i||t.properties||{};for(var s=[],a=0;a=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=h&&i!==r.x&&Ne(on.x)&&Le(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=Pe(e,t);Ee(n,n.next)}}(c[i],n),n=Ee(n,n.next);return n}(t,e,o,n)),t.length>80*n){a=c=t[0],u=h=t[1];for(var g=n;gc&&(c=l),p>h&&(h=p);f=0!==(f=Math.max(c-a,h-u))?1/f:0}return we(o,s,n,a,u,f),s}function xe(t,e,n,r,i){var o,s;if(i===Ae(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Oe(o,t[o],t[o+1],s);return s&&Se(s,s.next)&&(Re(s),s=s.next),s}function Ee(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Se(r,r.next)&&0!==Ce(r.prev,r,r.next))r=r.next;else{if(Re(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function we(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ie(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ce(i,o,s)>=0)return!1;var a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=Ie(a,u,e,n,r),p=Ie(c,h,e,n,r),f=t.nextZ;for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.nextZ}f=t.prevZ;for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,r,i,o):function(t){var e=t.prev,n=t,r=t.next;if(Ce(e,n,r)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(Ne(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ce(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),Re(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?we(t=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Se(i,o)&&Me(i,r,r.next,o)&&Le(i,o)&&Le(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Re(r),Re(r.next),r=t=o),r=r.next}while(r!==t);return r}(t,e,n),e,n,r,i,o,2):2===s&&function(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Me(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Le(t,e)&&Le(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}(s,a)){var u=Pe(s,a);return s=Ee(s,s.next),u=Ee(u,u.next),we(s,e,n,r,i,o),void we(u,e,n,r,i,o)}a=a.next}s=s.next}while(s!==t)}(t,e,n,r,i,o):we(Ee(t),e,n,r,i,o,1);break}}}function be(t,e){return t.x-e.x}function Ie(t,e,n,r,i){return t=32767*(t-n)*i,e=32767*(e-r)*i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Ne(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Ce(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Se(t,e){return t.x===e.x&&t.y===e.y}function Me(t,e,n,r){return!!(Se(t,e)&&Se(n,r)||Se(t,r)&&Se(n,e))||Ce(t,e,n)>0!=Ce(t,e,r)>0&&Ce(n,r,t)>0!=Ce(n,r,e)>0}function Le(t,e){return Ce(t.prev,t,t.next)<0?Ce(t,e,t.next)>=0&&Ce(t,t.prev,e)>=0:Ce(t,e,t.prev)<0||Ce(t,t.next,e)<0}function Pe(t,e){var n=new Te(t.i,t.x,t.y),r=new Te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Oe(t,e,n,r){var i=new Te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Te(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ae(t,e,n,r){for(var i=0,o=e,s=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Is(e.vertices,e.holes,2),r=[],i=[];n.forEach(function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])});for(var s=0;se?1:0})}function Ge(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Ge(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(Be(t,n,e),i(t[r],h)>0&&Be(t,n,r);l0;)p--}0===i(t[n],h)?Be(t,n,p):Be(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function Be(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function ze(t,e){je(t,0,t.children.length,e,t)}function je(t,e,n,r,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ke(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(qe(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Qe(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}else t.bbox=t.bbox?t.bbox:tn(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach(function(t){var n=$e(t);n.bbox=t,e.push(n)}):O(t,function(t){t.bbox=t.bbox?t.bbox:tn(t),e.push(t)}),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:tn(t),{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function $e(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function tn(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]i?n:i,r>o?r:o]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}(t,e)}),c(e)}function nn(t,n){var r={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===n.type&&(n=e(n)),"Feature"===t.type&&"Feature"===n.type&&"LineString"===t.geometry.type&&"LineString"===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=rn(t,n);return o&&i.push(o),c(i)}var s=Qe();return s.load(en(n)),O(en(t),function(t){O(s.search(t),function(e){var n=rn(t,e);if(n){var o=U(n).join(",");r[o]||(r[o]=!0,i.push(n))}})}),c(i)}function rn(t,e){var n=U(t),i=U(e);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],f=(p-h)*(a-o)-(l-c)*(u-s),g=(l-c)*(s-h)-(p-h)*(o-c),d=(a-o)*(s-h)-(u-s)*(o-c);if(0===f)return null;var y=g/f,_=d/f;if(y>=0&&y<=1&&_>=0&&_<=1){return r([o+y*(a-o),s+y*(u-s)])}return null}function on(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=r([1/0,1/0],{dist:1/0}),s=0;return F(t,function(t){for(var i=U(t),u=0;u0&&((_=y.features[0]).properties.dist=qt(e,_,n),_.properties.location=s+qt(c,_,n)),c.properties.dist180?-(360-i):i}function an(t,e){var n=x(t[1]),r=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function un(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=X(t),o=X(e);o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0;return E(function(t,e,n){var r=n=void 0===n?Fo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),"meters",r)}function cn(t,e){return ln(t,"mercator",e)}function hn(t,e){return ln(t,"wgs84",e)}function ln(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&b(t[0])?t="mercator"===e?pn(t):fn(t):(!0!==r&&(t=Gt(t)),S(t,function(t){var n="mercator"===e?pn(t):fn(t);t[0]=n[0],t[1]=n[1]})),t}function pn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function fn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function gn(t,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):H(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):H(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return G(n,function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?qt(e,t,i):dn(e,t,i),a=m(!0!==o?ge(e,t):sn(e,t)),u=m(!0!==o?ge(e,n):sn(e,n)),c=Math.abs(a-u);if(c>90)return s;var h=(u+180)%360,l=m(!0!==o?ge(n,t):sn(n,t)),p=Math.abs(l-h);p>180&&(p=Math.abs(p-360));return p>90?!0!==o?qt(t,n,i):dn(t,n,i):!0!==o?s*Math.sin(x(c)):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=cn([t[0]+o,t[1]]),u=cn([e[0]+o,e[1]]),c=cn([n[0]+o,n[1]]),h=hn(function(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1],a=n[0],u=n[1],c=o-r,h=s-i,l=((a-r)*c+(u-i)*h)/(c*c+h*h);return[r+l*c,i+l*h]}(a,u,c));return 0!==o&&(h[0]-=o),un(s,h,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)}),o}function dn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=cn([t[0]+i,t[1]]),s=cn([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return E(Math.sqrt(u),"meters",r)}function yn(t){for(var n=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?c([e(t)]):c([t]);return t}(t),i=de(n),o=!1,s=0;!o&&s0){e+=Math.abs(En(t[0]));for(var n=1;n2){for(s=0;s=h&&l===i.length-1);l++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[l]),a(o);u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates)}if(h>=n)return(s=n-h)?(u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[l]),a(o));if(h>=e&&o.push(i[l]),l===i.length-1)return a(o);h+=qt(i[l],i[l+1],r)}return a(i[i.length-1])}function Nn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=X(t),o=U(e),s=0;s=Math.abs(f)?p>0?s<=i&&i<=u:u<=i&&i<=s:f>0?a<=o&&o<=c:c<=o&&o<=a;if("start"===r)return Math.abs(p)>=Math.abs(f)?p>0?s0?a=Math.abs(f)?p>0?s<=i&&i0?a<=o&&o=Math.abs(f)?p>0?s0?ae[0])&&(!(t[2]e[1])&&!(t[3] is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return S(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r=0==e}function Tn(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n1&&n.push(a(l)),c(n)}function Fn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return O(e,function(e){var i=on(e,t).properties.dist;ip&&g.push(pe(t,e,p,s).geometry.coordinates),a(g,h)}function Bn(t){var e=t%360;return e<0&&(e+=360),e}function kn(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,r=K(t),i=U(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return zn(i,n);case"MultiPolygon":var o=[];return i.forEach(function(t){o.push(zn(t,n))}),c(o);default:throw new Error("geom "+r+" not supported")}}function zn(t,e){return t.length>1?h(t,e):a(t[0],e)}function jn(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");r=void 0===r||r,i=void 0===i||i;switch(K(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach(function(t){o.push(U(Xn(t,{},r,i)))}),p(o,n)}return Xn(t,n,r,i)}function Xn(t,e,n,r){e=e||t.properties||{};var i=U(t),s=K(t);if(!i.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(i=Un(i)),o([i],e);case"MultiLineString":var u=[],c=0;return i.forEach(function(t){if(n&&(t=Un(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(j(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)}),o(u,e);default:throw new Error("geometry type "+s+" is not supported")}}function Un(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Yn(t,e,n){var r,i,o,s,a,u=t.length,c=Hn(t[0],e),h=[];for(n||(n=[]),r=1;re[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Wn(t,e){for(var n=[],r=0;r0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Jn(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Zn(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):function(t,e,n){var r,i;if(Kn(t)||Kn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Jn(t))return!!Jn(e)&&(t=Bs.call(t),e=Bs.call(e),Zn(t,e,n));if(Qn(t)){if(!Qn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r=0;r--)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r--)if(i=o[r],!Zn(t[i],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function Kn(t){return null===t||void 0===t}function Qn(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function $n(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.tolerance||0,i=[],o=Qe();o.load(en(t));var s;return G(e,function(t){var e=!1;O(o.search(t),function(n){if(!1===e){var i=U(t).sort(),o=U(n).sort();Zn(i,o)?(e=!0,s=s?tr(s,t):t):(0===r?Nn(i[0],n)&&Nn(i[1],n):on(n,i[0]).properties.dist<=r&&on(n,i[1]).properties.dist<=r)?(e=!0,s=s?tr(s,t):t):(0===r?Nn(o[0],t)&&Nn(o[1],t):on(t,o[0]).properties.dist<=r&&on(t,o[1]).properties.dist<=r)&&(s=s?tr(s,n):n)}}),!1===e&&s&&(i.push(s),s=void 0)}),s&&i.push(s),c(i)}function tr(t,e){var n=U(e),r=U(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Zn(n[0],i)?s.unshift(n[1]):Zn(n[0],o)?s.push(n[1]):Zn(n[1],i)?s.unshift(n[0]):Zn(n[1],o)&&s.push(n[0]),t}function er(t){var e=t%360;return e<0&&(e+=360),e}function nr(t,e,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var a=E(e,o,"meters"),u=X(t),c=function(t,e,n,r){r=void 0===r?Fo:Number(r);var i=e/r,o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),l=Math.abs(h)>1e-11?u/h:Math.cos(s),p=i*Math.sin(a)/l;return[(180*(o+p)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function rr(t,e,n,r,i,o){for(var s=0;s0?function(t,e,n){return ir(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return ir(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function ir(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function or(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=U(t),o=0,s=1;s0}function sr(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return A(t,function(t){sr(t,e)}),t;case"LineString":return ar(U(t),e),t;case"Polygon":return ur(U(t),e),t;case"MultiLineString":return U(t).forEach(function(t){ar(t,e)}),t;case"MultiPolygon":return U(t).forEach(function(t){ur(t,e)}),t;case"Point":case"MultiPoint":return t}}function ar(t,e){or(t)===e&&t.reverse()}function ur(t,e){or(t[0])!==e&&t[0].reverse();for(var n=1;ns?128:64,c|=ls?32:16,c|=ps?8:4;var g=+(c|=fs?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+l+p+f)/4;d=y>s?2:y0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var _,m,v,x,E,w,b,I;_=m=v=x=E=w=b=I=.5;var N=[];1===c?(v=1-lr(e,p,f),I=1-lr(e,h,f),N.push(Sa[c])):169===c?(v=lr(s,f,p),I=lr(s,f,h),N.push(Sa[c])):4===c?(w=1-lr(e,l,p),x=lr(e,f,p),N.push(Na[c])):166===c?(w=lr(s,p,l),x=1-lr(s,p,f),N.push(Na[c])):16===c?(E=lr(e,p,l),m=lr(e,h,l),N.push(Ia[c])):154===c?(E=1-lr(s,l,p),m=1-lr(s,l,h),N.push(Ia[c])):64===c?(b=lr(e,f,h),_=1-lr(e,l,h),N.push(La[c])):106===c?(b=1-lr(s,h,f),_=lr(s,h,l),N.push(La[c])):168===c?(x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Ca[c]),N.push(Sa[c])):2===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ca[c]),N.push(Sa[c])):162===c?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),N.push(Ca[c]),N.push(Sa[c])):8===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),N.push(Ia[c]),N.push(Na[c])):138===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):32===c?(E=lr(s,p,l),w=lr(e,p,l),_=lr(e,h,l),m=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):42===c?(I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Ma[c]),N.push(La[c])):128===c&&(I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ma[c]),N.push(La[c])),5===c?(w=1-lr(e,l,p),I=1-lr(e,h,f),N.push(Na[c])):165===c?(w=lr(s,p,l),I=lr(s,f,h),N.push(Na[c])):20===c?(x=lr(e,f,p),m=lr(e,h,l),N.push(Ca[c])):150===c?(x=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ca[c])):80===c?(E=lr(e,p,l),b=lr(e,f,h),N.push(Ia[c])):90===c?(E=1-lr(s,l,p),b=1-lr(s,h,f),N.push(Ia[c])):65===c?(v=1-lr(e,p,f),_=1-lr(e,l,h),N.push(Sa[c])):105===c?(v=lr(s,f,p),_=lr(s,h,l),N.push(Sa[c])):160===c?(E=lr(s,p,l),w=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):10===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):130===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):40===c?(x=lr(s,f,p),v=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Ca[c]),N.push(Sa[c])):101===c?(w=lr(s,p,l),_=lr(s,h,l),N.push(Na[c])):69===c?(w=1-lr(e,l,p),_=1-lr(e,l,h),N.push(Na[c])):149===c?(I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ma[c])):21===c?(I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ma[c])):86===c?(x=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ca[c])):84===c?(x=lr(e,f,p),b=lr(e,f,h),N.push(Ca[c])):89===c?(E=1-lr(s,l,p),v=lr(s,f,p),N.push(Sa[c])):81===c?(E=lr(e,p,l),v=1-lr(e,p,f),N.push(Sa[c])):96===c?(E=lr(s,p,l),w=lr(e,p,l),b=lr(e,f,h),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):74===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):24===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),m=lr(e,h,l),N.push(Ia[c]),N.push(Sa[c])):146===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Sa[c])):6===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Na[c]),N.push(Ca[c])):164===c?(w=lr(s,p,l),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Na[c]),N.push(Ca[c])):129===c?(v=1-lr(e,p,f),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Sa[c]),N.push(Ma[c])):41===c?(v=lr(s,f,p),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Sa[c]),N.push(Ma[c])):66===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):104===c?(x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Sa[c]),N.push(Pa[c])):144===c?(E=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(La[c])):26===c?(E=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(La[c])):36===c?(w=lr(s,p,l),x=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):134===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):9===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):161===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):37===c?(w=lr(s,p,l),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ma[c])):133===c?(w=1-lr(e,l,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ma[c])):148===c?(x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ca[c]),N.push(La[c])):22===c?(x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ca[c]),N.push(La[c])):82===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ia[c]),N.push(Sa[c])):88===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),N.push(Ia[c]),N.push(Sa[c])):73===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):97===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):145===c?(E=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Ma[c])):25===c?(E=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(Ma[c])):70===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):100===c?(w=lr(s,p,l),x=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):34===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):35===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c]),N.push(La[c])):136===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):153===c?(0===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c])):102===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(La[c])):155===c?(4===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ma[c])):103===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c])):152===c?(0===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ca[c]),N.push(Sa[c])):156===c?(4===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c]),N.push(La[c])):137===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):139===c?(4===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c])):98===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(La[c])):99===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):38===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):39===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c]),N.push(La[c])):85===c&&(E=1,w=0,x=1,v=0,I=0,b=1,_=0,m=1),(_<0||_>1||m<0||m>1||E<0||E>1||x<0||x>1||I<0||I>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+l+","+p+","+f+" "+d+" "+_+" "+m+" "+E+" "+w+" "+x+" "+v+" "+I+" "+b),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:_,topright:m,righttop:E,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:b,edges:N}}}}}return o}(t,e,n);return zs.polygons?(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach(function(t,r){t.forEach(function(t,i){if(void 0!==t){var o=Ra[t.cval](t);"object"==typeof o&&pr(o)?"object"==typeof o[0]&&pr(o[0])?"object"==typeof o[0][0]&&pr(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=t}):(o.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}(c)):(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o0){var a=t.cells[o][s],u=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Us?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Ys?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Us?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Ys?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Ys?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&js?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Ys?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&js?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&js?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&js?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Xs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Xs?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(a),c=null,h=s,l=o;null!==u&&i.push([u.p[0]+h,u.p[1]+l]);do{if(null===(c=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:switch(r){case 0:i=Na[c],s=ea[c],a=na[c],u=ra[c];break;default:i=Ia[c],s=Qs[c],a=$s[c],u=ta[c]}break;case 1:switch(r){case 0:i=Ma[c],s=fa[c],a=ga[c],u=da[c];break;default:i=La[c],s=ha[c],a=la[c],u=pa[c]}break;default:switch(n){case-1:switch(r){case 0:i=Pa[c],s=Vs[c],a=Hs[c],u=Ws[c];break;default:i=Oa[c],s=Js[c],a=Zs[c],u=Ks[c]}break;case 1:switch(r){case 0:i=Sa[c],s=ia[c],a=oa[c],u=sa[c];break;default:i=Ca[c],s=aa[c],a=ua[c],u=ca[c]}}}{if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;!function(t,e){delete t.edges[e];for(var n=e+1;n=n||h<0||h>=r||void 0===t.cells[l][h]){h-=c.x,l-=c.y;var p=function(t,e,n,r,i,o){var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,h=[],l=!1;for(;!l;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,s=t.cells[c][u],a=s.cval_real,-1===i)if(0===o)if(a&Ys)h.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Us)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Ys)){if(a&Us){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+s.bottomleft,c]),r=0,i=1,o=0,l=!0;break}h.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Xs)){if(a&js){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+s.topright,c+1]),r=0,i=-1,o=1,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}else h.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&js)){if(a&Ys){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+s.lefttop]),r=1,i=0,o=1,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: wtf");break}h.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&Us)){h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Us)){if(a&Xs){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else if(s=t.cells[c][u],a=s.cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Ys)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u,c])}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Xs)){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Us)){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&js)){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}}if(u+=r,c+=i,u===e&&c===n)break}return{path:h,i:u,j:c,x:r,y:i,o:o}}(t,h,l,c.x,c.y,c.o);if(null===p)break;p.path.forEach(function(t){i.push(t)}),h=p.i,l=p.j,u=p}}while(void 0!==t.cells[l][h]&&t.cells[l][h].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof zs.successCallback&&zs.successCallback(u),u}function lr(t,e,n){return(t-e)/(n-e)}function pr(t){return t.constructor.toString().indexOf("Array")>-1}function fr(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e?t:(r||(r=ye(t)),!1!==i&&void 0!==i||(t=Gt(t)),S(t,function(t){var n=sn(r,t)+e,i=un(r,t),o=U(nr(r,i,n));t[0]=o[0],t[1]=o[1]}),t)}function gr(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=Gt(t)),"FeatureCollection"!==t.type||o?dr(t,e,r):(O(t,function(n,i){t.features[i]=dr(n,e,r)}),t)}function dr(t,e,n){var i="Point"===K(t);return n=function(t,e){void 0!==e&&null!==e||(e="centroid");if(Array.isArray(e)||"object"==typeof e)return X(e);var n=t.bbox?t.bbox:j(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return r([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return r([s,o]);case"nw":case"northwest":case"westnorth":case"topleft":return r([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return r([s,a]);case"center":return de(t);case void 0:case null:case"centroid":return ye(t);default:throw new Error("invalid origin")}}(t,n),1===e||i?t:(S(t,function(t){var r=un(n,t),i=sn(n,t),o=U(nr(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),t)}function yr(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function _r(t,e){return t[0]*e[1]-e[0]*t[1]}function mr(t,e){return!function(t,e){return 0===_r(yr(t),yr(e))}(t,e)&&function(t,e){var n=t[0],r=yr(t),i=e[0],o=yr(e),s=_r(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(_r(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}function vr(t,e,n){var r=[],i=_(e,n),o=U(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r,s=t[1]+n*(t[0]-e[0])/r,a=e[1]+n*(t[0]-e[0])/r;return[[i,s],[o,a]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=mr(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),a(s,t.properties)}function xr(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function Er(t,e){return e.geometry.coordinates[0].every(function(e){return Pt(r(e),t)})}function wr(t,e){for(var n=0;n=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function br(t,e){return nn(e,kn(t)).features.length>0}function Ir(t,e){return!(t[0]>e[0])&&(!(t[2]e[1])&&!(t[3]0}function Mr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;s=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]0}function Ar(t,e,n){n=n||[];for(var r=0;r0)){if(o/=p,p<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>l)return;o>h&&(h=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=i-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>h&&(h=o)}else if(f>0){if(o0||l<1)||(h>0&&(t[0]=[u+h*p,c+h*f]),l<1&&(t[1]=[u+l*p,c+l*f]),!0)}}}}}function Kr(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,h=t.right,l=c[0],p=c[1],f=h[0],g=h[1],d=(l+f)/2,y=(p+g)/2;if(g===p){if(d=r)return;if(l>f){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]1)if(l>f){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]=-pu)){var f=u*u+c*c,g=h*h+l*l,d=(l*f-c*g)/p,y=(u*g-h*f)/p,_=cu.pop()||new function(){Xr(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=d+s,_.y=(_.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=_;for(var m=null,v=au._;v;)if(_.ylu)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return ai(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>lu)){r>-lu?(e=a.P,n=a):i>-lu?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){su[t.index]={site:t,halfedges:[]}}(t);var u=ri(t);if(ou.insert(e,u),e||n){if(e===n)return ni(e),n=ri(e.site),ou.insert(u,n),u.edge=n.edge=Hr(e.site,u.site),ei(e),void ei(n);if(n){ni(e),ni(n);var c=e.site,h=c[0],l=c[1],p=t[0]-h,f=t[1]-l,g=n.site,d=g[0]-h,y=g[1]-l,_=2*(p*y-f*d),m=p*p+f*f,v=d*d+y*y,x=[(y*m-f*v)/_+h,(p*v-d*m)/_+l];Jr(n.edge,c,g,x),u.edge=Hr(c,t,null,x),n.edge=Hr(t,g,null,x),ei(e),ei(n)}else u.edge=Hr(e.site,u.site)}}function ai(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var h=a-r,l=1/o-1/c,p=h/c;return l?(-p+Math.sqrt(p*p-2*l*(h*h/(-2*c)-u+c/2+i-o/2)))/l+r:(r+a)/2}function ui(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function ci(t,e){return e[1]-t[1]||e[0]-t[0]}function hi(t,e){var n,r,i,o=t.sort(ci).pop();for(uu=[],su=new Array(t.length),ou=new jr,au=new jr;;)if(i=iu,o&&(!i||o[1]lu||Math.abs(i[0][1]-i[1][1])>lu)||delete uu[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y=su.length,_=!0;for(i=0;ilu||Math.abs(d-p)>lu)&&(u.splice(a,0,uu.push(Wr(s,f,Math.abs(g-t)lu?[t,Math.abs(l-t)lu?[Math.abs(p-r)lu?[n,Math.abs(l-n)lu?[Math.abs(p-e)=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),"degrees"===s){var _=d*Math.cos(l)+y*Math.sin(l),m=y*Math.cos(l)-d*Math.sin(l);d=_,y=m}p.push([d+h[0],y+h[1]])}return p.push(p[0]),"degrees"===s?o([p],c):fr(o([p],c),a,{pivot:u})}function fi(t){var e=t*Math.PI/180;return Math.tan(e)}function gi(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,s=0,a=0;return A(t,function(t,e,n){var r=n[i];if(r=void 0===r||null===r?1:r,!b(r))throw new Error("weight value must be a number for feature index "+e);(r=Number(r))>0&&S(t,function(t){o+=t[0]*r,s+=t[1]*r,a+=r})}),r([o/a,s/a],n)}function di(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,function(e){var n=e.properties.weight,r=void 0===n||null===n?1:n;if(r=Number(r),!b(r))throw new Error("weight value must be a number");if(r>0){c+=1;var i=r*qt(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}}),c<1)throw new Error("no features to measure");var h=s/u,l=a/u;return 1===c||0===i||Math.abs(h-e[0])0?t+n[e-1]:t}),h.forEach(function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])}),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(_i(n))),s.push(o([u]))}return c(s)}function xi(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;void 0!==t&&null!==t||(t=1),(!b(r)||r<2)&&(r=10),b(i)||(i=1e-4),b(o)||(o=Math.PI/8);for(var s=[],u=0;u1?t:null;case"MultiPolygon":var e=[];if(F(t,function(t){mn(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}function Yi(){this.reset()}function Vi(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Hi(t){return t>1?kf:t<-1?-kf:Math.asin(t)}function Wi(){}function Ji(t,e){t&&eg.hasOwnProperty(t.type)&&eg[t.type](t,e)}function Zi(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++iBf?t-jf:t<-Bf?t+jf:t,e]}function so(t,e,n){return(t%=jf)?e||n?rg(uo(t),co(e,n)):uo(t):e||n?co(e,n):oo}function ao(t){return function(e,n){return e+=t,[e>Bf?e-jf:e<-Bf?e+jf:e,n]}}function uo(t){var e=ao(t);return e.invert=ao(-t),e}function co(t,e){function n(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*r+a*i;return[Hf(u*o-h*s,a*r-c*i),Hi(h*o+u*s)]}var r=Wf(t),i=Kf(t),o=Wf(e),s=Kf(e);return n.invert=function(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*o-u*s;return[Hf(u*o+c*s,a*r+h*i),Hi(h*r-a*i)]},n}function ho(t,e){(e=$i(e))[0]-=t,io(e);var n=function(t){return t>1?0:t<-1?Bf:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+jf-Gf)%jf}function lo(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function po(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0)do{c.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==l);else c.point(o[0],o[1])}function s(r,i){return Yf(r[0]-t)0?0:3:Yf(r[0]-n)0?2:1:Yf(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t,e){i(t,e)&&E.point(t,e)}function c(o,s){var a=i(o,s);if(l&&p.push([o,s]),v)f=o,g=s,d=a,v=!1,a&&(E.lineStart(),E.point(o,s));else if(a&&m)E.point(o,s);else{var u=[y=Math.max(pg,Math.min(lg,y)),_=Math.max(pg,Math.min(lg,_))],c=[o=Math.max(pg,Math.min(lg,o)),s=Math.max(pg,Math.min(lg,s))];sg(u,c,t,e,n,r)?(m||(E.lineStart(),E.point(u[0],u[1])),E.point(c[0],c[1]),a||E.lineEnd(),x=!1):a&&(E.lineStart(),E.point(o,s),x=!1)}y=o,_=s,m=a}var h,l,p,f,g,d,y,_,m,v,x,E=s,w=og(),b={point:u,lineStart:function(){b.point=c,l&&l.push(p=[]),v=!0,m=!1,y=_=NaN},lineEnd:function(){h&&(c(f,g),d&&m&&w.rejoin(),h.push(w.result())),b.point=u,m&&E.lineEnd()},polygonStart:function(){E=w,h=[],l=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=x&&e,i=(h=hg(h)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ug(h,a,e,o,s),s.polygonEnd()),E=s,h=l=p=null}};return b}}function go(t){return t.length>1}function yo(t,e){return((t=t.x)[0]<0?t[1]-kf-Gf:kf-t[1])-((e=e.x)[0]<0?e[1]-kf-Gf:kf-e[1])}function _o(t){return function(e){var n=new mo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function mo(){}function vo(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),ng(n,t.stream(vg));var s=vg.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function xo(t){return function(t){function e(t){return t=c(t[0]*Uf,t[1]*Uf),[t[0]*d+s,a-t[1]*d]}function n(t,e){return t=o(t,e),[t[0]*d+s,a-t[1]*d]}function r(){c=rg(u=so(x,E,w),o);var t=o(m,v);return s=y-t[0]*d,a=_+t[1]*d,i()}function i(){return f=g=null,e}var o,s,a,u,c,h,l,p,f,g,d=150,y=480,_=250,m=0,v=0,x=0,E=0,w=0,b=null,I=Eg,N=null,C=gg,S=.5,M=Ng(n,S);e.stream=function(t){return f&&g===t?f:f=Cg(I(u,M(C(g=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?wg(b=t*Uf,6*Uf):(b=null,Eg),i()):b*Xf},e.clipExtent=function(t){return arguments.length?(C=null==t?(N=h=l=p=null,gg):fo(N=+t[0][0],h=+t[0][1],l=+t[1][0],p=+t[1][1]),i()):null==N?null:[[N,h],[l,p]]},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(y=+t[0],_=+t[1],r()):[y,_]},e.center=function(t){return arguments.length?(m=t[0]%360*Uf,v=t[1]%360*Uf,r()):[m*Xf,v*Xf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Uf,E=t[1]%360*Uf,w=t.length>2?t[2]%360*Uf:0,r()):[x*Xf,E*Xf,w*Xf]},e.precision=function(t){return arguments.length?(M=Ng(n,S=t*t),i()):Qf(S)},e.fitExtent=function(t,n){return vo(e,t,n)},e.fitSize=function(t,n){return function(t,e,n){return vo(t,[[0,0],e],n)}(e,t,n)};return function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=c.invert((t[0]-s)/d,(a-t[1])/d))&&[t[0]*Xf,t[1]*Xf]},r()}}(function(){return t})()}function Eo(t,e){return[t,Zf($f((kf+e)/2))]}function wo(t,e){return[Zf($f((kf+e)/2)),-t]}function bo(t,n,r,i){var o=t.properties||{},s="Feature"===t.type?t.geometry:t;if("GeometryCollection"===s.type){var a=[];return A(t,function(t){var e=bo(t,n,r,i);e&&a.push(e)}),c(a)}var u,h=j(t),l=h[1]>50&&h[3]>50;u=l?{type:s.type,coordinates:No(s.coordinates,So(s))}:cn(s);var p=(new bh).read(u),f=d(y(n,r),"meters"),g=gp.bufferOp(p,f);if(g=(new Ih).write(g),!Io(g.coordinates)){var _;return(_=l?{type:g.type,coordinates:Co(g.coordinates,So(s))}:hn(g)).geometry?_:e(_,o)}}function Io(t){return Array.isArray(t[0])?Io(t[0]):isNaN(t[0])}function No(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return No(t,e)})}function Co(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return Co(t,e)})}function So(t){var e=de(t).geometry.coordinates.reverse(),n=e.map(function(t){return-t});return Sg().center(e).rotate(n).scale(Fo)}function Mo(){for(var t=new bh,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n=0&&(void 0===i||sm/2;P&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var D=[],F=0;F<=C;F++)for(var q=0;q<=M;q++){var G=F%2==1;if((0!==q||!G)&&(0!==q||!P)){var B=F*E+a-S,k=q*w+u+L;if(G&&(k-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([B,k],g/2,d/2,r,O,R).forEach(function(t){s?Lo(s,t)&&D.push(t):D.push(t)});else{var z=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],h=t[1]+n*s[u];a.push([c,h])}return a.push(a[0].slice()),o([a],r)}([B,k],g/2,d/2,r,O,R);s?Lo(s,z)&&D.push(z):D.push(z)}}}return c(D)}function Ro(t){if(t.features.length<=1)return t;var e=function(t){var e=Vo(),n=[];return F(t,function(t,e){var r=j(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})}),e.load(n),e}(t),n=[],r={};return F(t,function(t,i){if(r[i])return!0;for(e.remove({index:i},To),r[i]=!0;;){var o=j(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map(function(t){return r[t.index]=!0,e.remove({index:t.index},To),t.geojson});a.push(t),t=Mo.apply(this,a)}if(0===s.length)break}n.push(t)}),c(n)}function To(t,e){return t.index===e.index}function Ao(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=Math.floor(d/f),m=(d-_*f)/2,v=a+(g-y*p)/2,x=0;x=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=yt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,at(n,this.toBBox),at(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=yt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,at(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=ut(t,0,r,this.toBBox),o=ut(t,r,n,this.toBBox)),a=pt(i)+pt(o),s=e;i--)o=t.children[i],ct(u,t.leaf?s(o):o),c+=ft(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)ct(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():at(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Ho=function(t,e,n){var r=t*e,i=Wo*t,o=i-(i-t),s=t-o,a=Wo*e,u=a-(a-e),c=e-u,h=s*c-(r-o*u-s*u-o*c);return n?(n[0]=h,n[1]=r,n):[h,r]},Wo=+(Math.pow(2,27)+1),Jo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=n+r,a=new Array(s),u=0,c=0,h=0,l=Math.abs,p=t[c],f=l(p),g=e[h],d=l(g);f=r?(i=p,(c+=1)=r?(i=p,(c+=1)>1;return["sum(",r(t.slice(0,e)),",",r(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],s=0;s0){if(o<=0)return s;r=i+o}else{if(!(i<0))return s;if(o>=0)return s;r=-(i+o)}var u=3.3306690738754716e-16*r;return s>=u||s<=-u?s:a(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],a=t[1]-r[1],c=e[1]-r[1],h=n[1]-r[1],l=t[2]-r[2],p=e[2]-r[2],f=n[2]-r[2],g=o*h,d=s*c,y=s*a,_=i*h,m=i*c,v=o*a,x=l*(g-d)+p*(y-_)+f*(m-v),E=7.771561172376103e-16*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(p)+(Math.abs(m)+Math.abs(v))*Math.abs(f));return x>E||-x>E?x:u(t,e,n,r)}];!function(){for(;c.length<=s;)c.push(o(c.length));for(var e=[],n=["slow"],r=0;r<=s;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=s;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i1&&es(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&es(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var h=0,l=(r=0,o.length);r0;--p)n[h++]=s[p];return n},es=$o[3],ns=vt,rs=vt;vt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}},ns.default=rs;var is=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;or!=h>r&&n<(c-a)*(r-u)/(h-u)+a&&(i=!i)}return i},os=$o[3],ss=xt,as=xt;ss.default=as;var us=function(t){return t},cs=function(t){if(null==t)return us;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,h=new Array(c);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)break;h=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e>7^_s[2]^_s[3])},vs=function(t){function e(t,e,n,r){if(p[n]!==t){p[n]=t;var i=f[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else f[n]=e,g[n]=r}}function n(t){return ms(u[t])}function r(t,e){return gs(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,h=t.rings,l=function(){for(var t=fs(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;ea&&(a=e),nu&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach(r)}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach(r)},Polygon:function(t){t.arcs.forEach(r)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var h in t)e(t[h]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Vt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*f),Math.round((t[1]-h)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,l=t.length,p=new Array(l);++at&&(e.push(r),n=i)}return e},bs.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},bs.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])};var Is=ve,Ns=ve;ve.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ae(t,0,o,n));if(i)for(var a=0,u=e.length;a0&&(r+=t[i-1].length,n.holes.push(r))}return n},Is.default=Ns,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Je(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Ze(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ze(n,this.toBBox),ze(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ze(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=je(t,0,r,this.toBBox),o=je(t,r,n,this.toBBox)),a=Ve(i)+Ve(o),s=e;i--)o=t.children[i],Xe(u,t.leaf?s(o):o),c+=He(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)Xe(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ze(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Cs=Object.freeze({toMercator:cn,toWgs84:hn}),Ss=6378137,Ms=function(t,e,n){function r(t,n,r,i){var u=o[t][n],c=o[t][n+1],h=o[r][i],l=o[r][i+1],p=function(t,e,n,r){if(On(t,n)||On(t,r)||On(e,n)||On(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],c=n[1],h=r[0],l=r[1],p=(i-s)*(c-l)-(o-a)*(u-h);return 0===p?null:[((i*a-o*s)*(u-h)-(i-s)*(u*l-c*h))/p,((i*a-o*s)*(c-l)-(o-a)*(u*l-c*h))/p]}(u,c,h,l);if(null!==p){var f,g;if(f=c[0]!==u[0]?(p[0]-u[0])/(c[0]-u[0]):(p[1]-u[1])/(c[1]-u[1]),g=l[0]!==h[0]?(p[0]-h[0])/(l[0]-h[0]):(p[1]-h[1])/(l[1]-h[1]),!(f>=1||f<=0||g>=1||g<=0)){var d=p,y=!a[d];y&&(a[d]=!0),e?s.push(e(p,t,n,u,c,f,r,i,h,l,g,y)):s.push(p)}}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]1)for(e=0;ey[e.isect].coord?-1:1});for(f=[];N.length>0;){var P=N.pop(),O=P.isect,R=P.parent,T=P.winding,A=f.length,D=[y[O].coord],F=O;if(y[O].ringAndEdge1Walkable)var q=y[O].ringAndEdge1,G=y[O].nxtIsectAlongRingAndEdge1;else q=y[O].ringAndEdge2,G=y[O].nxtIsectAlongRingAndEdge2;for(;!Tn(y[O].coord,y[G].coord);){D.push(y[G].coord);var B=void 0;for(a=0;ap&&(d>h&&gh&&du&&(u=y)}var _=[];if(a&&u0&&Math.abs(x-n[v-1][0])>p){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(E>-180&&E-180&&n[v-1][0]h&&E<180&&-180===b&&v+1h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(Eh){var N=E;E=b,b=N;var C=w;w=I,I=C}if(E>h&&b=180&&Eh?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;P=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xr(t.coordinates,r.coordinates,i.coordinates);if(o<0)return 1;if(o>0)return-1;return Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},Ta.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Ta.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Ta.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Aa=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Aa.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Aa(this.to,this.from),this.symetric.symetric=this),this.symetric},Aa.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Aa.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Aa.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Aa.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},Aa.prototype.compareTo=function(t){return xr(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Da=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Fa={length:{configurable:!0}};Da.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Da.prototype.get=function(t){return this.edges[t]},Fa.length.get=function(){return this.edges.length},Da.prototype.forEach=function(t){this.edges.forEach(t)},Da.prototype.map=function(t){return this.edges.map(t)},Da.prototype.some=function(t){return this.edges.some(t)},Da.prototype.isValid=function(){return!0},Da.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xr(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},Da.prototype.toMultiPoint=function(){return l(this.edges.map(function(t){return t.from.coordinates}))},Da.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Da.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=he(this.toPolygon())},Da.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach(function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map(function(t){return t[0]}),r=t.geometry.coordinates.map(function(t){return t[1]}),i=e.geometry.coordinates.map(function(t){return t[0]}),o=e.geometry.coordinates.map(function(t){return t[1]});return Math.max(null,n)===Math.max(null,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&Er(s,o)){var a=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)})});a&&e.inside(r(a))&&(i&&!Er(n,s)||(i=e))}}),i},Da.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Da.prototype,Fa);var qa=function(){this.edges=[],this.nodes={}};qa.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new qa;return F(t,function(t){H(t,"LineString","Graph::fromGeoJson"),M(t,function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n})}),e},qa.prototype.getNode=function(t){var e=Ta.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ta(t)),n},qa.prototype.addEdge=function(t,e){var n=new Aa(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},qa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},qa.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},qa.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},qa.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},qa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},qa.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},qa.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},qa.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},qa.prototype._findEdgeRing=function(t){var e=t,n=new Da;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},qa.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},qa.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()};var Ga=mt(function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports="function"==typeof Object.keys?Object.keys:n).shim=n}),Ba=(Ga.shim,mt(function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r})),ka=(Ba.supported,Ba.unsupported,mt(function(t){function e(t){return null===t||void 0===t}function n(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ba(t))return!!Ba(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a=0;a--)if(c[a]!=h[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}})),za=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Rr};za.prototype.compare=function(t,e){if(t.type!==e.type||!Or(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=Pr(t),i=Pr(e);return r.every(function(t){return this.some(function(e){return n.compare(t,e)})},i)}}return!1},za.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},za.prototype.comparePath=function(t,e){var n=this;return t.every(function(t,e){return n.compareCoord(t,this[e])},e)},za.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every(function(t){return this.some(function(e){return i.compareLine(t,e,1,!0)})},r)}return!1},za.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},za.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},za.prototype.removePseudo=function(t){return t};var ja=za,Xa=mt(function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;ri&&(n=r):e=this.minPts)return n}},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r0;r.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length0,s=t[Math.floor(Math.random()*i)];o&&s.join("_");for(r.push(s);r.length0,f=[];if(n)i="kmrand"==n?Qa(t,e):"kmpp"==n?$a(t,e):n;else for(var g={};i.length0;){var u=s.pop();if(u===n)return Fr(u);u.closed=!0;for(var c=t.neighbors(u),h=0,l=c.length;h0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=a)return null;var u=t-i.site[0],c=e-i.site[1],h=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],l=u*u+c*c;le.x?1:this.ye.y?1:0},bu.prototype.clone=function(){},bu.prototype.copy=function(){return new bu(this)},bu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},bu.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},bu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},bu.prototype.hashCode=function(){var t=17;return t=37*t+bu.hashCode(this.x),t=37*t+bu.hashCode(this.y)},bu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},bu.prototype.interfaces_=function(){return[xu,Eu,Li]},bu.prototype.getClass=function(){return bu},bu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=mu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Iu.DimensionalComparator.get=function(){return Nu},Iu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Iu.NULL_ORDINATE.get=function(){return mu.NaN},Iu.X.get=function(){return 0},Iu.Y.get=function(){return 1},Iu.Z.get=function(){return 2},Object.defineProperties(bu,Iu);var Nu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _u("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Nu.prototype.compare=function(t,e){var n=t,r=e,i=Nu.compare(n.x,r.x);if(0!==i)return i;var o=Nu.compare(n.y,r.y);if(0!==o)return o;if(this._dimensionsToTest<=2)return 0;return Nu.compare(n.z,r.z)},Nu.prototype.interfaces_=function(){return[wu]},Nu.prototype.getClass=function(){return Nu},Nu.compare=function(t,e){return te?1:mu.isNaN(t)?mu.isNaN(e)?0:-1:mu.isNaN(e)?1:0};var Cu=function(){};Cu.prototype.create=function(){},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu};var Su=function(){},Mu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Su.prototype.interfaces_=function(){return[]},Su.prototype.getClass=function(){return Su},Su.toLocationSymbol=function(t){switch(t){case Su.EXTERIOR:return"e";case Su.BOUNDARY:return"b";case Su.INTERIOR:return"i";case Su.NONE:return"-"}throw new _u("Unknown location value: "+t)},Mu.INTERIOR.get=function(){return 0},Mu.BOUNDARY.get=function(){return 1},Mu.EXTERIOR.get=function(){return 2},Mu.NONE.get=function(){return-1},Object.defineProperties(Su,Mu);var Lu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Pu=function(){},Ou={LOG_10:{configurable:!0}};Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu},Pu.log10=function(t){var e=Math.log(t);return mu.isInfinite(e)?e:mu.isNaN(e)?e:e/Pu.LOG_10},Pu.min=function(t,e,n,r){var i=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},Pu.wrap=function(t,e){return t<0?e- -t%e:t%e},Pu.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},Pu.average=function(t,e){return(t+e)/2},Ou.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pu,Ou);var Ru=function(t){this.str=t};Ru.prototype.append=function(t){this.str+=t},Ru.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Ru.prototype.toString=function(t){return this.str};var Tu=function(t){this.value=t};Tu.prototype.intValue=function(){return this.value},Tu.prototype.compareTo=function(t){return this.valuet?1:0},Tu.isNaN=function(t){return Number.isNaN(t)};var Au=function(){};Au.isWhitespace=function(t){return t<=32&&t>=0||127===t},Au.toUpperCase=function(t){return t.toUpperCase()};var Du=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},Fu={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Du.prototype.le=function(t){return(this._hi9?(h=!0,l="9"):l="0"+c,s.append(l),n=n.subtract(Du.valueOf(c)).multiply(Du.TEN),h&&n.selfAdd(Du.TEN);var p=!0,f=Du.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Du.prototype.sqr=function(){return this.multiply(this)},Du.prototype.doubleValue=function(){return this._hi+this._lo},Du.prototype.subtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Du.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Du.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Du.prototype.selfSubtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},Du.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Du.prototype.min=function(t){return this.le(t)?this:t},Du.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,h=null,l=null;return u=this._hi/n,c=Du.SPLIT*u,i=c-u,l=Du.SPLIT*n,i=c-i,o=u-i,s=l-n,h=u*n,s=l-s,a=n-s,l=i*s-h+i*a+o*s+o*a,c=(this._hi-h-l+this._lo-u*r)/n,l=u+c,this._hi=l,this._lo=u-l+c,this}},Du.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Du.prototype.divide=function(){if(arguments[0]instanceof Du){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;n=(o=this._hi/t._hi)-(e=(s=Du.SPLIT*o)-(e=s-o)),u=e*(r=(u=Du.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi;return new Du(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return mu.isNaN(c)?Du.createNaN():Du.copy(this).selfDivide(c,0)}},Du.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Du.prototype.pow=function(t){if(0===t)return Du.valueOf(1);var e=new Du(this),n=Du.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},Du.prototype.ceil=function(){if(this.isNaN())return Du.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Du(t,e)},Du.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},Du.prototype.rint=function(){if(this.isNaN())return this;return this.add(.5).floor()},Du.prototype.setValue=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Du.prototype.max=function(t){return this.ge(t)?this:t},Du.prototype.sqrt=function(){if(this.isZero())return Du.valueOf(0);if(this.isNegative())return Du.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Du.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Du.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return i=this._hi+e,s=i-this._hi,o=i-s,o=e-s+(this._hi-o),a=o+this._lo,n=i+a,r=a+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],h=null,l=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,l=this._lo+c,g=f-(d=f-this._hi),p=l-(y=l-this._lo);var _=(h=f+(d=(g=u-d+(this._hi-g))+l))+(d=(p=c-y+(this._lo-p))+(d+(f-h))),m=d+(h-_);return this._hi=_,this._lo=m,this}},Du.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=Du.SPLIT*this._hi)-this._hi,c=Du.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var h=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),l=c+(i=u-h);return this._hi=h,this._lo=l,this}},Du.prototype.selfSqr=function(){return this.selfMultiply(this)},Du.prototype.floor=function(){if(this.isNaN())return Du.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Du(t,e)},Du.prototype.negate=function(){return this.isNaN()?this:new Du(-this._hi,-this._lo)},Du.prototype.clone=function(){},Du.prototype.multiply=function(){if(arguments[0]instanceof Du){var t=arguments[0];return t.isNaN()?Du.createNaN():Du.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return mu.isNaN(e)?Du.createNaN():Du.copy(this).selfMultiply(e,0)}},Du.prototype.isNaN=function(){return mu.isNaN(this._hi)},Du.prototype.intValue=function(){return Math.trunc(this._hi)},Du.prototype.toString=function(){var t=Du.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},Du.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+Du.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Du.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Du.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=Du.SPLIT*i)-(t=o-i)),n=(a=Du.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new Du(u,i-u+o)},Du.prototype.toSciNotation=function(){if(this.isZero())return Du.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=Du.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},Du.prototype.abs=function(){return this.isNaN()?Du.NaN:this.isNegative()?this.negate():new Du(this)},Du.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},Du.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},Du.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Du.prototype.trunc=function(){return this.isNaN()?Du.NaN:this.isPositive()?this.floor():this.ceil()},Du.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Du.prototype.interfaces_=function(){return[Li,xu,Eu]},Du.prototype.getClass=function(){return Du},Du.sqr=function(t){return Du.valueOf(t).selfMultiply(t)},Du.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return Du.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new Du(e)}},Du.sqrt=function(t){return Du.valueOf(t).sqrt()},Du.parse=function(t){for(var e=0,n=t.length;Au.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var c=t.charAt(e);if(e++,Au.isDigit(c)){var h=c-"0";o.selfMultiply(Du.TEN),o.selfAdd(h),s++}else{if("."!==c){if("e"===c||"E"===c){var l=t.substring(e);try{u=Tu.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var g=Du.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=Du.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},Du.createNaN=function(){return new Du(mu.NaN,mu.NaN)},Du.copy=function(t){return new Du(t)},Du.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},Du.stringOfChar=function(t,e){for(var n=new Ru,r=0;r0){if(o<=0)return qu.signum(s);r=i+o}else{if(!(i<0))return qu.signum(s);if(o>=0)return qu.signum(s);r=-i-o}var a=qu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?qu.signum(s):2},qu.signum=function(t){return t>0?1:t<0?-1:0},Gu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(qu,Gu);var Bu=function(){},ku={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ku.X.get=function(){return 0},ku.Y.get=function(){return 1},ku.Z.get=function(){return 2},ku.M.get=function(){return 3},Bu.prototype.setOrdinate=function(t,e,n){},Bu.prototype.size=function(){},Bu.prototype.getOrdinate=function(t,e){},Bu.prototype.getCoordinate=function(){},Bu.prototype.getCoordinateCopy=function(t){},Bu.prototype.getDimension=function(){},Bu.prototype.getX=function(t){},Bu.prototype.clone=function(){},Bu.prototype.expandEnvelope=function(t){},Bu.prototype.copy=function(){},Bu.prototype.getY=function(t){},Bu.prototype.toCoordinateArray=function(){},Bu.prototype.interfaces_=function(){return[Eu]},Bu.prototype.getClass=function(){return Bu},Object.defineProperties(Bu,ku);var zu=function(){},ju=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zu),Xu=function(){};Xu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;st._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy)}},Yu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Yu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Yu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Yu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Yu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Yu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Yu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Yu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Yu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof bu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Yu.prototype.centre=function(){return this.isNull()?null:new bu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Yu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Yu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Yu.prototype.hashCode=function(){var t=17;return t=37*t+bu.hashCode(this._minx),t=37*t+bu.hashCode(this._maxx),t=37*t+bu.hashCode(this._miny),t=37*t+bu.hashCode(this._maxy)},Yu.prototype.interfaces_=function(){return[xu,Li]},Yu.prototype.getClass=function(){return Yu},Yu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(c>u)&&(!(hu)&&!(hthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ec.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ec.prototype.setPrecisionModel=function(t){this._precisionModel=t},ec.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return tc.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},ec.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return tc.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nc.DONT_INTERSECT.get=function(){return 0},nc.DO_INTERSECT.get=function(){return 1},nc.COLLINEAR.get=function(){return 2},nc.NO_INTERSECTION.get=function(){return 0},nc.POINT_INTERSECTION.get=function(){return 1},nc.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ec,nc);var rc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Yu(this._inputLines[0][0],this._inputLines[0][1]),n=new Yu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,Yu.intersects(n,r,e)&&0===sc.orientationIndex(n,r,e)&&0===sc.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Uu.intersection(t,n,r,i)}catch(s){if(!(s instanceof ju))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new bu(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&Xu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new bu(t),o=new bu(e),s=new bu(n),a=new bu(r),u=new bu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Yu.intersects(e,n,r),s=Yu.intersects(e,n,i),a=Yu.intersects(r,i,e),u=Yu.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.xr.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(ah?s:h)+(u0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=sc.orientationIndex(r,i,e),u=sc.orientationIndex(r,i,n);if(a>0&&u>0||a<0&&u<0)return t.NO_INTERSECTION;return 0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new bu(r):0===s?this._intPt[0]=new bu(i):0===a?this._intPt[0]=new bu(e):0===u&&(this._intPt[0]=new bu(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=sc.distancePointLine(t,n,r),s=sc.distancePointLine(e,n,r);return s0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if(s=Math.floor(n/t),n-=s*t,(r-=s*e)<0)return-i;if(r>e)return i;if(t>n+n){if(er+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if(s=Math.floor(t/n),t-=s*n,(e-=s*r)<0)return i;if(e>r)return-i;if(n>t+t){if(re+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var oc=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};oc.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ic.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},oc.prototype.isPointInPolygon=function(){return this.getLocation()!==Su.EXTERIOR},oc.prototype.getLocation=function(){return this._isPointOnSegment?Su.BOUNDARY:this._crossingCount%2==1?Su.INTERIOR:Su.EXTERIOR},oc.prototype.isOnSegment=function(){return this._isPointOnSegment},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.locatePointInRing=function(){if(arguments[0]instanceof bu&&Lu(arguments[1],Bu)){for(var t=arguments[0],e=arguments[1],n=new oc(t),r=new bu,i=new bu,o=1;o1||a<0||a>1)&&(i=!0)}}else i=!0;return i?Pu.min(sc.distancePointLine(t,n,r),sc.distancePointLine(e,n,r),sc.distancePointLine(n,t,e),sc.distancePointLine(r,t,e)):0},sc.isPointInRing=function(t,e){return sc.locatePointInRing(t,e)!==Su.EXTERIOR},sc.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new bu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;sn.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=sc.computeOrientation(u,n,c),l=!1;return l=0===h?u.x>c.x:h>0,l},sc.locatePointInRing=function(t,e){return oc.locatePointInRing(t,e)},sc.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},sc.computeOrientation=function(t,e,n){return sc.orientationIndex(t,e,n)},sc.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _u("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return o.distance(a);var h=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(h)*Math.sqrt(u)}},sc.isOnLine=function(t,e){for(var n=new rc,r=1;r0},yc.prototype.interfaces_=function(){return[fc]},yc.prototype.getClass=function(){return yc};var _c=function(){};_c.prototype.isInBoundary=function(t){return t>1},_c.prototype.interfaces_=function(){return[fc]},_c.prototype.getClass=function(){return _c};var mc=function(){};mc.prototype.isInBoundary=function(t){return 1===t},mc.prototype.interfaces_=function(){return[fc]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.add=function(){},vc.prototype.addAll=function(){},vc.prototype.isEmpty=function(){},vc.prototype.iterator=function(){},vc.prototype.size=function(){},vc.prototype.toArray=function(){},vc.prototype.remove=function(){};var xc=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,n),e}(Error),Ec=function(){};Ec.prototype.hasNext=function(){},Ec.prototype.next=function(){},Ec.prototype.remove=function(){};var wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vc);(Pi.prototype=new Error).name="NoSuchElementException";var bc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vc]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ic(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new xc;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1){if(this.get(this.size()-1).equals2D(i))return null}t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c=0;h--)this.add(a[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(l>0){if(this.get(l-1).equals2D(p))return null}if(l_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new bu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bc),Cc=function(){},Sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Sc.ForwardComparator.get=function(){return Mc},Sc.BidirectionalComparator.get=function(){return Lc},Sc.coordArrayType.get=function(){return new Array(0).fill(null)},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Cc.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},Cc.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},Cc.extract=function(t,e,n){e=Pu.clamp(e,0,t.length);var r=(n=Pu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Cc.compare(n,r);return Cc.isEqualReversed(n,r)?0:i},Lc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Cc.increasingDirection(n),o=Cc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},Gi.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Ac,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:Ac,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Gi.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Ai(t)===Fi(Ai(Ai(t)))){var e=qi(Ai(Ai(t)));1===Ti(e)?(Di(Ai(t),Ac),Di(e,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===qi(Ai(t))&&(t=Ai(t),this.rotateLeft(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateRight(Ai(Ai(t))))}else{var n=Fi(Ai(Ai(t)));1===Ti(n)?(Di(Ai(t),Ac),Di(n,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===Fi(Ai(t))&&(t=Ai(t),this.rotateRight(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateLeft(Ai(Ai(t))))}this.root_.color=Ac},Gi.prototype.values=function(){var t=new bc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Gi.successor(e));)t.add(e.value);return t},Gi.prototype.entrySet=function(){var t=new Rc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Gi.successor(e));)t.add(e);return t},Gi.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},Gi.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},Gi.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Gi.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},Gi.prototype.size=function(){return this.size_};var Dc=function(){};Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Bi.prototype=new Ri,(ki.prototype=new Bi).contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(Vc.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wc.ensureValidRing=function(t,e){var n=e.size();if(0===n)return e;if(n<=3)return Wc.createClosedRing(t,e,4);return e.getOrdinate(0,Bu.X)===e.getOrdinate(n-1,Bu.X)&&e.getOrdinate(0,Bu.Y)===e.getOrdinate(n-1,Bu.Y)?e:Wc.createClosedRing(t,e,n+1)},Wc.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wc.copy(e,0,r,0,i);for(var o=i;o0&&Wc.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gc.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return sc.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();Wc.reverse(t);return this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Jc),nh=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return cc.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},sh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},sh.prototype.getClass=function(){return sh};var ah=function(){};ah.prototype.edit=function(t,e){return t instanceof eh?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jc?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kc?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ah.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},ah.prototype.getClass=function(){return ah};var uh=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new Ru(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(r=3),r<2?new uh(n):new uh(n,r)}},hh.prototype.interfaces_=function(){return[Cu,Li]},hh.prototype.getClass=function(){return hh},hh.instance=function(){return hh.instanceObject},lh.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},lh.instanceObject.get=function(){return new hh},Object.defineProperties(hh,lh);var ph=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bc,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Rc;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Pc),fh=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof dh){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},gh={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fh.prototype.equals=function(t){if(!(t instanceof fh))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fh.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Tu(n).compareTo(new Tu(r))},fh.prototype.getScale=function(){return this._scale},fh.prototype.isFloating=function(){return this._modelType===fh.FLOATING||this._modelType===fh.FLOATING_SINGLE},fh.prototype.getType=function(){return this._modelType},fh.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fh.FLOATING?t="Floating":this._modelType===fh.FLOATING_SINGLE?t="Floating-Single":this._modelType===fh.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fh.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];if(mu.isNaN(t))return t;if(this._modelType===fh.FLOATING_SINGLE){return t}return this._modelType===fh.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof bu){var e=arguments[0];if(this._modelType===fh.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fh.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fh.FLOATING?t=16:this._modelType===fh.FLOATING_SINGLE?t=6:this._modelType===fh.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fh.prototype.setScale=function(t){this._scale=Math.abs(t)},fh.prototype.interfaces_=function(){return[Li,xu]},fh.prototype.getClass=function(){return fh},fh.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},gh.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},gh.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fh,gh);var dh=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},yh={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dh.prototype.readResolve=function(){return dh.nameToTypeMap.get(this._name)},dh.prototype.toString=function(){return this._name},dh.prototype.interfaces_=function(){return[Li]},dh.prototype.getClass=function(){return dh},yh.serialVersionUID.get=function(){return-552860263173159e4},yh.nameToTypeMap.get=function(){return new ph},Object.defineProperties(dh,yh),fh.Type=dh,fh.FIXED=new dh("FIXED"),fh.FLOATING=new dh("FLOATING"),fh.FLOATING_SINGLE=new dh("FLOATING SINGLE");var _h=function t(){this._precisionModel=new fh,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Lu(arguments[0],Cu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fh&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},mh={serialVersionUID:{configurable:!0}};_h.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new bu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new bu(t.getMinX(),t.getMinY()),new bu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new bu(t.getMinX(),t.getMinY()),new bu(t.getMinX(),t.getMaxY()),new bu(t.getMaxX(),t.getMaxY()),new bu(t.getMaxX(),t.getMinY()),new bu(t.getMinX(),t.getMinY())]),null)},_h.prototype.createLineString=function(t){return t?t instanceof Array?new Jc(this.getCoordinateSequenceFactory().create(t),this):Lu(t,Bu)?new Jc(t,this):void 0:new Jc(this.getCoordinateSequenceFactory().create([]),this)},_h.prototype.createMultiLineString=function(){if(0===arguments.length)return new Xc(null,this);if(1===arguments.length){var t=arguments[0];return new Xc(t,this)}},_h.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(_h.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof $c)return this.createMultiPolygon(_h.toPolygonArray(t));if(a instanceof Jc)return this.createMultiLineString(_h.toLineStringArray(t));if(a instanceof Kc)return this.createMultiPoint(_h.toPointArray(t));tc.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_h.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_h.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Lu(arguments[0],Bu)){var e=arguments[0];return new Kc(e,this)}}},_h.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_h.prototype.createPolygon=function(){if(0===arguments.length)return new $c(null,null,this);if(1===arguments.length){if(Lu(arguments[0],Bu)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof eh){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new $c(r,i,this)}},_h.prototype.getSRID=function(){return this._SRID},_h.prototype.createGeometryCollection=function(){if(0===arguments.length)return new jc(null,this);if(1===arguments.length){var t=arguments[0];return new jc(t,this)}},_h.prototype.createGeometry=function(t){return new rh(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_h.prototype.getPrecisionModel=function(){return this._precisionModel},_h.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Lu(arguments[0],Bu)){var e=arguments[0];return new eh(e,this)}}},_h.prototype.createMultiPolygon=function(){if(0===arguments.length)return new nh(null,this);if(1===arguments.length){var t=arguments[0];return new nh(t,this)}},_h.prototype.createMultiPoint=function(){if(0===arguments.length)return new th(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new th(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(Lu(arguments[0],Bu)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[t]},Xi.prototype.push=function(t){return this.array_.push(t),t},Xi.prototype.pop=function(t){if(0===this.array_.length)throw new ji;return this.array_.pop()},Xi.prototype.peek=function(){if(0===this.array_.length)throw new ji;return this.array_[this.array_.length-1]},Xi.prototype.empty=function(){return 0===this.array_.length},Xi.prototype.isEmpty=function(){return this.empty()},Xi.prototype.search=function(t){return this.array_.indexOf(t)},Xi.prototype.size=function(){return this.array_.length},Xi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===sc.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Sh.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Nh.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Sh.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Sh.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}tc.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;this.getRightmostSide(this._minDe,this._minIndex)===Nh.LEFT&&(this._orientedDe=this._minDe.getSym())},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var Mh=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new bu(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Qu),Lh=function(){this.array_=[]};Lh.prototype.addLast=function(t){this.array_.push(t)},Lh.prototype.removeFirst=function(){return this.array_.shift()},Lh.prototype.isEmpty=function(){return 0===this.array_.length};var Ph=function(){this._finder=null,this._dirEdgeList=new bc,this._nodes=new bc,this._rightMostCoord=null,this._env=null,this._finder=new Sh};Ph.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},Ph.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ph.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Mh("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ph.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Nh.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ph.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ph.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Nh.RIGHT)>=1&&e.getDepth(Nh.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ph.prototype.computeDepths=function(t){var e=new Rc,n=new Lh,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Ph.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Ph.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Yu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[Nh.ON]=this.location[Nh.ON],e[Nh.LEFT]=Su.NONE,e[Nh.RIGHT]=Su.NONE,this.location=e}for(var n=0;n1&&t.append(Su.toLocationSymbol(this.location[Nh.LEFT])),t.append(Su.toLocationSymbol(this.location[Nh.ON])),this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.RIGHT])),t.toString()},Oh.prototype.setLocations=function(t,e,n){this.location[Nh.ON]=t,this.location[Nh.LEFT]=e,this.location[Nh.RIGHT]=n},Oh.prototype.get=function(t){return t1},Oh.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Th.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;a--)this._pts.add(r[a])}},Th.prototype.isHole=function(){return this._isHole},Th.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Th.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!sc.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},Th.prototype.addHole=function(t){this._holes.add(t)},Th.prototype.isShell=function(){return null===this._shell},Th.prototype.getLabel=function(){return this._label},Th.prototype.getEdges=function(){return this._edges},Th.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Th.prototype.getShell=function(){return this._shell},Th.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=e.getLocation(n,Nh.RIGHT);if(r===Su.NONE)return null;if(this._label.getLocation(n)===Su.NONE)return this._label.setLocation(n,r),null}},Th.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Th.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},Fh.prototype.isInResult=function(){return this._isInResult},Fh.prototype.isVisited=function(){return this._isVisited},Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh};var qh=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Rh(0,Su.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=Su.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Su.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Rh(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Rh)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===Su.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=Su.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Su.BOUNDARY:n=Su.INTERIOR;break;case Su.INTERIOR:default:n=Su.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fh),Gh=function(){this.nodeMap=new Gi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Gh.prototype.find=function(t){return this.nodeMap.get(t)},Gh.prototype.addNode=function(){if(arguments[0]instanceof bu){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof qh){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Gh.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Gh.prototype.iterator=function(){return this.nodeMap.values().iterator()},Gh.prototype.values=function(){return this.nodeMap.values()},Gh.prototype.getBoundaryNodes=function(t){for(var e=new bc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Su.BOUNDARY&&e.add(r)}return e},Gh.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var Bh=function(){},kh={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.isNorthern=function(t){return t===Bh.NE||t===Bh.NW},Bh.isOpposite=function(t,e){if(t===e)return!1;return 2===(t-e+4)%4},Bh.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=te?t:e)?3:n},Bh.isInHalfPlane=function(t,e){return e===Bh.SE?t===Bh.SE||t===Bh.SW:t===e||t===e+1},Bh.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _u("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Bh.NE:Bh.SE:e>=0?Bh.NW:Bh.SW}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _u("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Bh.NE:Bh.SE:r.y>=n.y?Bh.NW:Bh.SW}},kh.NE.get=function(){return 0},kh.NW.get=function(){return 1},kh.SW.get=function(){return 2},kh.SE.get=function(){return 3},Object.defineProperties(Bh,kh);var zh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};zh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Yh.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},Yh.prototype.buildMaximalEdgeRings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Dh(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Yh.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Yh.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Yh.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),h=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var l=!1;h.contains(r)&&sc.isPointInRing(i,c.getCoordinates())&&(l=!0),l&&(null===o||s.contains(h))&&(o=u)}return o},Yh.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return tc.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Yh.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Uh.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Yh.prototype.interfaces_=function(){return[]},Yh.prototype.getClass=function(){return Yh};var Vh=function(){};Vh.prototype.getBounds=function(){},Vh.prototype.interfaces_=function(){return[]},Vh.prototype.getClass=function(){return Vh};var Hh=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Hh.prototype.getItem=function(){return this._item},Hh.prototype.getBounds=function(){return this._bounds},Hh.prototype.interfaces_=function(){return[Vh,Li]},Hh.prototype.getClass=function(){return Hh};var Wh=function(){this._size=null,this._items=null,this._size=0,this._items=new bc,this._items.add(null)};Wh.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Wh.prototype.size=function(){return this._size},Wh.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Wh.prototype.clear=function(){this._size=0,this._items.clear()},Wh.prototype.isEmpty=function(){return 0===this._size},Wh.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Jh=function(){};Jh.prototype.visitItem=function(t){},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Zh=function(){};Zh.prototype.insert=function(t,e){},Zh.prototype.remove=function(t,e){},Zh.prototype.query=function(){},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh};var Kh=function(){if(this._childBoundables=new bc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qh={serialVersionUID:{configurable:!0}};Kh.prototype.getLevel=function(){return this._level},Kh.prototype.size=function(){return this._childBoundables.size()},Kh.prototype.getChildBoundables=function(){return this._childBoundables},Kh.prototype.addChildBoundable=function(t){tc.isTrue(null===this._bounds),this._childBoundables.add(t)},Kh.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Kh.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Kh.prototype.interfaces_=function(){return[Vh,Li]},Kh.prototype.getClass=function(){return Kh},Qh.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Kh,Qh);var $h=function(){};$h.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$h.min=function(t){return $h.sort(t),t.get(0)},$h.sort=function(t,e){var n=t.toArray();e?qc.sort(n,e):qc.sort(n);for(var r=t.iterator(),i=0,o=n.length;itl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _u("neither boundable is composite")},tl.prototype.isLeaves=function(){return!(tl.isComposite(this._boundable1)||tl.isComposite(this._boundable2))},tl.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tl.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tl(o,e,this._itemDistance);s.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};el.prototype.getNodeCapacity=function(){return this._nodeCapacity},el.prototype.lastNode=function(t){return t.get(t.size()-1)},el.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Kh?t+=this.size(n):n instanceof Hh&&(t+=1)}return t}},el.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Hh&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},el.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bc:t}if(1===arguments.length){for(var e=arguments[0],n=new bc,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Kh){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Hh?n.add(i.getItem()):tc.shouldNeverReachHere()}return n.size()<=0?null:n}},el.prototype.insert=function(t,e){tc.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Hh(t,e))},el.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(tc.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Kh?this.boundablesAtLevel(n,s,i):(tc.isTrue(s instanceof Hh),-1===n&&i.add(s))}return null}},el.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bc;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;ut&&(t=r)}}return t+1}},el.prototype.createParentBoundables=function(t,e){tc.isTrue(!t.isEmpty());var n=new bc;n.add(this.createNode(e));var r=new bc(t);$h.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},el.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},el.prototype.interfaces_=function(){return[Li]},el.prototype.getClass=function(){return el},el.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new bc,r=0;r0;){var l=h.poll(),p=l.getDistance();if(p>=u)break;l.isLeaves()?(u=p,c=l):l.expandToQueue(h,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],y=new Hh(f,g),_=new tl(this.getRoot(),y,d);return this.nearestNeighbour(_)[0]}},e.prototype.interfaces_=function(){return[Zh,Li]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return sl},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(el),sl=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Yu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Kh),al=function(){};al.prototype.interfaces_=function(){return[]},al.prototype.getClass=function(){return al},al.relativeSign=function(t,e){return te?1:0},al.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=al.relativeSign(e.x,n.x),i=al.relativeSign(e.y,n.y);switch(t){case 0:return al.compareValue(r,i);case 1:return al.compareValue(i,r);case 2:return al.compareValue(i,-r);case 3:return al.compareValue(-r,i);case 4:return al.compareValue(-r,-i);case 5:return al.compareValue(-i,-r);case 6:return al.compareValue(-i,r);case 7:return al.compareValue(r,-i)}return tc.shouldNeverReachHere("invalid octant value"),0},al.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ul=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new bu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ul.prototype.getCoordinate=function(){return this.coord},ul.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ul.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:al.compare(this._segmentOctant,this.coord,e.coord)},ul.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ul.prototype.isInterior=function(){return this._isInterior},ul.prototype.interfaces_=function(){return[xu]},ul.prototype.getClass=function(){return ul};var cl=function(){this._nodeMap=new Gi,this._edge=null;var t=arguments[0];this._edge=t};cl.prototype.getSplitCoordinates=function(){var t=new Nc;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cl.prototype.addCollapsedNodes=function(){var t=new bc;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},cl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _u("Cannot compute the octant for two identical points "+i);return hl.octant(s,a)}};var ll=function(){};ll.prototype.getCoordinates=function(){},ll.prototype.size=function(){},ll.prototype.getCoordinate=function(t){},ll.prototype.isClosed=function(){},ll.prototype.setData=function(t){},ll.prototype.getData=function(){},ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll};var pl=function(){};pl.prototype.addIntersection=function(t,e){},pl.prototype.interfaces_=function(){return[ll]},pl.prototype.getClass=function(){return pl};var fl=function(){this._nodeList=new cl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fl.prototype.getCoordinates=function(){return this._pts},fl.prototype.size=function(){return this._pts.length},fl.prototype.getCoordinate=function(t){return this._pts[t]},fl.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fl.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fl.prototype.setData=function(t){this._data=t},fl.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hl.octant(t,e)},fl.prototype.getData=function(){return this._data},fl.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new bu(n.getIntersection(i));this.addIntersection(o,r)}},fl.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},fl.prototype.getNodeList=function(){return this._nodeList},fl.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof bu){var r=arguments[0];return sc.orientationIndex(this.p0,this.p1,r)}},gl.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gl.prototype.isVertical=function(){return this.p0.x===this.p1.x},gl.prototype.equals=function(t){if(!(t instanceof gl))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gl.prototype.intersection=function(t){var e=new rc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gl.prototype.project=function(){if(arguments[0]instanceof bu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new bu(t);var e=this.projectionFactor(t),n=new bu;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gl){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gl(s,a)}},gl.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gl.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gl.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gl.prototype.distancePerpendicular=function(t){return sc.distancePointLinePerpendicular(t,this.p0,this.p1)},gl.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gl.prototype.midPoint=function(){return gl.midPoint(this.p0,this.p1)},gl.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return mu.NaN;return((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gl.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=mu.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))0&&e<1)return this.project(t);return this.p0.distance(t)1||mu.isNaN(e))&&(e=1),e},gl.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gl.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gl.prototype.distance=function(){if(arguments[0]instanceof gl){var t=arguments[0];return sc.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof bu){var e=arguments[0];return sc.distancePointLine(e,this.p0,this.p1)}},gl.prototype.pointAlong=function(t){var e=new bu;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gl.prototype.hashCode=function(){var t=mu.doubleToLongBits(this.p0.x);t^=31*mu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=mu.doubleToLongBits(this.p1.x);n^=31*mu.doubleToLongBits(this.p1.y);return e^(Math.trunc(n)^Math.trunc(n>>32))},gl.prototype.interfaces_=function(){return[xu,Li]},gl.prototype.getClass=function(){return gl},gl.midPoint=function(t,e){return new bu((t.x+e.x)/2,(t.y+e.y)/2)},dl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gl,dl);var yl=function(){this.tempEnv1=new Yu,this.tempEnv2=new Yu,this._overlapSeg1=new gl,this._overlapSeg2=new gl};yl.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var _l=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_l.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_l.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Bh.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return wl},Object.defineProperties(e,n),e}(xl),wl=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yl),bl=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Il={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};bl.prototype.getEndCapStyle=function(){return this._endCapStyle},bl.prototype.isSingleSided=function(){return this._isSingleSided},bl.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=bl.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=bl.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==bl.JOIN_ROUND&&(this._quadrantSegments=bl.DEFAULT_QUADRANT_SEGMENTS)},bl.prototype.getJoinStyle=function(){return this._joinStyle},bl.prototype.setJoinStyle=function(t){this._joinStyle=t},bl.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},bl.prototype.getSimplifyFactor=function(){return this._simplifyFactor},bl.prototype.getQuadrantSegments=function(){return this._quadrantSegments},bl.prototype.setEndCapStyle=function(t){this._endCapStyle=t},bl.prototype.getMitreLimit=function(){return this._mitreLimit},bl.prototype.setMitreLimit=function(t){this._mitreLimit=t},bl.prototype.setSingleSided=function(t){this._isSingleSided=t},bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},bl.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Il.CAP_ROUND.get=function(){return 1},Il.CAP_FLAT.get=function(){return 2},Il.CAP_SQUARE.get=function(){return 3},Il.JOIN_ROUND.get=function(){return 1},Il.JOIN_MITRE.get=function(){return 2},Il.JOIN_BEVEL.get=function(){return 3},Il.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Il.DEFAULT_MITRE_LIMIT.get=function(){return 5},Il.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(bl,Il);var Nl=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=sc.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Nl.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&(!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r))},Nl.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n=0;r--)this.addPt(t[r])},Sl.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Ll.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ll.PI_TIMES_2;return t},Ll.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ll.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ll.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ll.interiorAngle=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Math.abs(i-r)},Ll.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ll.PI_TIMES_2;t>=Ll.PI_TIMES_2&&(t=0)}else{for(;t>=Ll.PI_TIMES_2;)t-=Ll.PI_TIMES_2;t<0&&(t=0)}return t},Ll.angleBetween=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Ll.diff(r,i)},Ll.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},Ll.toRadians=function(t){return t*Math.PI/180},Ll.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ll.COUNTERCLOCKWISE:n<0?Ll.CLOCKWISE:Ll.NONE},Ll.angleBetweenOriented=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n)-r;return i<=-Math.PI?i+Ll.PI_TIMES_2:i>Math.PI?i-Ll.PI_TIMES_2:i},Pl.PI_TIMES_2.get=function(){return 2*Math.PI},Pl.PI_OVER_2.get=function(){return Math.PI/2},Pl.PI_OVER_4.get=function(){return Math.PI/4},Pl.COUNTERCLOCKWISE.get=function(){return sc.COUNTERCLOCKWISE},Pl.CLOCKWISE.get=function(){return sc.CLOCKWISE},Pl.NONE.get=function(){return sc.COLLINEAR},Object.defineProperties(Ll,Pl);var Ol=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gl,this._seg1=new gl,this._offset0=new gl,this._offset1=new gl,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new rc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===bl.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Rl={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ol.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=sc.computeOrientation(this._s0,this._s1,this._s2),r=n===sc.CLOCKWISE&&this._side===Nh.LEFT||n===sc.COUNTERCLOCKWISE&&this._side===Nh.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ol.prototype.addLineEndCap=function(t,e){var n=new gl(t,e),r=new gl;this.computeOffsetSegment(n,Nh.LEFT,this._distance,r);var i=new gl;this.computeOffsetSegment(n,Nh.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,sc.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case bl.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case bl.CAP_SQUARE:var u=new bu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new bu(r.p1.x+u.x,r.p1.y+u.y),h=new bu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},Ol.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ol.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Uu.intersection(e.p0,e.p1,n.p0,n.p1);(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof ju))throw t;o=new bu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ol.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,h=Math.atan2(c,u);r===sc.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},Ol.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new bu((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new bu((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ol.prototype.createCircle=function(t){var e=new bu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ol.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ol.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sl,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ol.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ol.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===bl.JOIN_BEVEL||this._bufParams.getJoinStyle()===bl.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,sc.CLOCKWISE,this._distance))},Ol.prototype.closeRing=function(){this._segList.closeRing()},Ol.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol},Rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ol,Rl);var Tl=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Tl.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Cc.reverse(o),o},Tl.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Tl.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Nh.RIGHT&&(r=-r);var i=Nl.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Tl.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Nl.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Nh.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Nl.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Nh.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Tl.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:e.createCircle(t);break;case bl.CAP_SQUARE:e.createSquare(t)}},Tl.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Tl.prototype.getBufferParameters=function(){return this._bufParams},Tl.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Tl.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Tl.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Tl.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Tl.prototype.getSegGen=function(t){return new Ol(this._precisionModel,this._bufParams,t)},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},Tl.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&arguments[1]instanceof jh)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;cthis._seg.p1.y&&this._seg.reverse();if(!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||sc.computeOrientation(this._seg.p0,this._seg.p1,o)===sc.RIGHT)){var h=s.getDepth(Nh.LEFT);this._seg.p0.equals(u[c])||(h=s.getDepth(Nh.RIGHT));var l=new Fl(this._seg,h);a.add(l)}}else if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&Lu(arguments[1],wc))for(var p=arguments[0],f=arguments[1],g=arguments[2],d=f.iterator();d.hasNext();){var y=d.next();y.isForward()&&this.findStabbedSegments(p,y,g)}},Al.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(0===e.size())return 0;return $h.min(e)._leftDepth},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},Dl.DepthSegment.get=function(){return Fl},Object.defineProperties(Al,Dl);var Fl=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gl(t),this._leftDepth=e};Fl.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n?n:0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fl.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fl.prototype.toString=function(){return this._upwardSeg.toString()},Fl.prototype.interfaces_=function(){return[xu]},Fl.prototype.getClass=function(){return Fl};var ql=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};ql.prototype.area=function(){return ql.area(this.p0,this.p1,this.p2)},ql.prototype.signedArea=function(){return ql.signedArea(this.p0,this.p1,this.p2)},ql.prototype.interpolateZ=function(t){if(null===t)throw new _u("Supplied point is null.");return ql.interpolateZ(t,this.p0,this.p1,this.p2)},ql.prototype.longestSideLength=function(){return ql.longestSideLength(this.p0,this.p1,this.p2)},ql.prototype.isAcute=function(){return ql.isAcute(this.p0,this.p1,this.p2)},ql.prototype.circumcentre=function(){return ql.circumcentre(this.p0,this.p1,this.p2)},ql.prototype.area3D=function(){return ql.area3D(this.p0,this.p1,this.p2)},ql.prototype.centroid=function(){return ql.centroid(this.p0,this.p1,this.p2)},ql.prototype.inCentre=function(){return ql.inCentre(this.p0,this.p1,this.p2)},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},ql.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},ql.det=function(t,e,n,r){return t*r-e*n},ql.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},ql.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},ql.isAcute=function(t,e,n){return!!Ll.isAcute(t,e,n)&&(!!Ll.isAcute(e,n,t)&&!!Ll.isAcute(n,t,e))},ql.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*ql.det(o,s,a,u),h=ql.det(s,o*o+s*s,u,a*a+u*u),l=ql.det(o,o*o+s*s,a,a*a+u*u);return new bu(r-h/c,i+l/c)},ql.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Uu(t.x+n/2,t.y+r/2,1),o=new Uu(t.x-r+n/2,t.y+n+r/2,1);return new Uu(i,o)},ql.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new bu(t.x+i*o,t.y+i*s)},ql.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,h=o*s-r*u,l=r*a-i*s,p=c*c+h*h+l*l,f=Math.sqrt(p)/2;return f},ql.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new bu(r,i)},ql.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new bu(a,u)};var Gl=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gl.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addPolygon=function(t){var e=this._distance,n=Nh.LEFT;this._distance<0&&(e=-this._distance,n=Nh.RIGHT);var r=t.getExteriorRing(),i=Cc.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,Su.EXTERIOR,Su.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Nh.opposite(n),Su.INTERIOR,Su.EXTERIOR)}},Gl.prototype.isTriangleErodedCompletely=function(t,e){var n=new ql(t[0],t[1],t[2]),r=n.inCentre();return sc.distancePointLine(r,n.p0,n.p1)=eh.MINIMUM_VALID_SIZE&&sc.isCCW(t)&&(o=i,s=r,n=Nh.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gl.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $c?this.addPolygon(t):t instanceof Jc?this.addLineString(t):t instanceof Kc?this.addPoint(t):t instanceof th?this.addCollection(t):t instanceof Xc?this.addCollection(t):t instanceof nh?this.addCollection(t):t instanceof jc&&this.addCollection(t)},Gl.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gl.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof jc?(this._subcollectionIterator=new kl(t),this._subcollectionIterator.next()):t},kl.prototype.remove=function(){throw new Error(this.getClass().getName())},kl.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},kl.prototype.interfaces_=function(){return[Ec]},kl.prototype.getClass=function(){return kl},kl.isAtomic=function(t){return!(t instanceof jc)};var zl=function(){this._geom=null;var t=arguments[0];this._geom=t};zl.prototype.locate=function(t){return zl.locate(t,this._geom)},zl.prototype.interfaces_=function(){return[Bl]},zl.prototype.getClass=function(){return zl},zl.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&sc.isPointInRing(t,e.getCoordinates())},zl.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zl.isPointInRing(t,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Nh.LEFT),r=t.getDepth(Nh.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Mh("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(tc.isTrue(null!==e,"found null for first outgoing dirEdge"),tc.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){e.next().isInResult()&&t++}return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();){i.next().getEdgeRing()===n&&r++}return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=Su.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Su.INTERIOR;break}if(r.isInResult()){t=Su.EXTERIOR;break}}}if(t===Su.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===Su.INTERIOR):(s.isInResult()&&(i=Su.EXTERIOR),a.isInResult()&&(i=Su.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Rh(Su.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==Su.INTERIOR&&o!==Su.BOUNDARY||this._label.setLocation(i,Su.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jl),Ul=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new qh(t,new Xl)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),Yl=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yl.prototype.compareTo=function(t){var e=t;return Yl.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yl.prototype.interfaces_=function(){return[xu]},Yl.prototype.getClass=function(){return Yl},Yl.orientation=function(t){return 1===Cc.increasingDirection(t)},Yl.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var h=t[u].compareTo(n[c]);if(0!==h)return h;var l=(u+=i)===s,p=(c+=o)===a;if(l&&!p)return-1;if(!l&&p)return 1;if(l&&p)return 0}};var Vl=function(){this._edges=new bc,this._ocaMap=new Gi};Vl.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Vl.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Vl.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new ep(o,new Rh(this.edge._label))},Zl.prototype.add=function(t,e,n){var r=new Jl(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Zl.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Kl=function(){};Kl.prototype.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=this.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(en?e:n},Ql.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(r=1),this._depth[t][n]=r}}},$l.prototype.getDelta=function(t){return this._depth[t][Nh.RIGHT]-this._depth[t][Nh.LEFT]},$l.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Su.EXTERIOR:Su.INTERIOR},$l.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$l.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==Su.EXTERIOR&&r!==Su.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=$l.depthAtLocation(r):this._depth[e][n]+=$l.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===Su.INTERIOR&&this._depth[i][o]++}},$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l},$l.depthAtLocation=function(t){return t===Su.EXTERIOR?0:t===Su.INTERIOR?1:$l.NULL_VALUE},tp.NULL_VALUE.get=function(){return-1},Object.defineProperties($l,tp);var ep=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $l,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);t[0]=this.pts[0],t[1]=this.pts[1];return new e(t,Rh.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Ql(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Yu;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return tc.isTrue(!(s&&a),"Found bad envelope test"),a},sp.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new bu(this._maxx,this._maxy),this._corner[1]=new bu(this._minx,this._maxy),this._corner[2]=new bu(this._minx,this._miny),this._corner[3]=new bu(this._maxx,this._miny)},sp.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sp.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sp.prototype.getCoordinate=function(){return this._originalPt},sp.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sp.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sp.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Yu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sp.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},sp.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!r)||(!!t.equals(this._pt)||!!e.equals(this._pt))))))},sp.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp},ap.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sp,ap);var up=function(){this.tempEnv1=new Yu,this.selectedSegment=new gl};up.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up};var cp=function(){this._index=null;var t=arguments[0];this._index=t},hp={HotPixelSnapAction:{configurable:!0}};cp.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new lp(e,n,r);return this._index.query(i,{interfaces_:function(){return[Jh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},hp.HotPixelSnapAction.get=function(){return lp},Object.defineProperties(cp,hp);var lp=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(up),pp=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bc};pp.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Mh))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gp.precisionScaleFactor(this._argGeom,this._distance,n),i=new fh(r);this.bufferFixedPrecision(i)}},gp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fh.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gp.prototype.bufferOriginalPrecision=function(){try{var t=new np(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Qu))throw t;this._saveException=t}},gp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gp(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new gp(n);o.setQuadrantSegments(i);return o.getResultGeometry(r)}if(arguments[2]instanceof bl&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new gp(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],h=arguments[1],l=arguments[2],p=arguments[3],f=new gp(c);f.setQuadrantSegments(l),f.setEndCapStyle(p);return f.getResultGeometry(h)}},gp.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=Pu.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},dp.CAP_ROUND.get=function(){return bl.CAP_ROUND},dp.CAP_BUTT.get=function(){return bl.CAP_FLAT},dp.CAP_FLAT.get=function(){return bl.CAP_FLAT},dp.CAP_SQUARE.get=function(){return bl.CAP_SQUARE},dp.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gp,dp);var yp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};yp.prototype.getCoordinates=function(){return this._pt},yp.prototype.getCoordinate=function(t){return this._pt[t]},yp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);rthis._distance&&this.initialize(e,n,r)}},yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp};var _p=function(){};_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.computeDistance=function(){if(arguments[2]instanceof yp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new gl,o=0;o0||this._isIn?Su.INTERIOR:Su.EXTERIOR)},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip};var Np=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Cp={INSIDE_AREA:{configurable:!0}};Np.prototype.isInsideArea=function(){return this._segIndex===Np.INSIDE_AREA},Np.prototype.getCoordinate=function(){return this._pt},Np.prototype.getGeometryComponent=function(){return this._component},Np.prototype.getSegmentIndex=function(){return this._segIndex},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np},Cp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Np,Cp);var Sp=function(t){this._pts=t||null};Sp.prototype.filter=function(t){t instanceof Kc&&this._pts.add(t)},Sp.prototype.interfaces_=function(){return[kc]},Sp.prototype.getClass=function(){return Sp},Sp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kc?$h.singletonList(t):Sp.getPoints(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kc?n.add(e):e instanceof jc&&e.apply(new Sp(n)),n}};var Mp=function(){this._locations=null;var t=arguments[0];this._locations=t};Mp.prototype.filter=function(t){(t instanceof Kc||t instanceof Jc||t instanceof $c)&&this._locations.add(new Np(t,0,t.getCoordinate()))},Mp.prototype.interfaces_=function(){return[kc]},Mp.prototype.getClass=function(){return Mp},Mp.getLocations=function(t){var e=new bc;return t.apply(new Mp(e)),e};var Lp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ip,this._minDistanceLocation=null,this._minDistance=mu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=wp.getPolygons(this._geom[e]);if(i.size()>0){var o=Mp.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;cthis._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;fthis._distance&&this.initialize(e,n,r)}},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp};var Op=function(){};Op.prototype.interfaces_=function(){return[]},Op.prototype.getClass=function(){return Op},Op.computeDistance=function(){if(arguments[2]instanceof Pp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gl,i=t.getCoordinates(),o=0;o1||t<=0)throw new _u("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rp.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rp.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rp.prototype.computeOrientedDistance=function(t,e,n){var r=new Ap(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dp(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Rp.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rp.prototype.interfaces_=function(){return[]},Rp.prototype.getClass=function(){return Rp},Rp.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Rp(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Rp(n,r);return o.setDensifyFraction(i),o.distance()}},Tp.MaxPointDistanceFilter.get=function(){return Ap},Tp.MaxDensifiedByFractionDistanceFilter.get=function(){return Dp},Object.defineProperties(Rp,Tp);var Ap=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._euclideanDist=new Op,this._geom=null;var t=arguments[0];this._geom=t};Ap.prototype.filter=function(t){this._minPtDist.initialize(),Op.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ap.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ap.prototype.interfaces_=function(){return[pc]},Ap.prototype.getClass=function(){return Ap};var Dp=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dp.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;sn){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ku.toLineString(i[0],i[1])+")"}},Fp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fp.VERBOSE&&Xu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fp.prototype.checkNegativeValid=function(){if(!(this._input instanceof $c||this._input instanceof nh||this._input instanceof jc))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fp.prototype.getErrorIndicator=function(){return this._errorIndicator},Fp.prototype.checkMinimumDistance=function(t,e,n){var r=new Lp(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gp.prototype.report=function(t){if(!Gp.VERBOSE)return null;Xu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gp.prototype.getErrorMessage=function(){return this._errorMsg},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.isValidMsg=function(t,e,n){var r=new Gp(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gp.isValid=function(t,e,n){return!!new Gp(t,e,n).isValid()},Bp.VERBOSE.get=function(){return!1},Bp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gp,Bp);var kp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};kp.prototype.getCoordinates=function(){return this._pts},kp.prototype.size=function(){return this._pts.length},kp.prototype.getCoordinate=function(t){return this._pts[t]},kp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},kp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hl.octant(this.getCoordinate(t),this.getCoordinate(t+1))},kp.prototype.setData=function(t){this._data=t},kp.prototype.getData=function(){return this._data},kp.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},kp.prototype.interfaces_=function(){return[ll]},kp.prototype.getClass=function(){return kp};var zp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zp.prototype.getIntersectionSegments=function(){return this._intSegments},zp.prototype.count=function(){return this._intersectionCount},zp.prototype.getIntersections=function(){return this._intersections},zp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zp.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){if(!(this.isEndSegment(t,e)||this.isEndSegment(n,r)))return null}var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zp.prototype.interfaces_=function(){return[Hl]},zp.prototype.getClass=function(){return zp},zp.createAllIntersectionsFinder=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e},zp.createAnyIntersectionFinder=function(t){return new zp(t)},zp.createIntersectionCounter=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jp=function(){this._li=new rc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jp.prototype.getIntersections=function(){return this._segInt.getIntersections()},jp.prototype.isValid=function(){return this.execute(),this._isValid},jp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new El;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Mh(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ku.toLineString(t[0],t[1])+" and "+Ku.toLineString(t[2],t[3])},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.computeIntersections=function(t){var e=new jp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Xp=function t(){this._nv=null;var e=arguments[0];this._nv=new jp(t.toSegmentStrings(e))};Xp.prototype.checkValid=function(){this._nv.checkValid()},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp},Xp.toSegmentStrings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new kp(r.getCoordinates(),r))}return e},Xp.checkValid=function(t){new Xp(t).checkValid()};var Up=function(t){this._mapOp=t};Up.prototype.map=function(t){for(var e=new bc,n=0;n0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp};var Wp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gl,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jc&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Wp.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r=0&&t.add(o+1,new bu(i),!1)}},Wp.prototype.findSegmentIndexToSnap=function(t,e){for(var n=mu.MAX_VALUE,r=-1,i=0;ie&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Jp.computeOverlaySnapTolerance(i),Jp.computeOverlaySnapTolerance(o))}},Jp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jp.SNAP_PRECISION_FACTOR},Jp.snapToSelf=function(t,e,n){return new Jp(t).snapToSelf(e,n)},Zp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jp,Zp);var Kp=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wp(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hp),Qp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qp.prototype.getCommon=function(){return mu.longBitsToDouble(this._commonBits)},Qp.prototype.add=function(t){var e=mu.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Qp.signExpBits(this._commonBits),this._isFirst=!1,null;if(Qp.signExpBits(e)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Qp.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Qp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Qp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=mu.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+mu.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qp.prototype.interfaces_=function(){return[]},Qp.prototype.getClass=function(){return Qp},Qp.getBit=function(t,e){return 0!=(t&1<>52},Qp.zeroLowerBits=function(t,e){return t&~((1<=0;r--){if(Qp.getBit(t,r)!==Qp.getBit(e,r))return n;n++}return 52};var $p=function(){this._commonCoord=null,this._ccFilter=new ef},tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};$p.prototype.addCommonBits=function(t){var e=new nf(this._commonCoord);t.apply(e),t.geometryChanged()},$p.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new bu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new nf(e);return t.apply(n),t.geometryChanged(),t},$p.prototype.getCommonCoordinate=function(){return this._commonCoord},$p.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},$p.prototype.interfaces_=function(){return[]},$p.prototype.getClass=function(){return $p},tf.CommonCoordinateFilter.get=function(){return ef},tf.Translater.get=function(){return nf},Object.defineProperties($p,tf);var ef=function(){this._commonBitsX=new Qp,this._commonBitsY=new Qp};ef.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ef.prototype.getCommonCoordinate=function(){return new bu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ef.prototype.interfaces_=function(){return[pc]},ef.prototype.getClass=function(){return ef};var nf=function(){this.trans=null;var t=arguments[0];this.trans=t};nf.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},nf.prototype.isDone=function(){return!1},nf.prototype.isGeometryChanged=function(){return!0},nf.prototype.interfaces_=function(){return[zc]},nf.prototype.getClass=function(){return nf};var rf=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};rf.prototype.selfSnap=function(t){return new Jp(t).snapTo(t,this._snapTolerance)},rf.prototype.removeCommonBits=function(t){this._cbr=new $p,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},rf.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rf.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Cf.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rf.prototype.checkValid=function(t){t.isValid()||Xu.out.println("Snapped geometry is invalid")},rf.prototype.computeSnapTolerance=function(){this._snapTolerance=Jp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rf.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jp.snap(e[0],e[1],this._snapTolerance)},rf.prototype.interfaces_=function(){return[]},rf.prototype.getClass=function(){return rf},rf.overlayOp=function(t,e,n){return new rf(t,e).getResultGeometry(n)},rf.union=function(t,e){return rf.overlayOp(t,e,Cf.UNION)},rf.intersection=function(t,e){return rf.overlayOp(t,e,Cf.INTERSECTION)},rf.symDifference=function(t,e){return rf.overlayOp(t,e,Cf.SYMDIFFERENCE)},rf.difference=function(t,e){return rf.overlayOp(t,e,Cf.DIFFERENCE)};var of=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};of.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Cf.overlayOp(this._geom[0],this._geom[1],t);n=!0}catch(t){if(!(t instanceof Qu))throw t;r=t}if(!n)try{e=rf.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Qu?r:t}return e},of.prototype.interfaces_=function(){return[]},of.prototype.getClass=function(){return of},of.overlayOp=function(t,e,n){return new of(t,e).getResultGeometry(n)},of.union=function(t,e){return of.overlayOp(t,e,Cf.UNION)},of.intersection=function(t,e){return of.overlayOp(t,e,Cf.INTERSECTION)},of.symDifference=function(t,e){return of.overlayOp(t,e,Cf.SYMDIFFERENCE)},of.difference=function(t,e){return of.overlayOp(t,e,Cf.DIFFERENCE)};var sf=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};sf.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};var af=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},uf={INSERT:{configurable:!0},DELETE:{configurable:!0}};af.prototype.isDelete=function(){return this._eventType===af.DELETE},af.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},af.prototype.getObject=function(){return this._obj},af.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},af.prototype.getInsertEvent=function(){return this._insertEvent},af.prototype.isInsert=function(){return this._eventType===af.INSERT},af.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},af.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},af.prototype.interfaces_=function(){return[xu]},af.prototype.getClass=function(){return af},uf.INSERT.get=function(){return 1},uf.DELETE.get=function(){return 2},Object.defineProperties(af,uf);var cf=function(){};cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};hf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hf.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hf.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},hf.prototype.hasProperIntersection=function(){return this._hasProper},hf.prototype.hasIntersection=function(){return this._hasIntersection},hf.prototype.isDone=function(){return this._isDone},hf.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},hf.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hf.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lf=function(t){function e(){t.call(this),this.events=new bc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$h.sort(this.events);for(var t=0;te||this._maxo?1:0},gf.prototype.interfaces_=function(){return[wu]},gf.prototype.getClass=function(){return gf};var df=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),yf=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),_f=function(){this._leaves=new bc,this._root=null,this._level=0};_f.prototype.buildTree=function(){$h.sort(this._leaves,new pf.NodeComparator);for(var t=this._leaves,e=null,n=new bc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_f.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new df(t,e,n))},_f.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_f.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_f.prototype.printNode=function(t){Xu.out.println(Ku.toLineString(new bu(t._min,this._level),new bu(t._max,this._level)))},_f.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_f.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===Su.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Cc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;sc.isCCW(r)&&(i=n,o=e);var s=new ep(r,new Rh(this._argIndex,Su.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],Su.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Rh(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lf},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof nh&&(this._useBoundaryDeterminationRule=!1),e instanceof $c)this.addPolygon(e);else if(e instanceof Jc)this.addLineString(e);else if(e instanceof Kc)this.addPoint(e);else if(e instanceof th)this.addCollection(e);else if(e instanceof Xc)this.addCollection(e);else if(e instanceof nh)this.addCollection(e);else{if(!(e instanceof jc))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new vf(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?Su.BOUNDARY:Su.INTERIOR},e}(Uh),If=function(){if(this._li=new rc,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bf(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,e,r),this._arg[1]=new bf(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,i,s),this._arg[1]=new bf(1,o,s)}};If.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},If.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If};var Nf=function(){};Nf.prototype.interfaces_=function(){return[]},Nf.prototype.getClass=function(){return Nf},Nf.map=function(){if(arguments[0]instanceof cc&&Lu(arguments[1],Nf.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bc,r=0;r=t.size()?null:t.get(e)},Tf.union=function(t){return new Tf(t).union()},Af.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Tf,Af);var Df=function(){};Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.UNION)};var Ff=function(){return new Yi};Yi.prototype={constructor:Yi,reset:function(){this.s=this.t=0},add:function(t){Vi(qf,t,this.t),Vi(this,qf.s,this.s),this.s?this.t+=qf.t:this.s=qf.t},valueOf:function(){return this.s}};var qf=new Yi,Gf=1e-6,Bf=Math.PI,kf=Bf/2,zf=Bf/4,jf=2*Bf,Xf=180/Bf,Uf=Bf/180,Yf=Math.abs,Vf=Math.atan,Hf=Math.atan2,Wf=Math.cos,Jf=Math.exp,Zf=Math.log,Kf=Math.sin,Qf=Math.sqrt,$f=Math.tan,tg={Feature:function(t,e){Ji(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r2?t[2]*Uf:0),e.invert=function(e){return e=t.invert(e[0]*Uf,e[1]*Uf),e[0]*=Xf,e[1]*=Xf,e},e},og=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},sg=function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,h=1,l=e[0]-a,p=e[1]-u;if(s=n-a,l||!(s>0)){if(s/=l,l<0){if(s0){if(s>h)return;s>c&&(c=s)}if(s=i-a,l||!(s<0)){if(s/=l,l<0){if(s>h)return;s>c&&(c=s)}else if(l>0){if(s0)){if(s/=p,p<0){if(s0){if(s>h)return;s>c&&(c=s)}if(s=o-u,p||!(s<0)){if(s/=p,p<0){if(s>h)return;s>c&&(c=s)}else if(p>0){if(s0&&(t[0]=a+c*l,t[1]=u+c*p),h<1&&(e[0]=a+h*l,e[1]=u+h*p),!0}}}}},ag=function(t,e){return Yf(t[0]-e[0])=0;--o)i.point((h=c[o])[0],h[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},cg=function(t,e){return te?1:t>=e?0:NaN},hg=(function(t){1===t.length&&(t=function(t){return function(e,n){return cg(t(e),n)}}(t))}(cg),function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}),lg=1e9,pg=-lg,fg=Ff(),gg=(Ff(),function(t){return t}),dg=(Ff(),Ff(),1/0),yg=dg,_g=-dg,mg=_g,vg={point:function(t,e){t_g&&(_g=t),emg&&(mg=e)},lineStart:Wi,lineEnd:Wi,polygonStart:Wi,polygonEnd:Wi,result:function(){var t=[[dg,yg],[_g,mg]];return _g=mg=-(yg=dg=1/0),t}},xg=(Ff(),function(t,e,n,r){return function(i,o){function s(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function a(t,e){var n=i(t,e);y.point(n[0],n[1])}function u(){E.point=a,y.lineStart()}function c(){E.point=s,y.lineEnd()}function h(t,e){d.push([t,e]);var n=i(t,e);v.point(n[0],n[1])}function l(){v.lineStart(),d=[]}function p(){h(d[0][0],d[0][1]),v.lineEnd();var t,e,n,r,i=v.clean(),s=m.result(),a=s.length;if(d.pop(),f.push(d),d=null,a)if(1&i){if(n=s[0],(e=n.length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&s.push(s.pop().concat(s.shift())),g.push(s.filter(go))}var f,g,d,y=e(o),_=i.invert(r[0],r[1]),m=og(),v=e(m),x=!1,E={point:s,lineStart:u,lineEnd:c,polygonStart:function(){E.point=h,E.lineStart=l,E.lineEnd=p,g=[],f=[]},polygonEnd:function(){E.point=s,E.lineStart=u,E.lineEnd=c,g=hg(g);var t=function(t,e){var n=e[0],r=e[1],i=[Kf(n),-Wf(n),0],o=0,s=0;fg.reset();for(var a=0,u=t.length;a=0?1:-1,I=b*w,N=I>Bf,C=g*x;if(fg.add(Hf(C*b*Kf(I),d*E+C*Wf(I))),o+=N?w+b*jf:w,N^p>=n^m>=n){var S=eo($i(l),$i(_));io(S);var M=eo(i,S);io(M);var L=(N^w>=0?-1:1)*Hi(M[2]);(r>L||r===L&&(S[0]||S[1]))&&(s+=N^w>=0?1:-1)}}return(o<-Gf||o0?Bf:-Bf,u=Yf(o-n);Yf(u-Bf)0?kf:-kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Bf&&(Yf(n-i)Gf?Vf((Kf(e)*(o=Wf(r))*Kf(n)-Kf(r)*(i=Wf(e))*Kf(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*kf,r.point(-Bf,i),r.point(0,i),r.point(Bf,i),r.point(Bf,0),r.point(Bf,-i),r.point(0,-i),r.point(-Bf,-i),r.point(-Bf,0),r.point(-Bf,i);else if(Yf(t[0]-e[0])>Gf){var o=t[0]o}function r(t,e,n){var r=[1,0,0],i=eo($i(t),$i(e)),s=to(i,i),a=i[0],u=s-a*a;if(!u)return!n&&t;var c=o*s/u,h=-o*a/u,l=eo(r,i),p=ro(r,c);no(p,ro(i,h));var f=l,g=to(p,f),d=to(f,f),y=g*g-d*(to(p,p)-1);if(!(y<0)){var _=Qf(y),m=ro(f,(-g-_)/d);if(no(m,p),m=Qi(m),!n)return m;var v,x=t[0],E=e[0],w=t[1],b=e[1];E0^m[1]<(Yf(m[0]-x)Bf^(x<=m[0]&&m[0]<=E)){var C=ro(f,(-g+_)/d);return no(C,p),[m,Qi(C)]}}}function i(e,n){var r=s?t:Bf-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var o=Wf(t),s=o>0,a=Yf(o)>Gf;return xg(n,function(t){var e,o,u,c,h;return{lineStart:function(){c=u=!1,h=1},point:function(l,p){var f,g=[l,p],d=n(l,p),y=s?d?0:i(l,p):d?i(l+(l<0?Bf:-Bf),p):0;if(!e&&(c=u=d)&&t.lineStart(),d!==u&&(!(f=r(e,g))||ag(e,f)||ag(g,f))&&(g[0]+=Gf,g[1]+=Gf,d=n(g[0],g[1])),d!==u)h=0,d?(t.lineStart(),f=r(g,e),t.point(f[0],f[1])):(f=r(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(a&&e&&s^d){var _;y&o||!(_=r(g,e,!0))||(h=0,s?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!d||e&&ag(e,g)||t.point(g[0],g[1]),e=g,u=d,o=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(c&&u)<<1}}},function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Wf(e),a=Kf(e),u=r*n;null==i?(i=e+r*jf,o=e-u/2):(i=ho(s,i),o=ho(s,o),(r>0?io)&&(i+=r*jf));for(var c,h=i;r>0?h>o:h4*e&&d--){var x=s+p,E=a+f,w=u+g,b=Qf(x*x+E*E+w*w),I=Hi(w/=b),N=Yf(Yf(w)-1)e||Yf((_*L+m*P)/v-.5)>.3||s*p+a*f+u*g2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)};t.projection=Cs,t.random=gu,t.clusters=du,t.helpers=ko,t.invariant=jo,t.meta=zo,t.isolines=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=rt(t,{zProperty:r,flip:!0});return c(function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach(function(t){S(t,p)}),t}(function(t,e,n,r,i){for(var o=[],s=1;ss;)r=Math.floor((o+1)*Math.random()),n=i[r],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=he,t.square=le,t.circle=fe,t.midpoint=function(t,e){return pe(t,qt(t,e)/2,ge(t,e))},t.center=de,t.centerOfMass=_e,t.centroid=ye,t.combine=function(t){function n(t,e,n){n?r[e].coordinates=r[e].coordinates.concat(t.geometry.coordinates):r[e].coordinates.push(t.geometry.coordinates),r[e].properties.push(t.properties)}var r={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(r).reduce(function(t,e){return t[e.replace("Multi","")]=e,t},{});return O(t,function(t){t.geometry&&(r[t.geometry.type]?n(t,t.geometry.type,!0):i[t.geometry.type]&&n(t,i[t.geometry.type],!1))}),c(Object.keys(r).filter(function(t){return r[t].coordinates.length}).sort().map(function(t){return e({type:t,coordinates:r[t].coordinates},{collectedProperties:r[t].properties})}))},t.distance=qt,t.explode=me,t.bbox=j,t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=De(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(De(t))}),e},t.bboxPolygon=ce,t.booleanPointInPolygon=Pt,t.nearestPoint=Fe,t.nearestPointOnLine=on,t.nearestPointToLine=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units,i=n.properties||{};if(!t)throw new Error("points is required");if(!(t=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return A(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t;default:throw new Error("points must be a Point Collection")}}(t)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==K(e))throw new Error("line must be a LineString");var o=1/0,s=null;return O(t,function(t){var n=gn(t,e,{units:r});n=0&&c<=1&&(f.onLine1=!0),h>=0&&h<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);s&&i.features.push(r([s[0],s[1]]))}})}),i},t.pointOnFeature=yn,t.area=mn,t.along=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!b(e))throw new Error("distance must be a number");for(var o=0,s=0;s=o&&s===i.length-1);s++){if(o>=e){var a=e-o;if(a){var u=ge(i[s],i[s-1])-180;return pe(i[s],a,u,n)}return r(i[s])}o+=qt(i[s],i[s+1],n)}return r(i[i.length-1])},t.length=bn,t.lineSlice=function(t,e,n){var r=U(n);if("LineString"!==K(n))throw new Error("line must be a LineString");for(var i,o=on(n,t),s=on(n,e),u=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],c=i[0].properties.index+1;c is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=Gt(t));var i=[];switch(t.type){case"GeometryCollection":return A(t,function(t){sr(t,n)}),t;case"FeatureCollection":return O(t,function(t){O(sr(t,n),function(t){i.push(t)})}),c(i)}return sr(t,n)},t.isobands=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},s=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=cr(t,{zProperty:r,flip:!0}),u=function(t,e,n){for(var r=[],i=1;i0}(t,e);case"Polygon":return!br(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!br(t,e);case"Polygon":return!function(t,e){for(var n=0;n0)for(var n=0;n0))throw new Error("Invalid maxDistance");if(!(void 0===r||null===r||Math.sign(r)>0))throw new Error("Invalid minPoints");t=Gt(t),r=r||3;var o=new Ha.DBSCAN,s=-1;return o.run(T(t),E(e,i),r,qt).forEach(function(e){s++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=s,n.properties.dbscan="core"})}),o.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,r=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(n=n||Math.round(Math.sqrt(i/2)))>i&&(n=i),!1!==r&&void 0!==r||(t=Gt(t));var o=T(t),s=o.slice(0,n),a=eu(o,n,s),u={};return a.centroids.forEach(function(t,e){u[e]=t}),O(t,function(t,e){var n=a.idxs[e];t.properties.cluster=n,t.properties.centroid=u[n]}),t},t.pointToLineDistance=gn,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Dr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Dr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=en(te(t)).features,r=en(te(e)).features,i=0;i=d;){for(var T=[],A=[],D=g+w,F=0;D<=y;){var q=r([D,O]),G=function(t,e){for(var n=0;n0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var r=Po(e,o);0!==r&&(e-=r)}if(e!==+u){var l=i[e];l&&c&&(void 0!==n&&l.properties[n]!==c.properties[n]||Tr(c,l)&&function(t,e){var n=a(T(t)),r=a(T(e));return nn(n,r).features.length>0}(c,l)&&(i[u]=Mo(c,l),o.push(t.properties.origIndexPosition),o.sort(function(t,e){return t-e}),s.remove(t),i.splice(e,1),c.properties.origIndexPosition=u,s.remove(c,function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition}),h=!0))}}),h){if(!c)continue;c.properties.origIndexPosition=u,s.insert(c),u--}}return i.forEach(function(t){delete t.properties.origIndexPosition,delete t.bbox}),r},t.hexGrid=Oo,t.mask=function(t,e){var n=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),r=function(t){var e=[],n=[];return F(t,function(t){var r=t.geometry.coordinates,i=r[0],s=r.slice(1);e.push(o([i])),s.forEach(function(t){n.push(o([t]))})}),[c(e),c(n)]}(t),i=r[0],s=r[1];return function(t,e,n){var r=[];return r.push(t.geometry.coordinates[0]),F(e,function(t){r.push(t.geometry.coordinates[0])}),F(n,function(t){r.push(t.geometry.coordinates[0])}),o(r)}(n,i=Ro(i),s=Ro(s))},t.squareGrid=Ao,t.triangleGrid=Do,t.interpolate=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=j(t);switch(r){case"point":case"points":s=Ln(a,e,n);break;case"square":case"squares":s=Ao(a,e,n);break;case"hex":case"hexes":s=Oo(a,e,n);break;case"triangle":case"triangles":s=Do(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return O(s,function(e){var s=0,a=0;O(t,function(t){var u,c=qt("point"===r?e:ye(e),t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u});var c=Gt(e);c.properties[i]=s/a,u.push(c)}),c(u)},t.pointOnSurface=yn,t.polygonToLineString=kn,t.lineStringToPolygon=jn,t.inside=Pt,t.within=Rt,t.bezier=ue,t.nearest=Fe,t.pointOnLine=on,t.lineDistance=bn,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=_,t.distanceToRadians=y,t.radiansToDistance=d,t.bearingToAngle=m,t.convertDistance=E,t.toMercator=cn,t.toWgs84=hn,t.randomPosition=_i,t.randomPoint=mi,t.randomPolygon=vi,t.randomLineString=xi,t.getCluster=wi,t.clusterEach=bi,t.clusterReduce=Ii,t.createBins=Ni,t.applyFilter=Ci,t.propertiesContainsFilter=Si,t.filterProperties=Mi,t.earthRadius=Fo,t.factors=qo,t.unitsFactors=Go,t.areaFactors=Bo,t.feature=e,t.geometry=n,t.point=r,t.points=i,t.polygon=o,t.polygons=s,t.lineString=a,t.lineStrings=u,t.featureCollection=c,t.multiLineString=h,t.multiPoint=l,t.multiPolygon=p,t.geometryCollection=f,t.round=g,t.radiansToLength=d,t.lengthToRadians=y,t.lengthToDegrees=_,t.bearingToAzimuth=m,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=E,t.convertArea=w,t.isNumber=b,t.isObject=I,t.validateBBox=N,t.validateId=C,t.getCoord=X,t.getCoords=U,t.containsNumber=Y,t.geojsonType=V,t.featureOf=H,t.collectionOf=W,t.getGeom=J,t.getGeomType=Z,t.getType=K,t.coordEach=S,t.coordReduce=M,t.propEach=L,t.propReduce=P,t.featureEach=O,t.featureReduce=R,t.coordAll=T,t.geomEach=A,t.geomReduce=D,t.flattenEach=F,t.flattenReduce=q,t.segmentEach=G,t.segmentReduce=B,t.lineEach=k,t.lineReduce=z,Object.defineProperty(t,"__esModule",{value:!0})}); /***/ }), -/* 266 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2330,16 +2330,16 @@ module.exports = invariant; /***/ }), -/* 267 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var constants = __webpack_require__(367); -var client = __webpack_require__(368); -var getUser = __webpack_require__(315); +var invariant = __webpack_require__(302); +var constants = __webpack_require__(403); +var client = __webpack_require__(404); +var getUser = __webpack_require__(351); /** * Services all have the same constructor pattern: you initialize them @@ -2393,9 +2393,9 @@ module.exports = makeService; /***/ }), -/* 268 */, -/* 269 */, -/* 270 */ +/* 304 */, +/* 305 */, +/* 306 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2410,10 +2410,10 @@ module.exports = makeService; var defaultClient, mixin, responsePromise, client; -defaultClient = __webpack_require__(307); -mixin = __webpack_require__(276); -responsePromise = __webpack_require__(283); -client = __webpack_require__(282); +defaultClient = __webpack_require__(343); +mixin = __webpack_require__(312); +responsePromise = __webpack_require__(319); +client = __webpack_require__(318); /** * Interceptors have the ability to intercept the request and/org response @@ -2547,16 +2547,16 @@ module.exports = interceptor; /***/ }), -/* 271 */, -/* 272 */ +/* 307 */, +/* 308 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var corslite = __webpack_require__(362), - strict = __webpack_require__(77).strict, - config = __webpack_require__(81); +var corslite = __webpack_require__(398), + strict = __webpack_require__(82).strict, + config = __webpack_require__(86); var protocol = /^(https?:)?(?=\/\/(.|api)\.tiles\.mapbox\.com\/)/; @@ -2587,7 +2587,7 @@ module.exports = function(url, callback) { /***/ }), -/* 273 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -3134,16 +3134,16 @@ module.exports = { /***/ }), -/* 274 */, -/* 275 */ +/* 310 */, +/* 311 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var request = __webpack_require__(272), - format_url = __webpack_require__(79), - util = __webpack_require__(77); +var request = __webpack_require__(308), + format_url = __webpack_require__(84), + util = __webpack_require__(82); module.exports = { _loadTileJSON: function(_) { @@ -3166,7 +3166,7 @@ module.exports = { /***/ }), -/* 276 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3210,10 +3210,10 @@ module.exports = mixin; /***/ }), -/* 277 */, -/* 278 */, -/* 279 */, -/* 280 */ +/* 313 */, +/* 314 */, +/* 315 */, +/* 316 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3232,7 +3232,7 @@ module.exports = new Feedback(); /***/ }), -/* 281 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3241,15 +3241,15 @@ module.exports = new Feedback(); // Installs ES6 Promise polyfill if a native Promise is not available if (typeof Promise === 'undefined') { - __webpack_require__(369).polyfill(); + __webpack_require__(405).polyfill(); } module.export = Promise; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module))) /***/ }), -/* 282 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3310,7 +3310,7 @@ module.exports = function client(impl, target) { /***/ }), -/* 283 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3325,7 +3325,7 @@ module.exports = function client(impl, target) { /*jshint latedef: nofunc */ -var normalizeHeaderName = __webpack_require__(308); +var normalizeHeaderName = __webpack_require__(344); function property(promise, name) { return promise.then( @@ -3451,7 +3451,7 @@ module.exports = responsePromise; /***/ }), -/* 284 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3466,7 +3466,7 @@ module.exports = responsePromise; var uriEncoder, operations, prefixRE; -uriEncoder = __webpack_require__(377); +uriEncoder = __webpack_require__(413); prefixRE = /^([^:]*):([0-9]+)$/; operations = { @@ -3618,13 +3618,13 @@ module.exports = { /***/ }), -/* 285 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariantLocation = __webpack_require__(286); +var invariantLocation = __webpack_require__(322); /** * Format waypionts in a way that's friendly to the directions and surface @@ -3647,13 +3647,13 @@ module.exports = formatPoints; /***/ }), -/* 286 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); +var invariant = __webpack_require__(302); /** * Given an object that should be a location, ensure that it has @@ -3677,7 +3677,7 @@ module.exports = invariantLocation; /***/ }), -/* 287 */ +/* 323 */ /***/ (function(module, exports) { /** @@ -3890,15 +3890,15 @@ module.exports = { /***/ }), -/* 288 */, -/* 289 */, -/* 290 */, -/* 291 */, -/* 292 */, -/* 293 */, -/* 294 */, -/* 295 */, -/* 296 */ +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */, +/* 328 */, +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -13075,17 +13075,17 @@ L.Map.include({ }(window, document)); /***/ }), -/* 297 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isArray = __webpack_require__(361), - util = __webpack_require__(77), - format_url = __webpack_require__(79), - feedback = __webpack_require__(280), - request = __webpack_require__(272); +var isArray = __webpack_require__(397), + util = __webpack_require__(82), + format_url = __webpack_require__(84), + feedback = __webpack_require__(316), + request = __webpack_require__(308); // Low-level geocoding interface - wraps specific API calls and their // return values. @@ -13224,21 +13224,21 @@ module.exports = function(url, options) { /***/ }), -/* 298 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - Mustache = __webpack_require__(299); +var util = __webpack_require__(82), + Mustache = __webpack_require__(335); var GridControl = L.Control.extend({ options: { pinnable: true, follow: false, - sanitizer: __webpack_require__(78), + sanitizer: __webpack_require__(83), touchTeaser: true, location: true }, @@ -13429,7 +13429,7 @@ module.exports.gridControl = function(_, options) { /***/ }), -/* 299 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -14067,17 +14067,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/* 300 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - format_url = __webpack_require__(79), - request = __webpack_require__(272), - marker = __webpack_require__(80), - simplestyle = __webpack_require__(301); +var util = __webpack_require__(82), + format_url = __webpack_require__(84), + request = __webpack_require__(308), + marker = __webpack_require__(85), + simplestyle = __webpack_require__(337); // # featureLayer // @@ -14086,7 +14086,7 @@ var util = __webpack_require__(77), var FeatureLayer = L.FeatureGroup.extend({ options: { filter: function() { return true; }, - sanitizer: __webpack_require__(78), + sanitizer: __webpack_require__(83), style: simplestyle.style, popupOptions: { closeButton: false } }, @@ -14201,7 +14201,7 @@ module.exports.featureLayer = function(_, options) { /***/ }), -/* 301 */ +/* 337 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14253,7 +14253,7 @@ module.exports = { /***/ }), -/* 302 */ +/* 338 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14263,7 +14263,7 @@ var LegendControl = L.Control.extend({ options: { position: 'bottomright', - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(options) { @@ -14327,16 +14327,16 @@ module.exports.legendControl = function(options) { /***/ }), -/* 303 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var format_url = __webpack_require__(79); +var format_url = __webpack_require__(84); var ShareControl = L.Control.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { position: 'topleft', @@ -14455,20 +14455,20 @@ module.exports.shareControl = function(_, options) { /***/ }), -/* 304 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77); +var util = __webpack_require__(82); var formatPattern = /\.((?:png|jpg)\d*)(?=$|\?)/; var TileLayer = L.TileLayer.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, // http://mapbox.com/developers/api/#image_quality @@ -14560,7 +14560,7 @@ module.exports.tileLayer = function(_, options) { /***/ }), -/* 305 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14569,7 +14569,7 @@ module.exports.tileLayer = function(_, options) { var InfoControl = L.Control.extend({ options: { position: 'bottomright', - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(options) { @@ -14682,19 +14682,19 @@ module.exports.infoControl = function(options) { /***/ }), -/* 306 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - request = __webpack_require__(272), - grid = __webpack_require__(364); +var util = __webpack_require__(82), + request = __webpack_require__(308), + grid = __webpack_require__(400); // forked from danzel/L.UTFGrid var GridLayer = L.Class.extend({ - includes: [L.Mixin.Events, __webpack_require__(275)], + includes: [L.Mixin.Events, __webpack_require__(311)], options: { template: function() { return ''; } @@ -14912,7 +14912,7 @@ module.exports.gridLayer = function(_, options) { /***/ }), -/* 307 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14983,7 +14983,7 @@ module.exports.gridLayer = function(_, options) { var client, target, platformDefault; -client = __webpack_require__(282); +client = __webpack_require__(318); if (typeof Promise !== 'function' && console && console.log) { console.log('An ES6 Promise implementation is required to use rest.js. See https://github.com/cujojs/when/blob/master/docs/es6-promise-shim.md for using when.js as a Promise polyfill.'); @@ -15035,7 +15035,7 @@ module.exports = client(defaultClient); /***/ }), -/* 308 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15070,7 +15070,7 @@ module.exports = normalizeHeaderName; /***/ }), -/* 309 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15085,8 +15085,8 @@ module.exports = normalizeHeaderName; var interceptor, UrlBuilder; -interceptor = __webpack_require__(270); -UrlBuilder = __webpack_require__(373); +interceptor = __webpack_require__(306); +UrlBuilder = __webpack_require__(409); function startsWith(str, prefix) { return str.indexOf(prefix) === 0; @@ -15126,7 +15126,7 @@ module.exports = interceptor({ /***/ }), -/* 310 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15214,7 +15214,7 @@ module.exports = { /***/ }), -/* 311 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15262,7 +15262,7 @@ module.exports = { /***/ }), -/* 312 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15277,9 +15277,9 @@ module.exports = { var interceptor, uriTemplate, mixin; -interceptor = __webpack_require__(270); -uriTemplate = __webpack_require__(284); -mixin = __webpack_require__(276); +interceptor = __webpack_require__(306); +uriTemplate = __webpack_require__(320); +mixin = __webpack_require__(312); /** * Applies request params to the path as a URI Template @@ -15315,7 +15315,7 @@ module.exports = interceptor({ /***/ }), -/* 313 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15349,24 +15349,24 @@ module.exports = attempt; /***/ }), -/* 314 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.decode = exports.parse = __webpack_require__(389); -exports.encode = exports.stringify = __webpack_require__(390); +exports.decode = exports.parse = __webpack_require__(425); +exports.encode = exports.stringify = __webpack_require__(426); /***/ }), -/* 315 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var b64 = __webpack_require__(393); +var b64 = __webpack_require__(429); /** * Access tokens actually are data, and using them we can derive @@ -15399,7 +15399,7 @@ module.exports = getUser; /***/ }), -/* 316 */ +/* 352 */ /***/ (function(module, exports) { /* @@ -15446,13 +15446,13 @@ function extend() { /***/ }), -/* 317 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html -var getCoord = __webpack_require__(287).getCoord; -var helpers = __webpack_require__(273); +var getCoord = __webpack_require__(323).getCoord; +var helpers = __webpack_require__(309); var point = helpers.point; var distanceToRadians = helpers.distanceToRadians; @@ -15498,7 +15498,7 @@ module.exports = function (origin, distance, bearing, units) { /***/ }), -/* 318 */ +/* 354 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -16499,74 +16499,74 @@ function lineReduce(geojson, callback, initialValue) { /***/ }), -/* 319 */, -/* 320 */, -/* 321 */, -/* 322 */, -/* 323 */, -/* 324 */, -/* 325 */, -/* 326 */, -/* 327 */, -/* 328 */, -/* 329 */, -/* 330 */, -/* 331 */, -/* 332 */, -/* 333 */, -/* 334 */, -/* 335 */, -/* 336 */, -/* 337 */, -/* 338 */, -/* 339 */, -/* 340 */, -/* 341 */, -/* 342 */, -/* 343 */, -/* 344 */, -/* 345 */, -/* 346 */, -/* 347 */, -/* 348 */, -/* 349 */, -/* 350 */, -/* 351 */, -/* 352 */, -/* 353 */, -/* 354 */, /* 355 */, /* 356 */, /* 357 */, -/* 358 */ +/* 358 */, +/* 359 */, +/* 360 */, +/* 361 */, +/* 362 */, +/* 363 */, +/* 364 */, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */, +/* 372 */, +/* 373 */, +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */, +/* 378 */, +/* 379 */, +/* 380 */, +/* 381 */, +/* 382 */, +/* 383 */, +/* 384 */, +/* 385 */, +/* 386 */, +/* 387 */, +/* 388 */, +/* 389 */, +/* 390 */, +/* 391 */, +/* 392 */, +/* 393 */, +/* 394 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = window.L = __webpack_require__(296); +module.exports = window.L = __webpack_require__(332); /***/ }), -/* 359 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var geocoderControl = __webpack_require__(360), - gridControl = __webpack_require__(298), - featureLayer = __webpack_require__(300), - legendControl = __webpack_require__(302), - shareControl = __webpack_require__(303), - tileLayer = __webpack_require__(304), - infoControl = __webpack_require__(305), - map = __webpack_require__(363), - gridLayer = __webpack_require__(306), - styleLayer = __webpack_require__(366); +var geocoderControl = __webpack_require__(396), + gridControl = __webpack_require__(334), + featureLayer = __webpack_require__(336), + legendControl = __webpack_require__(338), + shareControl = __webpack_require__(339), + tileLayer = __webpack_require__(340), + infoControl = __webpack_require__(341), + map = __webpack_require__(399), + gridLayer = __webpack_require__(342), + styleLayer = __webpack_require__(402); L.mapbox = module.exports = { - VERSION: __webpack_require__(82).version, - geocoder: __webpack_require__(297), - marker: __webpack_require__(80), - simplestyle: __webpack_require__(301), + VERSION: __webpack_require__(87).version, + geocoder: __webpack_require__(333), + marker: __webpack_require__(85), + simplestyle: __webpack_require__(337), tileLayer: tileLayer.tileLayer, TileLayer: tileLayer.TileLayer, styleLayer: styleLayer.styleLayer, @@ -16587,10 +16587,10 @@ L.mapbox = module.exports = { FeatureLayer: featureLayer.FeatureLayer, map: map.map, Map: map.Map, - config: __webpack_require__(81), - sanitize: __webpack_require__(78), - template: __webpack_require__(299).to_html, - feedback: __webpack_require__(280) + config: __webpack_require__(86), + sanitize: __webpack_require__(83), + template: __webpack_require__(335).to_html, + feedback: __webpack_require__(316) }; @@ -16602,18 +16602,18 @@ window.L.Icon.Default.imagePath = ((document.location.protocol === 'https:' || document.location.protocol === 'http:') ? '' : 'https:') + '//api.tiles.mapbox.com/mapbox.js/' + 'v' + - __webpack_require__(82).version + '/images'; + __webpack_require__(87).version + '/images'; /***/ }), -/* 360 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var geocoder = __webpack_require__(297), - util = __webpack_require__(77); +var geocoder = __webpack_require__(333), + util = __webpack_require__(82); var GeocoderControl = L.Control.extend({ includes: L.Mixin.Events, @@ -16817,7 +16817,7 @@ module.exports.geocoderControl = function(_, options) { /***/ }), -/* 361 */ +/* 397 */ /***/ (function(module, exports) { module.exports = Array.isArray || function (arr) { @@ -16826,7 +16826,7 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 362 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { function corslite(url, callback, cors) { @@ -16925,21 +16925,21 @@ if (true) module.exports = corslite; /***/ }), -/* 363 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var tileLayer = __webpack_require__(304).tileLayer, - featureLayer = __webpack_require__(300).featureLayer, - gridLayer = __webpack_require__(306).gridLayer, - gridControl = __webpack_require__(298).gridControl, - infoControl = __webpack_require__(305).infoControl, - shareControl = __webpack_require__(303).shareControl, - legendControl = __webpack_require__(302).legendControl, - mapboxLogoControl = __webpack_require__(365).mapboxLogoControl, - feedback = __webpack_require__(280); +var tileLayer = __webpack_require__(340).tileLayer, + featureLayer = __webpack_require__(336).featureLayer, + gridLayer = __webpack_require__(342).gridLayer, + gridControl = __webpack_require__(334).gridControl, + infoControl = __webpack_require__(341).infoControl, + shareControl = __webpack_require__(339).shareControl, + legendControl = __webpack_require__(338).legendControl, + mapboxLogoControl = __webpack_require__(401).mapboxLogoControl, + feedback = __webpack_require__(316); function withAccessToken(options, accessToken) { if (!accessToken || options.accessToken) @@ -16948,7 +16948,7 @@ function withAccessToken(options, accessToken) { } var LMap = L.Map.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { tileLayer: {}, @@ -16958,7 +16958,7 @@ var LMap = L.Map.extend({ gridControl: {}, infoControl: false, shareControl: false, - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, _tilejson: {}, @@ -17166,7 +17166,7 @@ module.exports.map = function(element, _, options) { /***/ }), -/* 364 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17189,7 +17189,7 @@ module.exports = function(data) { /***/ }), -/* 365 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17228,20 +17228,20 @@ module.exports.mapboxLogoControl = function(options) { /***/ }), -/* 366 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77); -var format_url = __webpack_require__(79); -var request = __webpack_require__(272); +var util = __webpack_require__(82); +var format_url = __webpack_require__(84); +var request = __webpack_require__(308); var StyleLayer = L.TileLayer.extend({ options: { - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(_, options) { @@ -17316,7 +17316,7 @@ module.exports.styleLayer = function(_, options) { /***/ }), -/* 367 */ +/* 403 */ /***/ (function(module, exports) { @@ -17324,35 +17324,35 @@ module.exports.DEFAULT_ENDPOINT = 'https://api.mapbox.com'; /***/ }), -/* 368 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var rest = __webpack_require__(370); +var rest = __webpack_require__(406); // rest.js client with MIME support module.exports = function(config) { return rest - .wrap(__webpack_require__(372)) - .wrap(__webpack_require__(309), { prefix: config.endpoint }) - .wrap(__webpack_require__(374), { mime: 'application/json' }) - .wrap(__webpack_require__(312)) - .wrap(__webpack_require__(383), { + .wrap(__webpack_require__(408)) + .wrap(__webpack_require__(345), { prefix: config.endpoint }) + .wrap(__webpack_require__(410), { mime: 'application/json' }) + .wrap(__webpack_require__(348)) + .wrap(__webpack_require__(419), { params: { access_token: config.accessToken } }) - .wrap(__webpack_require__(384), { access_token: config.accessToken }) - .wrap(__webpack_require__(391)) - .wrap(__webpack_require__(392)); + .wrap(__webpack_require__(420), { access_token: config.accessToken }) + .wrap(__webpack_require__(427)) + .wrap(__webpack_require__(428)); }; /***/ }), -/* 369 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global) {/*! @@ -18535,10 +18535,10 @@ return Promise$1; //# sourceMappingURL=es6-promise.map -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(5))) /***/ }), -/* 370 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18551,8 +18551,8 @@ return Promise$1; -var rest = __webpack_require__(307), - browser = __webpack_require__(371); +var rest = __webpack_require__(343), + browser = __webpack_require__(407); rest.setPlatformDefaultClient(browser); @@ -18560,7 +18560,7 @@ module.exports = rest; /***/ }), -/* 371 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18575,9 +18575,9 @@ module.exports = rest; var normalizeHeaderName, responsePromise, client, headerSplitRE; -normalizeHeaderName = __webpack_require__(308); -responsePromise = __webpack_require__(283); -client = __webpack_require__(282); +normalizeHeaderName = __webpack_require__(344); +responsePromise = __webpack_require__(319); +client = __webpack_require__(318); // according to the spec, the line break is '\r\n', but doesn't hold true in practice headerSplitRE = /[\r|\n]+/; @@ -18734,7 +18734,7 @@ module.exports = client(function xhr(request) { /***/ }), -/* 372 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18749,7 +18749,7 @@ module.exports = client(function xhr(request) { var interceptor; -interceptor = __webpack_require__(270); +interceptor = __webpack_require__(306); /** * Rejects the response promise based on the status code. @@ -18777,7 +18777,7 @@ module.exports = interceptor({ /***/ }), -/* 373 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18792,8 +18792,8 @@ module.exports = interceptor({ var mixin, xWWWFormURLEncoder, origin, urlRE, absoluteUrlRE, fullyQualifiedUrlRE; -mixin = __webpack_require__(276); -xWWWFormURLEncoder = __webpack_require__(310); +mixin = __webpack_require__(312); +xWWWFormURLEncoder = __webpack_require__(346); urlRE = /([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?(\/[^?#]*)?(\?[^#]*)?(#\S*)?/i; absoluteUrlRE = /^([a-z][a-z0-9\-\+\.]*:\/\/|\/)/i; @@ -19000,7 +19000,7 @@ module.exports = UrlBuilder; /***/ }), -/* 374 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19015,10 +19015,10 @@ module.exports = UrlBuilder; var interceptor, mime, registry, noopConverter, missingConverter, attempt; -interceptor = __webpack_require__(270); -mime = __webpack_require__(311); -registry = __webpack_require__(375); -attempt = __webpack_require__(313); +interceptor = __webpack_require__(306); +mime = __webpack_require__(347); +registry = __webpack_require__(411); +attempt = __webpack_require__(349); noopConverter = { read: function (obj) { return obj; }, @@ -19116,7 +19116,7 @@ module.exports = interceptor({ /***/ }), -/* 375 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19131,7 +19131,7 @@ module.exports = interceptor({ var mime, registry; -mime = __webpack_require__(311); +mime = __webpack_require__(347); function Registry(mimes) { @@ -19215,11 +19215,11 @@ function Registry(mimes) { registry = new Registry({}); // include provided serializers -registry.register('application/hal', __webpack_require__(376)); -registry.register('application/json', __webpack_require__(380)); -registry.register('application/x-www-form-urlencoded', __webpack_require__(310)); -registry.register('multipart/form-data', __webpack_require__(381)); -registry.register('text/plain', __webpack_require__(382)); +registry.register('application/hal', __webpack_require__(412)); +registry.register('application/json', __webpack_require__(416)); +registry.register('application/x-www-form-urlencoded', __webpack_require__(346)); +registry.register('multipart/form-data', __webpack_require__(417)); +registry.register('text/plain', __webpack_require__(418)); registry.register('+json', registry.delegate('application/json')); @@ -19227,7 +19227,7 @@ module.exports = registry; /***/ }), -/* 376 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19242,11 +19242,11 @@ module.exports = registry; var pathPrefix, template, find, lazyPromise, responsePromise; -pathPrefix = __webpack_require__(309); -template = __webpack_require__(312); -find = __webpack_require__(378); -lazyPromise = __webpack_require__(379); -responsePromise = __webpack_require__(283); +pathPrefix = __webpack_require__(345); +template = __webpack_require__(348); +find = __webpack_require__(414); +lazyPromise = __webpack_require__(415); +responsePromise = __webpack_require__(319); function defineProperty(obj, name, value) { Object.defineProperty(obj, name, { @@ -19362,7 +19362,7 @@ module.exports = { /***/ }), -/* 377 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19539,7 +19539,7 @@ module.exports = { /***/ }), -/* 378 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19577,7 +19577,7 @@ module.exports = { /***/ }), -/* 379 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19590,7 +19590,7 @@ module.exports = { -var attempt = __webpack_require__(313); +var attempt = __webpack_require__(349); /** * Create a promise whose work is started only when a handler is registered. @@ -19630,7 +19630,7 @@ module.exports = lazyPromise; /***/ }), -/* 380 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19674,7 +19674,7 @@ module.exports = createConverter(); /***/ }), -/* 381 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19745,7 +19745,7 @@ module.exports = { /***/ }), -/* 382 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19772,7 +19772,7 @@ module.exports = { /***/ }), -/* 383 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19787,8 +19787,8 @@ module.exports = { var interceptor, mixinUtil, defaulter; -interceptor = __webpack_require__(270); -mixinUtil = __webpack_require__(276); +interceptor = __webpack_require__(306); +mixinUtil = __webpack_require__(312); defaulter = (function () { @@ -19848,19 +19848,19 @@ module.exports = interceptor({ /***/ }), -/* 384 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var interceptor = __webpack_require__(270); -var linkParser = __webpack_require__(385); -var url = __webpack_require__(386); -var querystring = __webpack_require__(314); +var interceptor = __webpack_require__(306); +var linkParser = __webpack_require__(421); +var url = __webpack_require__(422); +var querystring = __webpack_require__(350); var paginator = interceptor({ success: function (response, config) { @@ -19894,7 +19894,7 @@ module.exports = paginator; /***/ }), -/* 385 */ +/* 421 */ /***/ (function(module, exports) { module.exports = (function(){ @@ -21087,7 +21087,7 @@ module.exports = (function(){ /***/ }), -/* 386 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21114,8 +21114,8 @@ module.exports = (function(){ -var punycode = __webpack_require__(387); -var util = __webpack_require__(388); +var punycode = __webpack_require__(423); +var util = __webpack_require__(424); exports.parse = urlParse; exports.resolve = urlResolve; @@ -21190,7 +21190,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i, 'gopher:': true, 'file:': true }, - querystring = __webpack_require__(314); + querystring = __webpack_require__(350); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; @@ -21826,7 +21826,7 @@ Url.prototype.parseHost = function() { /***/ }), -/* 387 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ @@ -22362,10 +22362,10 @@ Url.prototype.parseHost = function() { }(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5))) /***/ }), -/* 388 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22388,7 +22388,7 @@ module.exports = { /***/ }), -/* 389 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22479,7 +22479,7 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 390 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22571,10 +22571,10 @@ var objectKeys = Object.keys || function (obj) { /***/ }), -/* 391 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { -var interceptor = __webpack_require__(270); +var interceptor = __webpack_require__(306); var standardResponse = interceptor({ response: transform, @@ -22596,16 +22596,16 @@ module.exports = standardResponse; /***/ }), -/* 392 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var interceptor = __webpack_require__(270); +var interceptor = __webpack_require__(306); var callbackify = interceptor({ success: function (response) { @@ -22634,7 +22634,7 @@ module.exports = callbackify; /***/ }), -/* 393 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22787,14 +22787,14 @@ module.exports = { /***/ }), -/* 394 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxGeocoding @@ -23065,15 +23065,15 @@ module.exports = MapboxGeocoding; /***/ }), -/* 395 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxSurface @@ -23170,15 +23170,15 @@ module.exports = MapboxSurface; /***/ }), -/* 396 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxDirections @@ -23354,14 +23354,14 @@ module.exports = MapboxDirections; /***/ }), -/* 397 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxUploads @@ -23581,14 +23581,14 @@ MapboxUploads.prototype.deleteUpload = function(upload, callback) { /***/ }), -/* 398 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxMatching @@ -23723,15 +23723,15 @@ module.exports = MapboxMatching; /***/ }), -/* 399 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var hat = __webpack_require__(400); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var hat = __webpack_require__(436); +var makeService = __webpack_require__(303); /** * @class MapboxDatasets @@ -24168,7 +24168,7 @@ MapboxDatasets.prototype.deleteFeature = function(id, dataset, callback) { /***/ }), -/* 400 */ +/* 436 */ /***/ (function(module, exports) { /* eslint-disable */ @@ -24211,15 +24211,15 @@ var hat = module.exports = function (bits, base) { /***/ }), -/* 401 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxMatrix @@ -24337,14 +24337,14 @@ module.exports = MapboxMatrix; /***/ }), -/* 402 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTilestats @@ -24440,15 +24440,15 @@ MapboxTilestats.prototype.putTilestats = function(tileset, statistics, callback) /***/ }), -/* 403 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Buffer) { -var invariant = __webpack_require__(266); -var uriTemplate = __webpack_require__(284); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var uriTemplate = __webpack_require__(320); +var makeService = __webpack_require__(303); /** * @class MapboxStyles @@ -24818,10 +24818,10 @@ MapboxStyles.prototype.embedStyle = function(styleid, options) { return this.endpoint + uriTemplate.expand(API_STYLES_EMBED, params); }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(404).Buffer)) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(440).Buffer)) /***/ }), -/* 404 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24835,9 +24835,9 @@ MapboxStyles.prototype.embedStyle = function(styleid, options) { -var base64 = __webpack_require__(405) -var ieee754 = __webpack_require__(406) -var isArray = __webpack_require__(407) +var base64 = __webpack_require__(441) +var ieee754 = __webpack_require__(442) +var isArray = __webpack_require__(443) exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer @@ -26615,10 +26615,10 @@ function isnan (val) { return val !== val // eslint-disable-line no-self-compare } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/* 405 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26776,7 +26776,7 @@ function fromByteArray (uint8) { /***/ }), -/* 406 */ +/* 442 */ /***/ (function(module, exports) { exports.read = function (buffer, offset, isLE, mLen, nBytes) { @@ -26866,7 +26866,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { /***/ }), -/* 407 */ +/* 443 */ /***/ (function(module, exports) { var toString = {}.toString; @@ -26877,18 +26877,18 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 408 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var xtend = __webpack_require__(316).extend; -var uriTemplate = __webpack_require__(284); -var encodeOverlay = __webpack_require__(409); -var invariantLocation = __webpack_require__(286); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var xtend = __webpack_require__(352).extend; +var uriTemplate = __webpack_require__(320); +var encodeOverlay = __webpack_require__(445); +var invariantLocation = __webpack_require__(322); +var makeService = __webpack_require__(303); /** * @class MapboxStatic @@ -27096,15 +27096,15 @@ module.exports = MapboxStatic; /***/ }), -/* 409 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266), - invariantLocation = __webpack_require__(286), - polyline = __webpack_require__(410); +var invariant = __webpack_require__(302), + invariantLocation = __webpack_require__(322), + polyline = __webpack_require__(446); /** * Given a list of markers, encode them for display @@ -27162,7 +27162,7 @@ module.exports.encodeGeoJSON = encodeGeoJSON; /***/ }), -/* 410 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27254,14 +27254,14 @@ module.exports = polyline; /***/ }), -/* 411 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTilesets @@ -27345,14 +27345,14 @@ MapboxTilesets.prototype.listTilesets = function(options, callback) { /***/ }), -/* 412 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTokens @@ -27566,13 +27566,13 @@ MapboxTokens.prototype.listScopes = function(callback) { /***/ }), -/* 413 */ +/* 449 */ /***/ (function(module, exports) { module.exports = {"_args":[["mapbox-gl-circle@1.6.5","/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client"]],"_from":"mapbox-gl-circle@1.6.5","_id":"mapbox-gl-circle@1.6.5","_inBundle":false,"_integrity":"sha512-VHA6lgxZE/WFtBXmMveU2zt7ZeVcBHe42k4U4b8xGEnrDSQs4/++EBPVywEMNqi01XQrbf1eiAhsIDZasR4drw==","_location":"/mapbox-gl-circle","_phantomChildren":{"@mapbox/geojson-area":"0.2.2","@mapbox/gl-matrix":"0.0.1","@mapbox/mapbox-gl-supported":"1.4.0","@mapbox/point-geometry":"0.1.0","@mapbox/shelf-pack":"3.2.0","@mapbox/tiny-sdf":"1.1.0","@mapbox/unitbezier":"0.0.0","@mapbox/vector-tile":"1.3.1","@mapbox/whoots-js":"3.1.0","brfs":"1.6.1","bubleify":"0.7.0","concat-stream":"1.6.2","csscolorparser":"1.0.3","earcut":"2.1.3","geojson-vt":"3.2.1","gray-matter":"3.1.1","grid-index":"1.1.0","jsonlint-lines-primitives":"1.6.0","minimist":"0.0.8","package-json-versionify":"1.0.4","pbf":"3.2.0","quickselect":"1.1.1","rw":"1.3.3","sharkdown":"0.1.1","shuffle-seed":"1.1.6","sort-object":"0.3.2","through2":"2.0.3","tinyqueue":"1.2.3","unassertify":"2.1.1","unflowify":"1.0.1","vt-pbf":"3.1.1","webworkify":"1.5.0"},"_requested":{"type":"version","registry":true,"raw":"mapbox-gl-circle@1.6.5","name":"mapbox-gl-circle","escapedName":"mapbox-gl-circle","rawSpec":"1.6.5","saveSpec":null,"fetchSpec":"1.6.5"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/mapbox-gl-circle/-/mapbox-gl-circle-1.6.5.tgz","_spec":"1.6.5","_where":"/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client","author":{"name":"Smith Micro Software, Inc."},"browserify":{"transform":["babelify"]},"bugs":{"url":"https://github.com/smithmicro/mapbox-gl-circle/issues"},"dependencies":{"@turf/bbox":"^4.7.3","@turf/bbox-polygon":"^4.7.3","@turf/bearing":"^4.5.2","@turf/circle":"^4.7.3","@turf/destination":"^4.7.3","@turf/distance":"^4.7.3","@turf/helpers":"^4.7.3","@turf/truncate":"^4.7.3","core-util-is":"^1.0.2","debug":"^3.0.0","events":"^1.1.1","fsevents":"^1.1.2","glob":"^7.1.2","inflight":"^1.0.6","inherits":"^2.0.3","jsonparse":"^1.3.1","lodash":"^4.17.5","lodash.debounce":"^4.0.8","mapbox-gl":"^0.44.1","minimatch":"^3.0.4","once":"^1.4.0","punycode":"^2.1.0","readable-stream":"^2.3.3","string_decoder":"^1.0.3","through2":"^2.0.3","util-deprecate":"^1.0.2","wrappy":"^1.0.2","xtend":"^4.0.1","yarn":"^0.27.5"},"description":"A google.maps.Circle replacement for Mapbox GL JS API","devDependencies":{"async-each":"^1.0.1","babel-preset-es2015":"^6.24.1","babelify":"^7.3.0","brfs":"^1.4.4","browserify":"^14.5.0","buble":"^0.15.2","budo":"^10.0.4","documentation":"^5.1.0","eslint":"^4.18.1","eslint-config-google":"^0.9.1","esutils":"^2.0.2","magic-string":"^0.22.4","uglify-js":"^3.3.12","vlq":"^0.2.3","watchify":"^3.10.0"},"directories":{"example":"example","lib":"lib"},"engines":{"node":">=7.6.0","npm":">=5.3.0"},"files":["lib/","example/","dist/"],"homepage":"https://github.com/smithmicro/mapbox-gl-circle#readme","keywords":["mapbox","circle","osm","gl"],"license":"ISC","main":"lib/main.js","name":"mapbox-gl-circle","optionalDependencies":{"core-util-is":"^1.0.2","debug":"^3.0.0","fsevents":"^1.1.2","glob":"^7.1.2","inflight":"^1.0.6","inherits":"^2.0.3","jsonparse":"^1.3.1","minimatch":"^3.0.4","once":"^1.4.0","punycode":"^2.1.0","readable-stream":"^2.3.3","string_decoder":"^1.0.3","through2":"^2.0.3","util-deprecate":"^1.0.2","wrappy":"^1.0.2","xtend":"^4.0.1","yarn":"^0.27.5"},"repository":{"type":"git","url":"git+ssh://git@github.com/smithmicro/mapbox-gl-circle.git"},"scripts":{"browserify":"mkdir -p dist && browserify lib/main.js -o dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.js --debug --delay=0 -v","docs":"documentation lint lib/main.js && documentation readme lib/main.js --access public --section=Usage","lint":"eslint lib","prepare":"mkdir -p dist && browserify --standalone MapboxCircle -t [ babelify --presets [ es2015 ] ] lib/main.js | uglifyjs -c -m > dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.min.js && cp -f dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.min.js dist/mapbox-gl-circle.min.js","start":"budo example/index.js --live --force-default-index --title budo/mapbox-gl-circle --verbose -- -t brfs","watchify":"mkdir -p dist && watchify lib/main.js -o dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.js --debug -v"},"version":"1.6.5"} /***/ }), -/* 414 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -44689,322 +44689,14 @@ module.exports = {"_args":[["mapbox-gl-circle@1.6.5","/home/esokia-6/work/work41 } }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/* 415 */ -/***/ (function(module, exports) { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; -}; - -EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - - -/***/ }), -/* 416 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { -var destination = __webpack_require__(317); -var polygon = __webpack_require__(273).polygon; +var destination = __webpack_require__(353); +var polygon = __webpack_require__(309).polygon; /** * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision. @@ -45048,10 +44740,10 @@ module.exports = function (center, radius, steps, units, properties) { /***/ }), -/* 417 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { -var coordEach = __webpack_require__(318).coordEach; +var coordEach = __webpack_require__(354).coordEach; /** * Takes a set of features, calculates the bbox of all input features, and returns a bounding box. @@ -45080,10 +44772,10 @@ module.exports = function (geojson) { /***/ }), -/* 418 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { -var polygon = __webpack_require__(273).polygon; +var polygon = __webpack_require__(309).polygon; /** * Takes a bbox and returns an equivalent {@link Polygon|polygon}. @@ -45116,10 +44808,10 @@ module.exports = function (bbox) { /***/ }), -/* 419 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { -var coordEach = __webpack_require__(318).coordEach; +var coordEach = __webpack_require__(354).coordEach; /** * Takes a GeoJSON Feature or FeatureCollection and truncates the precision of the geometry. @@ -45186,11 +44878,11 @@ function truncate(coords, factor, coordinates) { /***/ }), -/* 420 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { -var getCoord = __webpack_require__(287).getCoord; -var radiansToDistance = __webpack_require__(273).radiansToDistance; +var getCoord = __webpack_require__(323).getCoord; +var radiansToDistance = __webpack_require__(309).radiansToDistance; //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html @@ -45233,10 +44925,10 @@ module.exports = function (from, to, units) { /***/ }), -/* 421 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { -var getCoord = __webpack_require__(287).getCoord; +var getCoord = __webpack_require__(323).getCoord; //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html diff --git a/Phraseanet-production-client/dist/lazy-3.min.js b/Phraseanet-production-client/dist/lazy-3.min.js index b9d41b1824..7702ea9917 100644 --- a/Phraseanet-production-client/dist/lazy-3.min.js +++ b/Phraseanet-production-client/dist/lazy-3.min.js @@ -1,19 +1,19 @@ -webpackJsonpapp([3],Array(259).concat([ -/* 259 */ +webpackJsonpapp([3],Array(295).concat([ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var leaflet = __webpack_require__(358); +var leaflet = __webpack_require__(394); -__webpack_require__(359); +__webpack_require__(395); module.exports = leaflet; /***/ }), -/* 260 */ +/* 296 */ /***/ (function(module, exports) { /* @@ -27,7 +27,7 @@ module.exports = leaflet; L.DomEvent.off(this._container,"touchmove",this._onTouchMove),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(t,e){var i={};if("undefined"!=typeof t.touches){if(!t.touches.length)return;i=t.touches[0]}else{if("touch"!==t.pointerType)return;if(i=t,!this._filterClick(t))return}var o=this._map.mouseEventToContainerPoint(i),n=this._map.mouseEventToLayerPoint(i),s=this._map.layerPointToLatLng(n);this._map.fire(e,{latlng:s,layerPoint:n,containerPoint:o,pageX:i.pageX,pageY:i.pageY,originalEvent:t})},_filterClick:function(t){var e=t.timeStamp||t.originalEvent.timeStamp,i=L.DomEvent._lastClick&&e-L.DomEvent._lastClick;return i&&i>100&&500>i||t.target._simulatedClick&&!t._simulated?(L.DomEvent.stop(t),!1):(L.DomEvent._lastClick=e,!0)},_onTouchStart:function(t){if(this._map._loaded){var e="touchstart";this._touchEvent(t,e)}},_onTouchEnd:function(t){if(this._map._loaded){var e="touchend";this._touchEvent(t,e)}},_onTouchCancel:function(t){if(this._map._loaded){var e="touchcancel";this._detectIE()&&(e="pointercancel"),this._touchEvent(t,e)}},_onTouchLeave:function(t){if(this._map._loaded){var e="touchleave";this._touchEvent(t,e)}},_onTouchMove:function(t){if(this._map._loaded){var e="touchmove";this._touchEvent(t,e)}},_detectIE:function(){var e=t.navigator.userAgent,i=e.indexOf("MSIE ");if(i>0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var o=e.indexOf("Trident/");if(o>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):!1}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e.concat(["touchcancel"]),L.DomUtil.addClass(t,"leaflet-clickable"),L.DomEvent.on(t,"click",this._onMouseClick,this),L.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i0)return parseInt(e.substring(i+5,e.indexOf(".",i)),10);var o=e.indexOf("Trident/");if(o>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):!1}}),L.LatLngUtil={cloneLatLngs:function(t){for(var e=[],i=0,o=t.length;o>i;i++)e.push(this.cloneLatLng(t[i]));return e},cloneLatLng:function(t){return L.latLng(t.lat,t.lng)}},L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t){var e,i,o=t.length,n=0,s=L.LatLng.DEG_TO_RAD;if(o>2){for(var a=0;o>a;a++)e=t[a],i=t[(a+1)%o],n+=(i.lng-e.lng)*s*(2+Math.sin(e.lat*s)+Math.sin(i.lat*s));n=6378137*n*6378137/2}return Math.abs(n)},readableArea:function(t,e){var i;return e?i=t>=1e4?(1e-4*t).toFixed(2)+" ha":t.toFixed(2)+" m²":(t/=.836127,i=t>=3097600?(t/3097600).toFixed(2)+" mi²":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd²"),i},readableDistance:function(t,e,i){var o;if(e)o=t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m";else if(t*=1.09361,t>1760)o=(t/1760).toFixed(2)+" miles";else{var n=" yd";i&&(t=3*t,n=" ft"),o=Math.ceil(t)+n}return o}}),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t,e,i,o){return this._checkCounterclockwise(t,i,o)!==this._checkCounterclockwise(e,i,o)&&this._checkCounterclockwise(t,e,i)!==this._checkCounterclockwise(t,e,o)},_checkCounterclockwise:function(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}}),L.Polyline.include({intersects:function(){var t,e,i,o=this._originalPoints,n=o?o.length:0;if(this._tooFewPointsForIntersection())return!1;for(t=n-1;t>=3;t--)if(e=o[t-1],i=o[t],this._lineSegmentsIntersectsRange(e,i,t-2))return!0;return!1},newLatLngIntersects:function(t,e){return this._map?this.newPointIntersects(this._map.latLngToLayerPoint(t),e):!1},newPointIntersects:function(t,e){var i=this._originalPoints,o=i?i.length:0,n=i?i[o-1]:null,s=o-2;return this._tooFewPointsForIntersection(1)?!1:this._lineSegmentsIntersectsRange(n,t,s,e?1:0)},_tooFewPointsForIntersection:function(t){var e=this._originalPoints,i=e?e.length:0;return i+=t||0,!this._originalPoints||3>=i},_lineSegmentsIntersectsRange:function(t,e,i,o){var n,s,a=this._originalPoints;o=o||0;for(var r=i;r>o;r--)if(n=a[r-1],s=a[r],L.LineUtil.segmentsIntersect(t,e,n,s))return!0;return!1}}),L.Polygon.include({intersects:function(){var t,e,i,o,n,s=this._originalPoints;return this._tooFewPointsForIntersection()?!1:(t=L.Polyline.prototype.intersects.call(this))?!0:(e=s.length,i=s[0],o=s[e-1],n=e-2,this._lineSegmentsIntersectsRange(o,i,n,1))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,t);var e;this._toolbars={},L.DrawToolbar&&this.options.draw&&(e=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t){var e,i=L.DomUtil.create("div","leaflet-draw"),o=!1,n="leaflet-draw-toolbar-top";for(var s in this._toolbars)this._toolbars.hasOwnProperty(s)&&(e=this._toolbars[s].addToolbar(t),e&&(o||(L.DomUtil.hasClass(e,n)||L.DomUtil.addClass(e.childNodes[0],n),o=!0),i.appendChild(e)));return i},onRemove:function(){for(var t in this._toolbars)this._toolbars.hasOwnProperty(t)&&this._toolbars[t].removeToolbar()},setDrawingOptions:function(t){for(var e in this._toolbars)this._toolbars[e]instanceof L.DrawToolbar&&this._toolbars[e].setOptions(t)},_toolbarEnabled:function(t){var e=t.target;for(var i in this._toolbars)this._toolbars[i]!==e&&this._toolbars[i].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(t){L.setOptions(this,t),this._modes={},this._actionButtons=[],this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t){var e,i=L.DomUtil.create("div","leaflet-draw-section"),o=0,n=this._toolbarClass||"",s=this.getModeHandlers(t);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t,e=0;ee;e++)this._disposeButton(this._actionButtons[e].button,this._actionButtons[e].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t,e,i,o,n){var s=t.type;this._modes[s]={},this._modes[s].handler=t,this._modes[s].button=this._createButton({type:s,title:n,className:o+"-"+s,container:e,callback:this._modes[s].handler.enable,context:this._modes[s].handler}),this._modes[s].buttonIndex=i,this._modes[s].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_createButton:function(t){var e=L.DomUtil.create("a",t.className||"",t.container);return e.href="#",t.text&&(e.innerHTML=t.text),t.title&&(e.title=t.title),L.DomEvent.on(e,"click",L.DomEvent.stopPropagation).on(e,"mousedown",L.DomEvent.stopPropagation).on(e,"dblclick",L.DomEvent.stopPropagation).on(e,"click",L.DomEvent.preventDefault).on(e,"click",t.callback,t.context),e},_disposeButton:function(t,e){L.DomEvent.off(t,"click",L.DomEvent.stopPropagation).off(t,"mousedown",L.DomEvent.stopPropagation).off(t,"dblclick",L.DomEvent.stopPropagation).off(t,"click",L.DomEvent.preventDefault).off(t,"click",e)},_handlerActivated:function(t){this.disable(),this._activeMode=this._modes[t.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t){var e,i,o,n,s=this._actionsContainer,a=this.getActions(t),r=a.length;for(i=0,o=this._actionButtons.length;o>i;i++)this._disposeButton(this._actionButtons[i].button,this._actionButtons[i].callback);for(this._actionButtons=[];s.firstChild;)s.removeChild(s.firstChild);for(var h=0;r>h;h++)"enabled"in a[h]&&!a[h].enabled||(e=L.DomUtil.create("li","",s),n=this._createButton({title:a[h].title,text:a[h].text,container:e,callback:a[h].callback,context:a[h].context}),this._actionButtons.push({button:n,callback:a[h].callback}))},_showActionsToolbar:function(){var t=this._activeMode.buttonIndex,e=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i+"px",0===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t===e&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block"},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom")}}),L.Tooltip=L.Class.extend({initialize:function(t){this._map=t,this._popupPane=t._panes.popupPane,this._container=t.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t){return this._container?(t.subtext=t.subtext||"",0!==t.subtext.length||this._singleLineLabel?t.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(t.subtext.length>0?''+t.subtext+"
":"")+""+t.text+"",this):this},updatePosition:function(t){var e=this._map.latLngToLayerPoint(t),i=this._container;return this._container&&(i.style.visibility="inherit",L.DomUtil.setPosition(i,e)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{}},initialize:function(t){for(var e in this.options)this.options.hasOwnProperty(e)&&t[e]&&(t[e]=L.extend({},this.options[e],t[e]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t)},getModeHandlers:function(t){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker}]},getActions:function(t){return[{enabled:t.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t.completeShape,context:t},{enabled:t.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t.deleteLastVertex,context:t},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t){L.setOptions(this,t);for(var e in this._modes)this._modes.hasOwnProperty(e)&&t.hasOwnProperty(e)&&this._modes[e].handler.setOptions(t[e])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},featureGroup:null},initialize:function(t){t.edit&&("undefined"==typeof t.edit.selectedPathOptions&&(t.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t.edit.selectedPathOptions)),t.remove&&(t.remove=L.extend({},this.options.remove,t.remove)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t),this._selectedFeatureCount=0},getModeHandlers:function(t){var e=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t,{featureGroup:e,selectedPathOptions:this.options.edit.selectedPathOptions}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t,{featureGroup:e}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(){return[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}]},addToolbar:function(t){var e=L.Toolbar.prototype.addToolbar.call(this,t);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode.handler.disable()},_checkDisabled:function(){var t,e=this.options.featureGroup,i=0!==e.getLayers().length;this.options.edit&&(t=this._modes[L.EditToolbar.Edit.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t=this._modes[L.EditToolbar.Delete.TYPE].button,i?L.DomUtil.removeClass(t,"leaflet-disabled"):L.DomUtil.addClass(t,"leaflet-disabled"),t.setAttribute("title",i?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.setOptions(this,e),this._featureGroup=e.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:editstart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:editstop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Tooltip(this._map),this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on("click",this._editStyle,this).on("draw:editvertex",this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t){this._revertLayer(t)},this)},save:function(){var t=new L.LayerGroup;this._featureGroup.eachLayer(function(e){e.edited&&(t.addLayer(e),e.edited=!1)}),this._map.fire("draw:edited",{layers:t})},_backupLayer:function(t){var e=L.Util.stamp(t);this._uneditedLayerProps[e]||(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?this._uneditedLayerProps[e]={latlngs:L.LatLngUtil.cloneLatLngs(t.getLatLngs())}:t instanceof L.Circle?this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng()),radius:t.getRadius()}:t instanceof L.Marker&&(this._uneditedLayerProps[e]={latlng:L.LatLngUtil.cloneLatLng(t.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t){var e=L.Util.stamp(t);t.edited=!1,this._uneditedLayerProps.hasOwnProperty(e)&&(t instanceof L.Polyline||t instanceof L.Polygon||t instanceof L.Rectangle?t.setLatLngs(this._uneditedLayerProps[e].latlngs):t instanceof L.Circle?(t.setLatLng(this._uneditedLayerProps[e].latlng),t.setRadius(this._uneditedLayerProps[e].radius)):t instanceof L.Marker&&t.setLatLng(this._uneditedLayerProps[e].latlng),t.fire("revert-edited",{layer:t}))},_enableLayerEdit:function(t){var e,i=t.layer||t.target||t;this._backupLayer(i),this.options.selectedPathOptions&&(e=L.Util.extend({},this.options.selectedPathOptions),e.maintainColor&&(e.color=i.options.color,e.fillColor=i.options.fillColor),i.options.original=L.extend({},i.options),i.options.editing=e),this.isMarker?(i.dragging.enable(),i.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):i.editing.enable()},_disableLayerEdit:function(t){var e=t.layer||t.target||t;e.edited=!1,e.editing.disable(),delete e.options.editing,delete e.options.original,this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},includes:L.Mixin.Events,initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire("draw:deletestart",{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire("draw:deletestop",{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire("draw:deleted",{layers:this._deletedLayers})},_enableLayerDelete:function(t){var e=t.layer||t.target||t;e.on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document); /***/ }), -/* 261 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -42,7 +42,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ var L; if (true) { // AMD - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(296)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(332)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -562,27 +562,27 @@ for (i = 0, l = classes.length; i < l; i++) { /***/ }), -/* 262 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var makeClient = __webpack_require__(267); -var xtend = __webpack_require__(316).extendMutable; -var getUser = __webpack_require__(315); -var MapboxGeocoding = __webpack_require__(394); -var MapboxSurface = __webpack_require__(395); -var MapboxDirections = __webpack_require__(396); -var MapboxUploads = __webpack_require__(397); -var MapboxMatching = __webpack_require__(398); -var MapboxDatasets = __webpack_require__(399); -var MapboxMatrix = __webpack_require__(401); -var MapboxTilestats = __webpack_require__(402); -var MapboxStyles = __webpack_require__(403); -var MapboxStatic = __webpack_require__(408); -var MapboxTilesets = __webpack_require__(411); -var MapboxTokens = __webpack_require__(412); +var makeClient = __webpack_require__(303); +var xtend = __webpack_require__(352).extendMutable; +var getUser = __webpack_require__(351); +var MapboxGeocoding = __webpack_require__(430); +var MapboxSurface = __webpack_require__(431); +var MapboxDirections = __webpack_require__(432); +var MapboxUploads = __webpack_require__(433); +var MapboxMatching = __webpack_require__(434); +var MapboxDatasets = __webpack_require__(435); +var MapboxMatrix = __webpack_require__(437); +var MapboxTilestats = __webpack_require__(438); +var MapboxStyles = __webpack_require__(439); +var MapboxStatic = __webpack_require__(444); +var MapboxTilesets = __webpack_require__(447); +var MapboxTokens = __webpack_require__(448); /** @@ -628,7 +628,7 @@ module.exports = MapboxClient; /***/ }), -/* 263 */ +/* 299 */ /***/ (function(module, exports) { /** @@ -891,23 +891,23 @@ if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { /***/ }), -/* 264 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const projectVersion = __webpack_require__(413).version; -const _ = __webpack_require__(414); -const EventEmitter = __webpack_require__(415); -const turfCircle = __webpack_require__(416); -const turfBbox = __webpack_require__(417); -const turfBboxPoly = __webpack_require__(418); -const turfTruncate = __webpack_require__(419); -const turfDestination = __webpack_require__(317); -const turfDistance = __webpack_require__(420); -const turfBearing = __webpack_require__(421); -const turfHelpers = __webpack_require__(273); +const projectVersion = __webpack_require__(449).version; +const _ = __webpack_require__(450); +const EventEmitter = __webpack_require__(93); +const turfCircle = __webpack_require__(451); +const turfBbox = __webpack_require__(452); +const turfBboxPoly = __webpack_require__(453); +const turfTruncate = __webpack_require__(454); +const turfDestination = __webpack_require__(353); +const turfDistance = __webpack_require__(455); +const turfBearing = __webpack_require__(456); +const turfHelpers = __webpack_require__(309); if (window && typeof window.MapboxCircle === 'function') { throw new TypeError('mapbox-gl-circle-' + window.MapboxCircle.VERSION + ' already loaded'); @@ -2263,14 +2263,14 @@ module.exports = exports = MapboxCircle; /***/ }), -/* 265 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { !function(t,e){ true?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.turf={})}(this,function(t){"use strict";function e(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&N(r),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");i&&N(i);var s;switch(t){case"Point":s=r(e).geometry;break;case"LineString":s=a(e).geometry;break;case"Polygon":s=o(e).geometry;break;case"MultiPoint":s=l(e).geometry;break;case"MultiLineString":s=h(e).geometry;break;case"MultiPolygon":s=p(e).geometry;break;default:throw new Error(t+" is invalid")}return i&&(s.bbox=i),s}function r(t,n,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(t[0])||!b(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map(function(t){return r(t,e)}),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function y(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function _(t,e){return v(y(t,e))}function m(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null===t||void 0===t)throw new Error("radians is required");return 180*(t%(2*Math.PI))/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return d(y(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=Bo[e||"meters"];if(!r)throw new Error("invalid original units");var i=Bo[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function b(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function N(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!b(t))throw new Error("bbox must only contain numbers")})}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function S(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,h,l=0,p=0,f=t.type,g="FeatureCollection"===f,d="Feature"===f,y=g?t.features.length:1,_=0;_t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&b(e[0])&&b(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function U(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return Y(e),e;throw new Error("No valid coordinates")}function Y(t){if(t.length>1&&b(t[0])&&b(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Y(t[0]);throw new Error("coordinates must only contain numbers")}function V(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function H(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function W(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0;r=0&&d>=0&&d=0;h--)if(Math.abs(e[h][0][0]-u)<=1e-7&&Math.abs(e[h][0][1]-c)<=1e-7){for(var l=s.path.length-2;l>=0;--l)e[h].unshift(s.path[l]);a=!0;break}a||(e[n++]=s.path)}})}),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o=e?8:0,a|=c>=e?4:0,a|=h>=e?2:0;var p=!1;if(5===(a|=l>=e?1:0)||10===a){var f=(u+c+h+l)/4;5===a&&fe?1:0};r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);it(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(ot(t,n,e),i(t[r],h)>0&&ot(t,n,r);l0;)p--}0===i(t[n],h)?ot(t,n,p):ot(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function ot(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function st(t,e){if(!(this instanceof st))return new st(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function at(t,e){ut(t,0,t.children.length,e,t)}function ut(t,e,n,r,i){i||(i=yt(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s=t.minX&&e.maxY>=t.minY}function yt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _t(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Yo(t,o,e,n,i),s.push(e,o,o,n))}function mt(t,e){return e={exports:{}},t(e,e.exports),e.exports}function vt(t,e){if(!(this instanceof vt))return new vt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return te?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function xt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;oo||a.push({node:h,dist:l})}for(;a.length&&!a.peek().node.children;){var p=a.pop(),f=p.node,g=St(f,e,n),d=St(f,r,i);if(p.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u0!=os(t,e,r)>0&&os(n,r,t)>0!=os(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function It(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Nt(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function Ct(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function St(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return o=t[0]-r,s=t[1]-i,o*o+s*s}function Mt(t,e,n,r,i,o,s,a){var u,c,h,l,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,m=p*p+f*f,v=p*g+f*d,x=g*g+d*d,E=p*y+f*_,w=g*y+d*_,b=m*x-v*v,I=b,N=b;0===b?(c=0,I=1,l=w,N=x):(l=m*w-v*E,(c=v*w-x*E)<0?(c=0,l=w,N=x):c>I&&(c=I,l=w+v,N=x)),l<0?(l=0,-E<0?c=0:-E>m?c=I:(c=-E,I=m)):l>N&&(l=N,-E+v<0?c=0:-E+v>m?c=I:(c=-E+v,I=m)),u=0===c?0:c/I;var C=(1-(h=0===l?0:l/N))*i+h*s-((1-u)*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return C*C+S*S}function Lt(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(S(t,function(t){r.push([t[0],t[1]])}),!r.length)return null;var i=ss(r,n);return i.length>3?o([i]):null}function Pt(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=X(t),o=U(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var u=0,c=!1;ut[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Rt(t,e){var n=[];return A(e,function(e){O(t,function(t){Pt(t,e)&&n.push(t)})}),c(n)}function Tt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Dt);var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;for(;a--;)t[a].yl&&(l=t[a].y);var p,f=c-u,g=l-h,d=f>g?f:g,y=.5*(c+u),_=.5*(l+h),m=[new At({x:y-20*d,y:_-d,__sentinel:!0},{x:y,y:_+20*d,__sentinel:!0},{x:y+20*d,y:_-d,__sentinel:!0})],v=[],x=[];a=t.length;for(;a--;){for(x.length=0,p=m.length;p--;)(f=t[a].x-m[p].x)>0&&f*f>m[p].r?(v.push(m[p]),m.splice(p,1)):(g=t[a].y-m[p].y,f*f+g*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1)));for(Ft(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new At(e,n,r))}Array.prototype.push.apply(v,m),a=v.length;for(;a--;)(v[a].a.__sentinel||v[a].b.__sentinel||v[a].c.__sentinel)&&v.splice(a,1);return v}(t.features.map(function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r})).map(function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)}))}function At(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),h=a*(t.x+n.x)+u*(t.y+n.y),l=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*h)/l,this.y=(o*h-a*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Dt(t,e){return e.x-t.x}function Ft(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],i=t[--r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function qt(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units,i=X(t),o=X(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return d(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r)}function Gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Bt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return Bt(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return zt(t);default:throw new Error("unknown GeoJSON type")}}function Bt(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=kt(t.properties),e.geometry=zt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:r.length?e[n]=r.map(function(t){return t}):e[n]=kt(r):e[n]=r}),e):e}function zt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return zt(t)}),e):(e.coordinates=jt(t.coordinates),e)}function jt(t){return"object"!=typeof t[0]?t.slice():t.map(function(t){return jt(t)})}function Xt(t,e){function n(t,e){e.length&&e.pop();for(var n=c[t<0?~t:t],r=0,i=n.length;r1)for(var s,a,u=1,c=i(r[0]);uc&&(a=r[0],r[0]=r[u],r[u]=a,c=s);return r})}}function Yt(t,e,n){for(var r,i=e+(n---e>>1);e=Math.abs(h)?c>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function ne(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function re(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return o=t.x-r,s=t.y-i,o*o+s*s}function ie(t,e,n,r,i){for(var o,s=r,a=e+1;as&&(o=a,s=u)}s>r&&(o-e>1&&ie(t,e,o,r,i),i.push(t[o]),n-o>1&&ie(t,o,n,r,i))}function oe(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;oe&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),t=function(t,e){var n=t.length-1,r=[t[0]];return ie(t,0,n,e,r),r.push(t[n]),r}(t,r)}function se(t,e,n){return oe(t.map(function(t){return{x:t[0],y:t[1],z:t[2]}}),e,n).map(function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]})}function ae(t,e,n){return t.map(function(t){var r=t.map(function(t){return{x:t[0],y:t[1]}});if(r.length<4)throw new Error("invalid polygon");for(var i=oe(r,e,n).map(function(t){return[t.x,t.y]});!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=oe(r,e-=.01*e,n).map(function(t){return[t.x,t.y]});return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i})}function ue(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!b(n))throw new Error("resolution must be an number");if(!b(r))throw new Error("sharpness must be an number");for(var i=[],o=new bs({points:J(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),duration:n,sharpness:r}),s=0;s=qt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function pe(t,e,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");var o=i.units,s=i.properties,a=X(t),u=x(a[0]),c=x(a[1]),h=x(n),l=y(e,o),p=Math.asin(Math.sin(c)*Math.cos(l)+Math.cos(c)*Math.sin(l)*Math.cos(h));return r([v(u+Math.atan2(Math.sin(h)*Math.sin(l)*Math.cos(c),Math.cos(l)-Math.sin(c)*Math.sin(p))),v(p)],s)}function fe(t,e,n){var r=(n=n||{}).steps||64,i=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");r=r||64,i=i||t.properties||{};for(var s=[],a=0;a=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=h&&i!==r.x&&Ne(on.x)&&Le(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=Pe(e,t);Ee(n,n.next)}}(c[i],n),n=Ee(n,n.next);return n}(t,e,o,n)),t.length>80*n){a=c=t[0],u=h=t[1];for(var g=n;gc&&(c=l),p>h&&(h=p);f=0!==(f=Math.max(c-a,h-u))?1/f:0}return we(o,s,n,a,u,f),s}function xe(t,e,n,r,i){var o,s;if(i===Ae(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Oe(o,t[o],t[o+1],s);return s&&Se(s,s.next)&&(Re(s),s=s.next),s}function Ee(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Se(r,r.next)&&0!==Ce(r.prev,r,r.next))r=r.next;else{if(Re(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function we(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ie(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ce(i,o,s)>=0)return!1;var a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=Ie(a,u,e,n,r),p=Ie(c,h,e,n,r),f=t.nextZ;for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.nextZ}f=t.prevZ;for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,r,i,o):function(t){var e=t.prev,n=t,r=t.next;if(Ce(e,n,r)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(Ne(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ce(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),Re(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?we(t=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Se(i,o)&&Me(i,r,r.next,o)&&Le(i,o)&&Le(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Re(r),Re(r.next),r=t=o),r=r.next}while(r!==t);return r}(t,e,n),e,n,r,i,o,2):2===s&&function(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Me(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Le(t,e)&&Le(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}(s,a)){var u=Pe(s,a);return s=Ee(s,s.next),u=Ee(u,u.next),we(s,e,n,r,i,o),void we(u,e,n,r,i,o)}a=a.next}s=s.next}while(s!==t)}(t,e,n,r,i,o):we(Ee(t),e,n,r,i,o,1);break}}}function be(t,e){return t.x-e.x}function Ie(t,e,n,r,i){return t=32767*(t-n)*i,e=32767*(e-r)*i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Ne(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Ce(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Se(t,e){return t.x===e.x&&t.y===e.y}function Me(t,e,n,r){return!!(Se(t,e)&&Se(n,r)||Se(t,r)&&Se(n,e))||Ce(t,e,n)>0!=Ce(t,e,r)>0&&Ce(n,r,t)>0!=Ce(n,r,e)>0}function Le(t,e){return Ce(t.prev,t,t.next)<0?Ce(t,e,t.next)>=0&&Ce(t,t.prev,e)>=0:Ce(t,e,t.prev)<0||Ce(t,t.next,e)<0}function Pe(t,e){var n=new Te(t.i,t.x,t.y),r=new Te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Oe(t,e,n,r){var i=new Te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Te(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ae(t,e,n,r){for(var i=0,o=e,s=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Is(e.vertices,e.holes,2),r=[],i=[];n.forEach(function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])});for(var s=0;se?1:0})}function Ge(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Ge(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(Be(t,n,e),i(t[r],h)>0&&Be(t,n,r);l0;)p--}0===i(t[n],h)?Be(t,n,p):Be(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function Be(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function ze(t,e){je(t,0,t.children.length,e,t)}function je(t,e,n,r,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ke(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(qe(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Qe(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}else t.bbox=t.bbox?t.bbox:tn(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach(function(t){var n=$e(t);n.bbox=t,e.push(n)}):O(t,function(t){t.bbox=t.bbox?t.bbox:tn(t),e.push(t)}),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:tn(t),{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function $e(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function tn(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]i?n:i,r>o?r:o]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}(t,e)}),c(e)}function nn(t,n){var r={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===n.type&&(n=e(n)),"Feature"===t.type&&"Feature"===n.type&&"LineString"===t.geometry.type&&"LineString"===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=rn(t,n);return o&&i.push(o),c(i)}var s=Qe();return s.load(en(n)),O(en(t),function(t){O(s.search(t),function(e){var n=rn(t,e);if(n){var o=U(n).join(",");r[o]||(r[o]=!0,i.push(n))}})}),c(i)}function rn(t,e){var n=U(t),i=U(e);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],f=(p-h)*(a-o)-(l-c)*(u-s),g=(l-c)*(s-h)-(p-h)*(o-c),d=(a-o)*(s-h)-(u-s)*(o-c);if(0===f)return null;var y=g/f,_=d/f;if(y>=0&&y<=1&&_>=0&&_<=1){return r([o+y*(a-o),s+y*(u-s)])}return null}function on(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=r([1/0,1/0],{dist:1/0}),s=0;return F(t,function(t){for(var i=U(t),u=0;u0&&((_=y.features[0]).properties.dist=qt(e,_,n),_.properties.location=s+qt(c,_,n)),c.properties.dist180?-(360-i):i}function an(t,e){var n=x(t[1]),r=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function un(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=X(t),o=X(e);o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0;return E(function(t,e,n){var r=n=void 0===n?Fo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),"meters",r)}function cn(t,e){return ln(t,"mercator",e)}function hn(t,e){return ln(t,"wgs84",e)}function ln(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&b(t[0])?t="mercator"===e?pn(t):fn(t):(!0!==r&&(t=Gt(t)),S(t,function(t){var n="mercator"===e?pn(t):fn(t);t[0]=n[0],t[1]=n[1]})),t}function pn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function fn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function gn(t,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):H(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):H(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return G(n,function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?qt(e,t,i):dn(e,t,i),a=m(!0!==o?ge(e,t):sn(e,t)),u=m(!0!==o?ge(e,n):sn(e,n)),c=Math.abs(a-u);if(c>90)return s;var h=(u+180)%360,l=m(!0!==o?ge(n,t):sn(n,t)),p=Math.abs(l-h);p>180&&(p=Math.abs(p-360));return p>90?!0!==o?qt(t,n,i):dn(t,n,i):!0!==o?s*Math.sin(x(c)):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=cn([t[0]+o,t[1]]),u=cn([e[0]+o,e[1]]),c=cn([n[0]+o,n[1]]),h=hn(function(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1],a=n[0],u=n[1],c=o-r,h=s-i,l=((a-r)*c+(u-i)*h)/(c*c+h*h);return[r+l*c,i+l*h]}(a,u,c));return 0!==o&&(h[0]-=o),un(s,h,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)}),o}function dn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=cn([t[0]+i,t[1]]),s=cn([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return E(Math.sqrt(u),"meters",r)}function yn(t){for(var n=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?c([e(t)]):c([t]);return t}(t),i=de(n),o=!1,s=0;!o&&s0){e+=Math.abs(En(t[0]));for(var n=1;n2){for(s=0;s=h&&l===i.length-1);l++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[l]),a(o);u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates)}if(h>=n)return(s=n-h)?(u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[l]),a(o));if(h>=e&&o.push(i[l]),l===i.length-1)return a(o);h+=qt(i[l],i[l+1],r)}return a(i[i.length-1])}function Nn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=X(t),o=U(e),s=0;s=Math.abs(f)?p>0?s<=i&&i<=u:u<=i&&i<=s:f>0?a<=o&&o<=c:c<=o&&o<=a;if("start"===r)return Math.abs(p)>=Math.abs(f)?p>0?s0?a=Math.abs(f)?p>0?s<=i&&i0?a<=o&&o=Math.abs(f)?p>0?s0?ae[0])&&(!(t[2]e[1])&&!(t[3] is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return S(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r=0==e}function Tn(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n1&&n.push(a(l)),c(n)}function Fn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return O(e,function(e){var i=on(e,t).properties.dist;ip&&g.push(pe(t,e,p,s).geometry.coordinates),a(g,h)}function Bn(t){var e=t%360;return e<0&&(e+=360),e}function kn(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,r=K(t),i=U(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return zn(i,n);case"MultiPolygon":var o=[];return i.forEach(function(t){o.push(zn(t,n))}),c(o);default:throw new Error("geom "+r+" not supported")}}function zn(t,e){return t.length>1?h(t,e):a(t[0],e)}function jn(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");r=void 0===r||r,i=void 0===i||i;switch(K(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach(function(t){o.push(U(Xn(t,{},r,i)))}),p(o,n)}return Xn(t,n,r,i)}function Xn(t,e,n,r){e=e||t.properties||{};var i=U(t),s=K(t);if(!i.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(i=Un(i)),o([i],e);case"MultiLineString":var u=[],c=0;return i.forEach(function(t){if(n&&(t=Un(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(j(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)}),o(u,e);default:throw new Error("geometry type "+s+" is not supported")}}function Un(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Yn(t,e,n){var r,i,o,s,a,u=t.length,c=Hn(t[0],e),h=[];for(n||(n=[]),r=1;re[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Wn(t,e){for(var n=[],r=0;r0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Jn(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Zn(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):function(t,e,n){var r,i;if(Kn(t)||Kn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Jn(t))return!!Jn(e)&&(t=Bs.call(t),e=Bs.call(e),Zn(t,e,n));if(Qn(t)){if(!Qn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r=0;r--)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r--)if(i=o[r],!Zn(t[i],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function Kn(t){return null===t||void 0===t}function Qn(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function $n(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.tolerance||0,i=[],o=Qe();o.load(en(t));var s;return G(e,function(t){var e=!1;O(o.search(t),function(n){if(!1===e){var i=U(t).sort(),o=U(n).sort();Zn(i,o)?(e=!0,s=s?tr(s,t):t):(0===r?Nn(i[0],n)&&Nn(i[1],n):on(n,i[0]).properties.dist<=r&&on(n,i[1]).properties.dist<=r)?(e=!0,s=s?tr(s,t):t):(0===r?Nn(o[0],t)&&Nn(o[1],t):on(t,o[0]).properties.dist<=r&&on(t,o[1]).properties.dist<=r)&&(s=s?tr(s,n):n)}}),!1===e&&s&&(i.push(s),s=void 0)}),s&&i.push(s),c(i)}function tr(t,e){var n=U(e),r=U(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Zn(n[0],i)?s.unshift(n[1]):Zn(n[0],o)?s.push(n[1]):Zn(n[1],i)?s.unshift(n[0]):Zn(n[1],o)&&s.push(n[0]),t}function er(t){var e=t%360;return e<0&&(e+=360),e}function nr(t,e,n,i){if(i=i||{},!I(i))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var a=E(e,o,"meters"),u=X(t),c=function(t,e,n,r){r=void 0===r?Fo:Number(r);var i=e/r,o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),l=Math.abs(h)>1e-11?u/h:Math.cos(s),p=i*Math.sin(a)/l;return[(180*(o+p)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function rr(t,e,n,r,i,o){for(var s=0;s0?function(t,e,n){return ir(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return ir(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function ir(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function or(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=U(t),o=0,s=1;s0}function sr(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return A(t,function(t){sr(t,e)}),t;case"LineString":return ar(U(t),e),t;case"Polygon":return ur(U(t),e),t;case"MultiLineString":return U(t).forEach(function(t){ar(t,e)}),t;case"MultiPolygon":return U(t).forEach(function(t){ur(t,e)}),t;case"Point":case"MultiPoint":return t}}function ar(t,e){or(t)===e&&t.reverse()}function ur(t,e){or(t[0])!==e&&t[0].reverse();for(var n=1;ns?128:64,c|=ls?32:16,c|=ps?8:4;var g=+(c|=fs?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+l+p+f)/4;d=y>s?2:y0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var _,m,v,x,E,w,b,I;_=m=v=x=E=w=b=I=.5;var N=[];1===c?(v=1-lr(e,p,f),I=1-lr(e,h,f),N.push(Sa[c])):169===c?(v=lr(s,f,p),I=lr(s,f,h),N.push(Sa[c])):4===c?(w=1-lr(e,l,p),x=lr(e,f,p),N.push(Na[c])):166===c?(w=lr(s,p,l),x=1-lr(s,p,f),N.push(Na[c])):16===c?(E=lr(e,p,l),m=lr(e,h,l),N.push(Ia[c])):154===c?(E=1-lr(s,l,p),m=1-lr(s,l,h),N.push(Ia[c])):64===c?(b=lr(e,f,h),_=1-lr(e,l,h),N.push(La[c])):106===c?(b=1-lr(s,h,f),_=lr(s,h,l),N.push(La[c])):168===c?(x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Ca[c]),N.push(Sa[c])):2===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ca[c]),N.push(Sa[c])):162===c?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),N.push(Ca[c]),N.push(Sa[c])):8===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),N.push(Ia[c]),N.push(Na[c])):138===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):32===c?(E=lr(s,p,l),w=lr(e,p,l),_=lr(e,h,l),m=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):42===c?(I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Ma[c]),N.push(La[c])):128===c&&(I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ma[c]),N.push(La[c])),5===c?(w=1-lr(e,l,p),I=1-lr(e,h,f),N.push(Na[c])):165===c?(w=lr(s,p,l),I=lr(s,f,h),N.push(Na[c])):20===c?(x=lr(e,f,p),m=lr(e,h,l),N.push(Ca[c])):150===c?(x=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ca[c])):80===c?(E=lr(e,p,l),b=lr(e,f,h),N.push(Ia[c])):90===c?(E=1-lr(s,l,p),b=1-lr(s,h,f),N.push(Ia[c])):65===c?(v=1-lr(e,p,f),_=1-lr(e,l,h),N.push(Sa[c])):105===c?(v=lr(s,f,p),_=lr(s,h,l),N.push(Sa[c])):160===c?(E=lr(s,p,l),w=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):10===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):130===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):40===c?(x=lr(s,f,p),v=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Ca[c]),N.push(Sa[c])):101===c?(w=lr(s,p,l),_=lr(s,h,l),N.push(Na[c])):69===c?(w=1-lr(e,l,p),_=1-lr(e,l,h),N.push(Na[c])):149===c?(I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ma[c])):21===c?(I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ma[c])):86===c?(x=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ca[c])):84===c?(x=lr(e,f,p),b=lr(e,f,h),N.push(Ca[c])):89===c?(E=1-lr(s,l,p),v=lr(s,f,p),N.push(Sa[c])):81===c?(E=lr(e,p,l),v=1-lr(e,p,f),N.push(Sa[c])):96===c?(E=lr(s,p,l),w=lr(e,p,l),b=lr(e,f,h),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):74===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):24===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),m=lr(e,h,l),N.push(Ia[c]),N.push(Sa[c])):146===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Sa[c])):6===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Na[c]),N.push(Ca[c])):164===c?(w=lr(s,p,l),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Na[c]),N.push(Ca[c])):129===c?(v=1-lr(e,p,f),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Sa[c]),N.push(Ma[c])):41===c?(v=lr(s,f,p),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Sa[c]),N.push(Ma[c])):66===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):104===c?(x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Sa[c]),N.push(Pa[c])):144===c?(E=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(La[c])):26===c?(E=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(La[c])):36===c?(w=lr(s,p,l),x=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):134===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):9===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):161===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):37===c?(w=lr(s,p,l),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ma[c])):133===c?(w=1-lr(e,l,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ma[c])):148===c?(x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ca[c]),N.push(La[c])):22===c?(x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ca[c]),N.push(La[c])):82===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ia[c]),N.push(Sa[c])):88===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),N.push(Ia[c]),N.push(Sa[c])):73===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):97===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):145===c?(E=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Ma[c])):25===c?(E=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(Ma[c])):70===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):100===c?(w=lr(s,p,l),x=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):34===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):35===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c]),N.push(La[c])):136===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):153===c?(0===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c])):102===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(La[c])):155===c?(4===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ma[c])):103===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c])):152===c?(0===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ca[c]),N.push(Sa[c])):156===c?(4===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c]),N.push(La[c])):137===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):139===c?(4===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c])):98===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(La[c])):99===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):38===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):39===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c]),N.push(La[c])):85===c&&(E=1,w=0,x=1,v=0,I=0,b=1,_=0,m=1),(_<0||_>1||m<0||m>1||E<0||E>1||x<0||x>1||I<0||I>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+l+","+p+","+f+" "+d+" "+_+" "+m+" "+E+" "+w+" "+x+" "+v+" "+I+" "+b),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:_,topright:m,righttop:E,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:b,edges:N}}}}}return o}(t,e,n);return zs.polygons?(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach(function(t,r){t.forEach(function(t,i){if(void 0!==t){var o=Ra[t.cval](t);"object"==typeof o&&pr(o)?"object"==typeof o[0]&&pr(o[0])?"object"==typeof o[0][0]&&pr(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=t}):(o.forEach(function(t){t[0]+=i,t[1]+=r}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}(c)):(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o0){var a=t.cells[o][s],u=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Us?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Ys?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Us?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Ys?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Ys?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&js?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Ys?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&js?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&js?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&js?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Xs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Xs?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(a),c=null,h=s,l=o;null!==u&&i.push([u.p[0]+h,u.p[1]+l]);do{if(null===(c=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:switch(r){case 0:i=Na[c],s=ea[c],a=na[c],u=ra[c];break;default:i=Ia[c],s=Qs[c],a=$s[c],u=ta[c]}break;case 1:switch(r){case 0:i=Ma[c],s=fa[c],a=ga[c],u=da[c];break;default:i=La[c],s=ha[c],a=la[c],u=pa[c]}break;default:switch(n){case-1:switch(r){case 0:i=Pa[c],s=Vs[c],a=Hs[c],u=Ws[c];break;default:i=Oa[c],s=Js[c],a=Zs[c],u=Ks[c]}break;case 1:switch(r){case 0:i=Sa[c],s=ia[c],a=oa[c],u=sa[c];break;default:i=Ca[c],s=aa[c],a=ua[c],u=ca[c]}}}{if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;!function(t,e){delete t.edges[e];for(var n=e+1;n=n||h<0||h>=r||void 0===t.cells[l][h]){h-=c.x,l-=c.y;var p=function(t,e,n,r,i,o){var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,h=[],l=!1;for(;!l;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,s=t.cells[c][u],a=s.cval_real,-1===i)if(0===o)if(a&Ys)h.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Us)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Ys)){if(a&Us){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+s.bottomleft,c]),r=0,i=1,o=0,l=!0;break}h.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Xs)){if(a&js){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+s.topright,c+1]),r=0,i=-1,o=1,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}else h.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&js)){if(a&Ys){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+s.lefttop]),r=1,i=0,o=1,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: wtf");break}h.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&Us)){h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Us)){if(a&Xs){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else if(s=t.cells[c][u],a=s.cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Ys)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u,c])}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Xs)){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Us)){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&js)){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}}if(u+=r,c+=i,u===e&&c===n)break}return{path:h,i:u,j:c,x:r,y:i,o:o}}(t,h,l,c.x,c.y,c.o);if(null===p)break;p.path.forEach(function(t){i.push(t)}),h=p.i,l=p.j,u=p}}while(void 0!==t.cells[l][h]&&t.cells[l][h].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof zs.successCallback&&zs.successCallback(u),u}function lr(t,e,n){return(t-e)/(n-e)}function pr(t){return t.constructor.toString().indexOf("Array")>-1}function fr(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e?t:(r||(r=ye(t)),!1!==i&&void 0!==i||(t=Gt(t)),S(t,function(t){var n=sn(r,t)+e,i=un(r,t),o=U(nr(r,i,n));t[0]=o[0],t[1]=o[1]}),t)}function gr(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=Gt(t)),"FeatureCollection"!==t.type||o?dr(t,e,r):(O(t,function(n,i){t.features[i]=dr(n,e,r)}),t)}function dr(t,e,n){var i="Point"===K(t);return n=function(t,e){void 0!==e&&null!==e||(e="centroid");if(Array.isArray(e)||"object"==typeof e)return X(e);var n=t.bbox?t.bbox:j(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return r([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return r([s,o]);case"nw":case"northwest":case"westnorth":case"topleft":return r([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return r([s,a]);case"center":return de(t);case void 0:case null:case"centroid":return ye(t);default:throw new Error("invalid origin")}}(t,n),1===e||i?t:(S(t,function(t){var r=un(n,t),i=sn(n,t),o=U(nr(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),t)}function yr(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function _r(t,e){return t[0]*e[1]-e[0]*t[1]}function mr(t,e){return!function(t,e){return 0===_r(yr(t),yr(e))}(t,e)&&function(t,e){var n=t[0],r=yr(t),i=e[0],o=yr(e),s=_r(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(_r(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}function vr(t,e,n){var r=[],i=_(e,n),o=U(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r,s=t[1]+n*(t[0]-e[0])/r,a=e[1]+n*(t[0]-e[0])/r;return[[i,s],[o,a]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=mr(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),a(s,t.properties)}function xr(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function Er(t,e){return e.geometry.coordinates[0].every(function(e){return Pt(r(e),t)})}function wr(t,e){for(var n=0;n=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function br(t,e){return nn(e,kn(t)).features.length>0}function Ir(t,e){return!(t[0]>e[0])&&(!(t[2]e[1])&&!(t[3]0}function Mr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;s=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]0}function Ar(t,e,n){n=n||[];for(var r=0;r0)){if(o/=p,p<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>l)return;o>h&&(h=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=i-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>h&&(h=o)}else if(f>0){if(o0||l<1)||(h>0&&(t[0]=[u+h*p,c+h*f]),l<1&&(t[1]=[u+l*p,c+l*f]),!0)}}}}}function Kr(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,h=t.right,l=c[0],p=c[1],f=h[0],g=h[1],d=(l+f)/2,y=(p+g)/2;if(g===p){if(d=r)return;if(l>f){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]1)if(l>f){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]=-pu)){var f=u*u+c*c,g=h*h+l*l,d=(l*f-c*g)/p,y=(u*g-h*f)/p,_=cu.pop()||new function(){Xr(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=d+s,_.y=(_.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=_;for(var m=null,v=au._;v;)if(_.ylu)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return ai(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>lu)){r>-lu?(e=a.P,n=a):i>-lu?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){su[t.index]={site:t,halfedges:[]}}(t);var u=ri(t);if(ou.insert(e,u),e||n){if(e===n)return ni(e),n=ri(e.site),ou.insert(u,n),u.edge=n.edge=Hr(e.site,u.site),ei(e),void ei(n);if(n){ni(e),ni(n);var c=e.site,h=c[0],l=c[1],p=t[0]-h,f=t[1]-l,g=n.site,d=g[0]-h,y=g[1]-l,_=2*(p*y-f*d),m=p*p+f*f,v=d*d+y*y,x=[(y*m-f*v)/_+h,(p*v-d*m)/_+l];Jr(n.edge,c,g,x),u.edge=Hr(c,t,null,x),n.edge=Hr(t,g,null,x),ei(e),ei(n)}else u.edge=Hr(e.site,u.site)}}function ai(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var h=a-r,l=1/o-1/c,p=h/c;return l?(-p+Math.sqrt(p*p-2*l*(h*h/(-2*c)-u+c/2+i-o/2)))/l+r:(r+a)/2}function ui(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function ci(t,e){return e[1]-t[1]||e[0]-t[0]}function hi(t,e){var n,r,i,o=t.sort(ci).pop();for(uu=[],su=new Array(t.length),ou=new jr,au=new jr;;)if(i=iu,o&&(!i||o[1]lu||Math.abs(i[0][1]-i[1][1])>lu)||delete uu[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y=su.length,_=!0;for(i=0;ilu||Math.abs(d-p)>lu)&&(u.splice(a,0,uu.push(Wr(s,f,Math.abs(g-t)lu?[t,Math.abs(l-t)lu?[Math.abs(p-r)lu?[n,Math.abs(l-n)lu?[Math.abs(p-e)=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),"degrees"===s){var _=d*Math.cos(l)+y*Math.sin(l),m=y*Math.cos(l)-d*Math.sin(l);d=_,y=m}p.push([d+h[0],y+h[1]])}return p.push(p[0]),"degrees"===s?o([p],c):fr(o([p],c),a,{pivot:u})}function fi(t){var e=t*Math.PI/180;return Math.tan(e)}function gi(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,s=0,a=0;return A(t,function(t,e,n){var r=n[i];if(r=void 0===r||null===r?1:r,!b(r))throw new Error("weight value must be a number for feature index "+e);(r=Number(r))>0&&S(t,function(t){o+=t[0]*r,s+=t[1]*r,a+=r})}),r([o/a,s/a],n)}function di(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,function(e){var n=e.properties.weight,r=void 0===n||null===n?1:n;if(r=Number(r),!b(r))throw new Error("weight value must be a number");if(r>0){c+=1;var i=r*qt(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}}),c<1)throw new Error("no features to measure");var h=s/u,l=a/u;return 1===c||0===i||Math.abs(h-e[0])0?t+n[e-1]:t}),h.forEach(function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])}),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(_i(n))),s.push(o([u]))}return c(s)}function xi(t,e){if(e=e||{},!I(e))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;void 0!==t&&null!==t||(t=1),(!b(r)||r<2)&&(r=10),b(i)||(i=1e-4),b(o)||(o=Math.PI/8);for(var s=[],u=0;u1?t:null;case"MultiPolygon":var e=[];if(F(t,function(t){mn(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}function Yi(){this.reset()}function Vi(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Hi(t){return t>1?kf:t<-1?-kf:Math.asin(t)}function Wi(){}function Ji(t,e){t&&eg.hasOwnProperty(t.type)&&eg[t.type](t,e)}function Zi(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++iBf?t-jf:t<-Bf?t+jf:t,e]}function so(t,e,n){return(t%=jf)?e||n?rg(uo(t),co(e,n)):uo(t):e||n?co(e,n):oo}function ao(t){return function(e,n){return e+=t,[e>Bf?e-jf:e<-Bf?e+jf:e,n]}}function uo(t){var e=ao(t);return e.invert=ao(-t),e}function co(t,e){function n(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*r+a*i;return[Hf(u*o-h*s,a*r-c*i),Hi(h*o+u*s)]}var r=Wf(t),i=Kf(t),o=Wf(e),s=Kf(e);return n.invert=function(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*o-u*s;return[Hf(u*o+c*s,a*r+h*i),Hi(h*r-a*i)]},n}function ho(t,e){(e=$i(e))[0]-=t,io(e);var n=function(t){return t>1?0:t<-1?Bf:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+jf-Gf)%jf}function lo(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function po(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0)do{c.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==l);else c.point(o[0],o[1])}function s(r,i){return Yf(r[0]-t)0?0:3:Yf(r[0]-n)0?2:1:Yf(r[1]-e)0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t,e){i(t,e)&&E.point(t,e)}function c(o,s){var a=i(o,s);if(l&&p.push([o,s]),v)f=o,g=s,d=a,v=!1,a&&(E.lineStart(),E.point(o,s));else if(a&&m)E.point(o,s);else{var u=[y=Math.max(pg,Math.min(lg,y)),_=Math.max(pg,Math.min(lg,_))],c=[o=Math.max(pg,Math.min(lg,o)),s=Math.max(pg,Math.min(lg,s))];sg(u,c,t,e,n,r)?(m||(E.lineStart(),E.point(u[0],u[1])),E.point(c[0],c[1]),a||E.lineEnd(),x=!1):a&&(E.lineStart(),E.point(o,s),x=!1)}y=o,_=s,m=a}var h,l,p,f,g,d,y,_,m,v,x,E=s,w=og(),b={point:u,lineStart:function(){b.point=c,l&&l.push(p=[]),v=!0,m=!1,y=_=NaN},lineEnd:function(){h&&(c(f,g),d&&m&&w.rejoin(),h.push(w.result())),b.point=u,m&&E.lineEnd()},polygonStart:function(){E=w,h=[],l=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=x&&e,i=(h=hg(h)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ug(h,a,e,o,s),s.polygonEnd()),E=s,h=l=p=null}};return b}}function go(t){return t.length>1}function yo(t,e){return((t=t.x)[0]<0?t[1]-kf-Gf:kf-t[1])-((e=e.x)[0]<0?e[1]-kf-Gf:kf-e[1])}function _o(t){return function(e){var n=new mo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function mo(){}function vo(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),ng(n,t.stream(vg));var s=vg.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function xo(t){return function(t){function e(t){return t=c(t[0]*Uf,t[1]*Uf),[t[0]*d+s,a-t[1]*d]}function n(t,e){return t=o(t,e),[t[0]*d+s,a-t[1]*d]}function r(){c=rg(u=so(x,E,w),o);var t=o(m,v);return s=y-t[0]*d,a=_+t[1]*d,i()}function i(){return f=g=null,e}var o,s,a,u,c,h,l,p,f,g,d=150,y=480,_=250,m=0,v=0,x=0,E=0,w=0,b=null,I=Eg,N=null,C=gg,S=.5,M=Ng(n,S);e.stream=function(t){return f&&g===t?f:f=Cg(I(u,M(C(g=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?wg(b=t*Uf,6*Uf):(b=null,Eg),i()):b*Xf},e.clipExtent=function(t){return arguments.length?(C=null==t?(N=h=l=p=null,gg):fo(N=+t[0][0],h=+t[0][1],l=+t[1][0],p=+t[1][1]),i()):null==N?null:[[N,h],[l,p]]},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(y=+t[0],_=+t[1],r()):[y,_]},e.center=function(t){return arguments.length?(m=t[0]%360*Uf,v=t[1]%360*Uf,r()):[m*Xf,v*Xf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Uf,E=t[1]%360*Uf,w=t.length>2?t[2]%360*Uf:0,r()):[x*Xf,E*Xf,w*Xf]},e.precision=function(t){return arguments.length?(M=Ng(n,S=t*t),i()):Qf(S)},e.fitExtent=function(t,n){return vo(e,t,n)},e.fitSize=function(t,n){return function(t,e,n){return vo(t,[[0,0],e],n)}(e,t,n)};return function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=c.invert((t[0]-s)/d,(a-t[1])/d))&&[t[0]*Xf,t[1]*Xf]},r()}}(function(){return t})()}function Eo(t,e){return[t,Zf($f((kf+e)/2))]}function wo(t,e){return[Zf($f((kf+e)/2)),-t]}function bo(t,n,r,i){var o=t.properties||{},s="Feature"===t.type?t.geometry:t;if("GeometryCollection"===s.type){var a=[];return A(t,function(t){var e=bo(t,n,r,i);e&&a.push(e)}),c(a)}var u,h=j(t),l=h[1]>50&&h[3]>50;u=l?{type:s.type,coordinates:No(s.coordinates,So(s))}:cn(s);var p=(new bh).read(u),f=d(y(n,r),"meters"),g=gp.bufferOp(p,f);if(g=(new Ih).write(g),!Io(g.coordinates)){var _;return(_=l?{type:g.type,coordinates:Co(g.coordinates,So(s))}:hn(g)).geometry?_:e(_,o)}}function Io(t){return Array.isArray(t[0])?Io(t[0]):isNaN(t[0])}function No(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return No(t,e)})}function Co(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return Co(t,e)})}function So(t){var e=de(t).geometry.coordinates.reverse(),n=e.map(function(t){return-t});return Sg().center(e).rotate(n).scale(Fo)}function Mo(){for(var t=new bh,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n=0&&(void 0===i||sm/2;P&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var D=[],F=0;F<=C;F++)for(var q=0;q<=M;q++){var G=F%2==1;if((0!==q||!G)&&(0!==q||!P)){var B=F*E+a-S,k=q*w+u+L;if(G&&(k-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([B,k],g/2,d/2,r,O,R).forEach(function(t){s?Lo(s,t)&&D.push(t):D.push(t)});else{var z=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],h=t[1]+n*s[u];a.push([c,h])}return a.push(a[0].slice()),o([a],r)}([B,k],g/2,d/2,r,O,R);s?Lo(s,z)&&D.push(z):D.push(z)}}}return c(D)}function Ro(t){if(t.features.length<=1)return t;var e=function(t){var e=Vo(),n=[];return F(t,function(t,e){var r=j(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})}),e.load(n),e}(t),n=[],r={};return F(t,function(t,i){if(r[i])return!0;for(e.remove({index:i},To),r[i]=!0;;){var o=j(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map(function(t){return r[t.index]=!0,e.remove({index:t.index},To),t.geojson});a.push(t),t=Mo.apply(this,a)}if(0===s.length)break}n.push(t)}),c(n)}function To(t,e){return t.index===e.index}function Ao(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=Math.floor(d/f),m=(d-_*f)/2,v=a+(g-y*p)/2,x=0;x=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=yt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,at(n,this.toBBox),at(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=yt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,at(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=ut(t,0,r,this.toBBox),o=ut(t,r,n,this.toBBox)),a=pt(i)+pt(o),s=e;i--)o=t.children[i],ct(u,t.leaf?s(o):o),c+=ft(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)ct(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():at(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Ho=function(t,e,n){var r=t*e,i=Wo*t,o=i-(i-t),s=t-o,a=Wo*e,u=a-(a-e),c=e-u,h=s*c-(r-o*u-s*u-o*c);return n?(n[0]=h,n[1]=r,n):[h,r]},Wo=+(Math.pow(2,27)+1),Jo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=n+r,a=new Array(s),u=0,c=0,h=0,l=Math.abs,p=t[c],f=l(p),g=e[h],d=l(g);f=r?(i=p,(c+=1)=r?(i=p,(c+=1)>1;return["sum(",r(t.slice(0,e)),",",r(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],s=0;s0){if(o<=0)return s;r=i+o}else{if(!(i<0))return s;if(o>=0)return s;r=-(i+o)}var u=3.3306690738754716e-16*r;return s>=u||s<=-u?s:a(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],a=t[1]-r[1],c=e[1]-r[1],h=n[1]-r[1],l=t[2]-r[2],p=e[2]-r[2],f=n[2]-r[2],g=o*h,d=s*c,y=s*a,_=i*h,m=i*c,v=o*a,x=l*(g-d)+p*(y-_)+f*(m-v),E=7.771561172376103e-16*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(p)+(Math.abs(m)+Math.abs(v))*Math.abs(f));return x>E||-x>E?x:u(t,e,n,r)}];!function(){for(;c.length<=s;)c.push(o(c.length));for(var e=[],n=["slow"],r=0;r<=s;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=s;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i1&&es(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&es(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var h=0,l=(r=0,o.length);r0;--p)n[h++]=s[p];return n},es=$o[3],ns=vt,rs=vt;vt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}},ns.default=rs;var is=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;or!=h>r&&n<(c-a)*(r-u)/(h-u)+a&&(i=!i)}return i},os=$o[3],ss=xt,as=xt;ss.default=as;var us=function(t){return t},cs=function(t){if(null==t)return us;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,h=new Array(c);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)break;h=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e>7^_s[2]^_s[3])},vs=function(t){function e(t,e,n,r){if(p[n]!==t){p[n]=t;var i=f[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else f[n]=e,g[n]=r}}function n(t){return ms(u[t])}function r(t,e){return gs(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,h=t.rings,l=function(){for(var t=fs(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;ea&&(a=e),nu&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach(r)}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach(r)},Polygon:function(t){t.arcs.forEach(r)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var h in t)e(t[h]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Vt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*f),Math.round((t[1]-h)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,l=t.length,p=new Array(l);++at&&(e.push(r),n=i)}return e},bs.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},bs.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])};var Is=ve,Ns=ve;ve.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ae(t,0,o,n));if(i)for(var a=0,u=e.length;a0&&(r+=t[i-1].length,n.holes.push(r))}return n},Is.default=Ns,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Je(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Ze(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ze(n,this.toBBox),ze(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ze(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=je(t,0,r,this.toBBox),o=je(t,r,n,this.toBBox)),a=Ve(i)+Ve(o),s=e;i--)o=t.children[i],Xe(u,t.leaf?s(o):o),c+=He(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)Xe(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ze(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Cs=Object.freeze({toMercator:cn,toWgs84:hn}),Ss=6378137,Ms=function(t,e,n){function r(t,n,r,i){var u=o[t][n],c=o[t][n+1],h=o[r][i],l=o[r][i+1],p=function(t,e,n,r){if(On(t,n)||On(t,r)||On(e,n)||On(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],c=n[1],h=r[0],l=r[1],p=(i-s)*(c-l)-(o-a)*(u-h);return 0===p?null:[((i*a-o*s)*(u-h)-(i-s)*(u*l-c*h))/p,((i*a-o*s)*(c-l)-(o-a)*(u*l-c*h))/p]}(u,c,h,l);if(null!==p){var f,g;if(f=c[0]!==u[0]?(p[0]-u[0])/(c[0]-u[0]):(p[1]-u[1])/(c[1]-u[1]),g=l[0]!==h[0]?(p[0]-h[0])/(l[0]-h[0]):(p[1]-h[1])/(l[1]-h[1]),!(f>=1||f<=0||g>=1||g<=0)){var d=p,y=!a[d];y&&(a[d]=!0),e?s.push(e(p,t,n,u,c,f,r,i,h,l,g,y)):s.push(p)}}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]1)for(e=0;ey[e.isect].coord?-1:1});for(f=[];N.length>0;){var P=N.pop(),O=P.isect,R=P.parent,T=P.winding,A=f.length,D=[y[O].coord],F=O;if(y[O].ringAndEdge1Walkable)var q=y[O].ringAndEdge1,G=y[O].nxtIsectAlongRingAndEdge1;else q=y[O].ringAndEdge2,G=y[O].nxtIsectAlongRingAndEdge2;for(;!Tn(y[O].coord,y[G].coord);){D.push(y[G].coord);var B=void 0;for(a=0;ap&&(d>h&&gh&&du&&(u=y)}var _=[];if(a&&u0&&Math.abs(x-n[v-1][0])>p){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(E>-180&&E-180&&n[v-1][0]h&&E<180&&-180===b&&v+1h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(Eh){var N=E;E=b,b=N;var C=w;w=I,I=C}if(E>h&&b=180&&Eh?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;P=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xr(t.coordinates,r.coordinates,i.coordinates);if(o<0)return 1;if(o>0)return-1;return Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)},Ta.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Ta.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Ta.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Aa=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Aa.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Aa(this.to,this.from),this.symetric.symetric=this),this.symetric},Aa.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Aa.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Aa.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Aa.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},Aa.prototype.compareTo=function(t){return xr(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Da=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Fa={length:{configurable:!0}};Da.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Da.prototype.get=function(t){return this.edges[t]},Fa.length.get=function(){return this.edges.length},Da.prototype.forEach=function(t){this.edges.forEach(t)},Da.prototype.map=function(t){return this.edges.map(t)},Da.prototype.some=function(t){return this.edges.some(t)},Da.prototype.isValid=function(){return!0},Da.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xr(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},Da.prototype.toMultiPoint=function(){return l(this.edges.map(function(t){return t.from.coordinates}))},Da.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Da.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=he(this.toPolygon())},Da.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach(function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map(function(t){return t[0]}),r=t.geometry.coordinates.map(function(t){return t[1]}),i=e.geometry.coordinates.map(function(t){return t[0]}),o=e.geometry.coordinates.map(function(t){return t[1]});return Math.max(null,n)===Math.max(null,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&Er(s,o)){var a=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)})});a&&e.inside(r(a))&&(i&&!Er(n,s)||(i=e))}}),i},Da.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Da.prototype,Fa);var qa=function(){this.edges=[],this.nodes={}};qa.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new qa;return F(t,function(t){H(t,"LineString","Graph::fromGeoJson"),M(t,function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n})}),e},qa.prototype.getNode=function(t){var e=Ta.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ta(t)),n},qa.prototype.addEdge=function(t,e){var n=new Aa(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},qa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},qa.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}},qa.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},qa.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})},qa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},qa.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t},qa.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},qa.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},qa.prototype._findEdgeRing=function(t){var e=t,n=new Da;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},qa.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]},qa.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()};var Ga=mt(function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports="function"==typeof Object.keys?Object.keys:n).shim=n}),Ba=(Ga.shim,mt(function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r})),ka=(Ba.supported,Ba.unsupported,mt(function(t){function e(t){return null===t||void 0===t}function n(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ba(t))return!!Ba(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a=0;a--)if(c[a]!=h[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}})),za=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Rr};za.prototype.compare=function(t,e){if(t.type!==e.type||!Or(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=Pr(t),i=Pr(e);return r.every(function(t){return this.some(function(e){return n.compare(t,e)})},i)}}return!1},za.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},za.prototype.comparePath=function(t,e){var n=this;return t.every(function(t,e){return n.compareCoord(t,this[e])},e)},za.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every(function(t){return this.some(function(e){return i.compareLine(t,e,1,!0)})},r)}return!1},za.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},za.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},za.prototype.removePseudo=function(t){return t};var ja=za,Xa=mt(function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;ri&&(n=r):e=this.minPts)return n}},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r0;r.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length0,s=t[Math.floor(Math.random()*i)];o&&s.join("_");for(r.push(s);r.length0,f=[];if(n)i="kmrand"==n?Qa(t,e):"kmpp"==n?$a(t,e):n;else for(var g={};i.length0;){var u=s.pop();if(u===n)return Fr(u);u.closed=!0;for(var c=t.neighbors(u),h=0,l=c.length;h0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=a)return null;var u=t-i.site[0],c=e-i.site[1],h=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],l=u*u+c*c;le.x?1:this.ye.y?1:0},bu.prototype.clone=function(){},bu.prototype.copy=function(){return new bu(this)},bu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},bu.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},bu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},bu.prototype.hashCode=function(){var t=17;return t=37*t+bu.hashCode(this.x),t=37*t+bu.hashCode(this.y)},bu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},bu.prototype.interfaces_=function(){return[xu,Eu,Li]},bu.prototype.getClass=function(){return bu},bu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=mu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Iu.DimensionalComparator.get=function(){return Nu},Iu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Iu.NULL_ORDINATE.get=function(){return mu.NaN},Iu.X.get=function(){return 0},Iu.Y.get=function(){return 1},Iu.Z.get=function(){return 2},Object.defineProperties(bu,Iu);var Nu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _u("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Nu.prototype.compare=function(t,e){var n=t,r=e,i=Nu.compare(n.x,r.x);if(0!==i)return i;var o=Nu.compare(n.y,r.y);if(0!==o)return o;if(this._dimensionsToTest<=2)return 0;return Nu.compare(n.z,r.z)},Nu.prototype.interfaces_=function(){return[wu]},Nu.prototype.getClass=function(){return Nu},Nu.compare=function(t,e){return te?1:mu.isNaN(t)?mu.isNaN(e)?0:-1:mu.isNaN(e)?1:0};var Cu=function(){};Cu.prototype.create=function(){},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu};var Su=function(){},Mu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Su.prototype.interfaces_=function(){return[]},Su.prototype.getClass=function(){return Su},Su.toLocationSymbol=function(t){switch(t){case Su.EXTERIOR:return"e";case Su.BOUNDARY:return"b";case Su.INTERIOR:return"i";case Su.NONE:return"-"}throw new _u("Unknown location value: "+t)},Mu.INTERIOR.get=function(){return 0},Mu.BOUNDARY.get=function(){return 1},Mu.EXTERIOR.get=function(){return 2},Mu.NONE.get=function(){return-1},Object.defineProperties(Su,Mu);var Lu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Pu=function(){},Ou={LOG_10:{configurable:!0}};Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu},Pu.log10=function(t){var e=Math.log(t);return mu.isInfinite(e)?e:mu.isNaN(e)?e:e/Pu.LOG_10},Pu.min=function(t,e,n,r){var i=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},Pu.wrap=function(t,e){return t<0?e- -t%e:t%e},Pu.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},Pu.average=function(t,e){return(t+e)/2},Ou.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pu,Ou);var Ru=function(t){this.str=t};Ru.prototype.append=function(t){this.str+=t},Ru.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Ru.prototype.toString=function(t){return this.str};var Tu=function(t){this.value=t};Tu.prototype.intValue=function(){return this.value},Tu.prototype.compareTo=function(t){return this.valuet?1:0},Tu.isNaN=function(t){return Number.isNaN(t)};var Au=function(){};Au.isWhitespace=function(t){return t<=32&&t>=0||127===t},Au.toUpperCase=function(t){return t.toUpperCase()};var Du=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},Fu={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Du.prototype.le=function(t){return(this._hi9?(h=!0,l="9"):l="0"+c,s.append(l),n=n.subtract(Du.valueOf(c)).multiply(Du.TEN),h&&n.selfAdd(Du.TEN);var p=!0,f=Du.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Du.prototype.sqr=function(){return this.multiply(this)},Du.prototype.doubleValue=function(){return this._hi+this._lo},Du.prototype.subtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Du.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Du.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Du.prototype.selfSubtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},Du.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Du.prototype.min=function(t){return this.le(t)?this:t},Du.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,h=null,l=null;return u=this._hi/n,c=Du.SPLIT*u,i=c-u,l=Du.SPLIT*n,i=c-i,o=u-i,s=l-n,h=u*n,s=l-s,a=n-s,l=i*s-h+i*a+o*s+o*a,c=(this._hi-h-l+this._lo-u*r)/n,l=u+c,this._hi=l,this._lo=u-l+c,this}},Du.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Du.prototype.divide=function(){if(arguments[0]instanceof Du){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;n=(o=this._hi/t._hi)-(e=(s=Du.SPLIT*o)-(e=s-o)),u=e*(r=(u=Du.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi;return new Du(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return mu.isNaN(c)?Du.createNaN():Du.copy(this).selfDivide(c,0)}},Du.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Du.prototype.pow=function(t){if(0===t)return Du.valueOf(1);var e=new Du(this),n=Du.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},Du.prototype.ceil=function(){if(this.isNaN())return Du.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Du(t,e)},Du.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},Du.prototype.rint=function(){if(this.isNaN())return this;return this.add(.5).floor()},Du.prototype.setValue=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Du.prototype.max=function(t){return this.ge(t)?this:t},Du.prototype.sqrt=function(){if(this.isZero())return Du.valueOf(0);if(this.isNegative())return Du.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Du.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Du.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return i=this._hi+e,s=i-this._hi,o=i-s,o=e-s+(this._hi-o),a=o+this._lo,n=i+a,r=a+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],h=null,l=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,l=this._lo+c,g=f-(d=f-this._hi),p=l-(y=l-this._lo);var _=(h=f+(d=(g=u-d+(this._hi-g))+l))+(d=(p=c-y+(this._lo-p))+(d+(f-h))),m=d+(h-_);return this._hi=_,this._lo=m,this}},Du.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Du){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=Du.SPLIT*this._hi)-this._hi,c=Du.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var h=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),l=c+(i=u-h);return this._hi=h,this._lo=l,this}},Du.prototype.selfSqr=function(){return this.selfMultiply(this)},Du.prototype.floor=function(){if(this.isNaN())return Du.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Du(t,e)},Du.prototype.negate=function(){return this.isNaN()?this:new Du(-this._hi,-this._lo)},Du.prototype.clone=function(){},Du.prototype.multiply=function(){if(arguments[0]instanceof Du){var t=arguments[0];return t.isNaN()?Du.createNaN():Du.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return mu.isNaN(e)?Du.createNaN():Du.copy(this).selfMultiply(e,0)}},Du.prototype.isNaN=function(){return mu.isNaN(this._hi)},Du.prototype.intValue=function(){return Math.trunc(this._hi)},Du.prototype.toString=function(){var t=Du.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},Du.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+Du.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Du.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Du.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=Du.SPLIT*i)-(t=o-i)),n=(a=Du.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new Du(u,i-u+o)},Du.prototype.toSciNotation=function(){if(this.isZero())return Du.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=Du.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},Du.prototype.abs=function(){return this.isNaN()?Du.NaN:this.isNegative()?this.negate():new Du(this)},Du.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},Du.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},Du.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Du.prototype.trunc=function(){return this.isNaN()?Du.NaN:this.isPositive()?this.floor():this.ceil()},Du.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Du.prototype.interfaces_=function(){return[Li,xu,Eu]},Du.prototype.getClass=function(){return Du},Du.sqr=function(t){return Du.valueOf(t).selfMultiply(t)},Du.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return Du.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new Du(e)}},Du.sqrt=function(t){return Du.valueOf(t).sqrt()},Du.parse=function(t){for(var e=0,n=t.length;Au.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var c=t.charAt(e);if(e++,Au.isDigit(c)){var h=c-"0";o.selfMultiply(Du.TEN),o.selfAdd(h),s++}else{if("."!==c){if("e"===c||"E"===c){var l=t.substring(e);try{u=Tu.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var g=Du.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=Du.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},Du.createNaN=function(){return new Du(mu.NaN,mu.NaN)},Du.copy=function(t){return new Du(t)},Du.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},Du.stringOfChar=function(t,e){for(var n=new Ru,r=0;r0){if(o<=0)return qu.signum(s);r=i+o}else{if(!(i<0))return qu.signum(s);if(o>=0)return qu.signum(s);r=-i-o}var a=qu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?qu.signum(s):2},qu.signum=function(t){return t>0?1:t<0?-1:0},Gu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(qu,Gu);var Bu=function(){},ku={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ku.X.get=function(){return 0},ku.Y.get=function(){return 1},ku.Z.get=function(){return 2},ku.M.get=function(){return 3},Bu.prototype.setOrdinate=function(t,e,n){},Bu.prototype.size=function(){},Bu.prototype.getOrdinate=function(t,e){},Bu.prototype.getCoordinate=function(){},Bu.prototype.getCoordinateCopy=function(t){},Bu.prototype.getDimension=function(){},Bu.prototype.getX=function(t){},Bu.prototype.clone=function(){},Bu.prototype.expandEnvelope=function(t){},Bu.prototype.copy=function(){},Bu.prototype.getY=function(t){},Bu.prototype.toCoordinateArray=function(){},Bu.prototype.interfaces_=function(){return[Eu]},Bu.prototype.getClass=function(){return Bu},Object.defineProperties(Bu,ku);var zu=function(){},ju=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zu),Xu=function(){};Xu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;st._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy)}},Yu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Yu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Yu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Yu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Yu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Yu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Yu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Yu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Yu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof bu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Yu.prototype.centre=function(){return this.isNull()?null:new bu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Yu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Yu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Yu.prototype.hashCode=function(){var t=17;return t=37*t+bu.hashCode(this._minx),t=37*t+bu.hashCode(this._maxx),t=37*t+bu.hashCode(this._miny),t=37*t+bu.hashCode(this._maxy)},Yu.prototype.interfaces_=function(){return[xu,Li]},Yu.prototype.getClass=function(){return Yu},Yu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(c>u)&&(!(hu)&&!(hthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ec.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ec.prototype.setPrecisionModel=function(t){this._precisionModel=t},ec.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return tc.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},ec.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return tc.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nc.DONT_INTERSECT.get=function(){return 0},nc.DO_INTERSECT.get=function(){return 1},nc.COLLINEAR.get=function(){return 2},nc.NO_INTERSECTION.get=function(){return 0},nc.POINT_INTERSECTION.get=function(){return 1},nc.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ec,nc);var rc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Yu(this._inputLines[0][0],this._inputLines[0][1]),n=new Yu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,Yu.intersects(n,r,e)&&0===sc.orientationIndex(n,r,e)&&0===sc.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Uu.intersection(t,n,r,i)}catch(s){if(!(s instanceof ju))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new bu(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&Xu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new bu(t),o=new bu(e),s=new bu(n),a=new bu(r),u=new bu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Yu.intersects(e,n,r),s=Yu.intersects(e,n,i),a=Yu.intersects(r,i,e),u=Yu.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.xr.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(ah?s:h)+(u0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=sc.orientationIndex(r,i,e),u=sc.orientationIndex(r,i,n);if(a>0&&u>0||a<0&&u<0)return t.NO_INTERSECTION;return 0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new bu(r):0===s?this._intPt[0]=new bu(i):0===a?this._intPt[0]=new bu(e):0===u&&(this._intPt[0]=new bu(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=sc.distancePointLine(t,n,r),s=sc.distancePointLine(e,n,r);return s0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if(s=Math.floor(n/t),n-=s*t,(r-=s*e)<0)return-i;if(r>e)return i;if(t>n+n){if(er+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if(s=Math.floor(t/n),t-=s*n,(e-=s*r)<0)return i;if(e>r)return-i;if(n>t+t){if(re+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var oc=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};oc.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ic.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},oc.prototype.isPointInPolygon=function(){return this.getLocation()!==Su.EXTERIOR},oc.prototype.getLocation=function(){return this._isPointOnSegment?Su.BOUNDARY:this._crossingCount%2==1?Su.INTERIOR:Su.EXTERIOR},oc.prototype.isOnSegment=function(){return this._isPointOnSegment},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.locatePointInRing=function(){if(arguments[0]instanceof bu&&Lu(arguments[1],Bu)){for(var t=arguments[0],e=arguments[1],n=new oc(t),r=new bu,i=new bu,o=1;o1||a<0||a>1)&&(i=!0)}}else i=!0;return i?Pu.min(sc.distancePointLine(t,n,r),sc.distancePointLine(e,n,r),sc.distancePointLine(n,t,e),sc.distancePointLine(r,t,e)):0},sc.isPointInRing=function(t,e){return sc.locatePointInRing(t,e)!==Su.EXTERIOR},sc.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new bu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;sn.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=sc.computeOrientation(u,n,c),l=!1;return l=0===h?u.x>c.x:h>0,l},sc.locatePointInRing=function(t,e){return oc.locatePointInRing(t,e)},sc.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},sc.computeOrientation=function(t,e,n){return sc.orientationIndex(t,e,n)},sc.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _u("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return o.distance(a);var h=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(h)*Math.sqrt(u)}},sc.isOnLine=function(t,e){for(var n=new rc,r=1;r0},yc.prototype.interfaces_=function(){return[fc]},yc.prototype.getClass=function(){return yc};var _c=function(){};_c.prototype.isInBoundary=function(t){return t>1},_c.prototype.interfaces_=function(){return[fc]},_c.prototype.getClass=function(){return _c};var mc=function(){};mc.prototype.isInBoundary=function(t){return 1===t},mc.prototype.interfaces_=function(){return[fc]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.add=function(){},vc.prototype.addAll=function(){},vc.prototype.isEmpty=function(){},vc.prototype.iterator=function(){},vc.prototype.size=function(){},vc.prototype.toArray=function(){},vc.prototype.remove=function(){};var xc=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,n),e}(Error),Ec=function(){};Ec.prototype.hasNext=function(){},Ec.prototype.next=function(){},Ec.prototype.remove=function(){};var wc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vc);(Pi.prototype=new Error).name="NoSuchElementException";var bc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vc]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new Ic(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new xc;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1){if(this.get(this.size()-1).equals2D(i))return null}t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c=0;h--)this.add(a[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(l>0){if(this.get(l-1).equals2D(p))return null}if(l_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new bu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bc),Cc=function(){},Sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Sc.ForwardComparator.get=function(){return Mc},Sc.BidirectionalComparator.get=function(){return Lc},Sc.coordArrayType.get=function(){return new Array(0).fill(null)},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Cc.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},Cc.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},Cc.extract=function(t,e,n){e=Pu.clamp(e,0,t.length);var r=(n=Pu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Cc.compare(n,r);return Cc.isEqualReversed(n,r)?0:i},Lc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Cc.increasingDirection(n),o=Cc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},Gi.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Ac,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:Ac,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Gi.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Ai(t)===Fi(Ai(Ai(t)))){var e=qi(Ai(Ai(t)));1===Ti(e)?(Di(Ai(t),Ac),Di(e,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===qi(Ai(t))&&(t=Ai(t),this.rotateLeft(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateRight(Ai(Ai(t))))}else{var n=Fi(Ai(Ai(t)));1===Ti(n)?(Di(Ai(t),Ac),Di(n,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===Fi(Ai(t))&&(t=Ai(t),this.rotateRight(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateLeft(Ai(Ai(t))))}this.root_.color=Ac},Gi.prototype.values=function(){var t=new bc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Gi.successor(e));)t.add(e.value);return t},Gi.prototype.entrySet=function(){var t=new Rc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Gi.successor(e));)t.add(e);return t},Gi.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},Gi.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},Gi.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Gi.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},Gi.prototype.size=function(){return this.size_};var Dc=function(){};Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Bi.prototype=new Ri,(ki.prototype=new Bi).contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(Vc.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wc.ensureValidRing=function(t,e){var n=e.size();if(0===n)return e;if(n<=3)return Wc.createClosedRing(t,e,4);return e.getOrdinate(0,Bu.X)===e.getOrdinate(n-1,Bu.X)&&e.getOrdinate(0,Bu.Y)===e.getOrdinate(n-1,Bu.Y)?e:Wc.createClosedRing(t,e,n+1)},Wc.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wc.copy(e,0,r,0,i);for(var o=i;o0&&Wc.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gc.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return sc.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();Wc.reverse(t);return this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Jc),nh=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return cc.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},sh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},sh.prototype.getClass=function(){return sh};var ah=function(){};ah.prototype.edit=function(t,e){return t instanceof eh?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jc?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kc?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ah.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},ah.prototype.getClass=function(){return ah};var uh=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new Ru(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(r=3),r<2?new uh(n):new uh(n,r)}},hh.prototype.interfaces_=function(){return[Cu,Li]},hh.prototype.getClass=function(){return hh},hh.instance=function(){return hh.instanceObject},lh.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},lh.instanceObject.get=function(){return new hh},Object.defineProperties(hh,lh);var ph=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bc,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Rc;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Pc),fh=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof dh){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},gh={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fh.prototype.equals=function(t){if(!(t instanceof fh))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fh.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Tu(n).compareTo(new Tu(r))},fh.prototype.getScale=function(){return this._scale},fh.prototype.isFloating=function(){return this._modelType===fh.FLOATING||this._modelType===fh.FLOATING_SINGLE},fh.prototype.getType=function(){return this._modelType},fh.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fh.FLOATING?t="Floating":this._modelType===fh.FLOATING_SINGLE?t="Floating-Single":this._modelType===fh.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fh.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];if(mu.isNaN(t))return t;if(this._modelType===fh.FLOATING_SINGLE){return t}return this._modelType===fh.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof bu){var e=arguments[0];if(this._modelType===fh.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fh.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fh.FLOATING?t=16:this._modelType===fh.FLOATING_SINGLE?t=6:this._modelType===fh.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fh.prototype.setScale=function(t){this._scale=Math.abs(t)},fh.prototype.interfaces_=function(){return[Li,xu]},fh.prototype.getClass=function(){return fh},fh.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},gh.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},gh.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fh,gh);var dh=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},yh={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dh.prototype.readResolve=function(){return dh.nameToTypeMap.get(this._name)},dh.prototype.toString=function(){return this._name},dh.prototype.interfaces_=function(){return[Li]},dh.prototype.getClass=function(){return dh},yh.serialVersionUID.get=function(){return-552860263173159e4},yh.nameToTypeMap.get=function(){return new ph},Object.defineProperties(dh,yh),fh.Type=dh,fh.FIXED=new dh("FIXED"),fh.FLOATING=new dh("FLOATING"),fh.FLOATING_SINGLE=new dh("FLOATING SINGLE");var _h=function t(){this._precisionModel=new fh,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Lu(arguments[0],Cu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fh&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},mh={serialVersionUID:{configurable:!0}};_h.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new bu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new bu(t.getMinX(),t.getMinY()),new bu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new bu(t.getMinX(),t.getMinY()),new bu(t.getMinX(),t.getMaxY()),new bu(t.getMaxX(),t.getMaxY()),new bu(t.getMaxX(),t.getMinY()),new bu(t.getMinX(),t.getMinY())]),null)},_h.prototype.createLineString=function(t){return t?t instanceof Array?new Jc(this.getCoordinateSequenceFactory().create(t),this):Lu(t,Bu)?new Jc(t,this):void 0:new Jc(this.getCoordinateSequenceFactory().create([]),this)},_h.prototype.createMultiLineString=function(){if(0===arguments.length)return new Xc(null,this);if(1===arguments.length){var t=arguments[0];return new Xc(t,this)}},_h.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(_h.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof $c)return this.createMultiPolygon(_h.toPolygonArray(t));if(a instanceof Jc)return this.createMultiLineString(_h.toLineStringArray(t));if(a instanceof Kc)return this.createMultiPoint(_h.toPointArray(t));tc.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_h.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_h.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Lu(arguments[0],Bu)){var e=arguments[0];return new Kc(e,this)}}},_h.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_h.prototype.createPolygon=function(){if(0===arguments.length)return new $c(null,null,this);if(1===arguments.length){if(Lu(arguments[0],Bu)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof eh){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new $c(r,i,this)}},_h.prototype.getSRID=function(){return this._SRID},_h.prototype.createGeometryCollection=function(){if(0===arguments.length)return new jc(null,this);if(1===arguments.length){var t=arguments[0];return new jc(t,this)}},_h.prototype.createGeometry=function(t){return new rh(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_h.prototype.getPrecisionModel=function(){return this._precisionModel},_h.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Lu(arguments[0],Bu)){var e=arguments[0];return new eh(e,this)}}},_h.prototype.createMultiPolygon=function(){if(0===arguments.length)return new nh(null,this);if(1===arguments.length){var t=arguments[0];return new nh(t,this)}},_h.prototype.createMultiPoint=function(){if(0===arguments.length)return new th(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new th(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(Lu(arguments[0],Bu)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[t]},Xi.prototype.push=function(t){return this.array_.push(t),t},Xi.prototype.pop=function(t){if(0===this.array_.length)throw new ji;return this.array_.pop()},Xi.prototype.peek=function(){if(0===this.array_.length)throw new ji;return this.array_[this.array_.length-1]},Xi.prototype.empty=function(){return 0===this.array_.length},Xi.prototype.isEmpty=function(){return this.empty()},Xi.prototype.search=function(t){return this.array_.indexOf(t)},Xi.prototype.size=function(){return this.array_.length},Xi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===sc.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Sh.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Nh.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Sh.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Sh.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}tc.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;this.getRightmostSide(this._minDe,this._minIndex)===Nh.LEFT&&(this._orientedDe=this._minDe.getSym())},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var Mh=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new bu(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Qu),Lh=function(){this.array_=[]};Lh.prototype.addLast=function(t){this.array_.push(t)},Lh.prototype.removeFirst=function(){return this.array_.shift()},Lh.prototype.isEmpty=function(){return 0===this.array_.length};var Ph=function(){this._finder=null,this._dirEdgeList=new bc,this._nodes=new bc,this._rightMostCoord=null,this._env=null,this._finder=new Sh};Ph.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},Ph.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ph.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Mh("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ph.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Nh.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ph.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ph.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Nh.RIGHT)>=1&&e.getDepth(Nh.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ph.prototype.computeDepths=function(t){var e=new Rc,n=new Lh,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Ph.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Ph.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Yu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[Nh.ON]=this.location[Nh.ON],e[Nh.LEFT]=Su.NONE,e[Nh.RIGHT]=Su.NONE,this.location=e}for(var n=0;n1&&t.append(Su.toLocationSymbol(this.location[Nh.LEFT])),t.append(Su.toLocationSymbol(this.location[Nh.ON])),this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.RIGHT])),t.toString()},Oh.prototype.setLocations=function(t,e,n){this.location[Nh.ON]=t,this.location[Nh.LEFT]=e,this.location[Nh.RIGHT]=n},Oh.prototype.get=function(t){return t1},Oh.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Th.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;a--)this._pts.add(r[a])}},Th.prototype.isHole=function(){return this._isHole},Th.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Th.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!sc.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},Th.prototype.addHole=function(t){this._holes.add(t)},Th.prototype.isShell=function(){return null===this._shell},Th.prototype.getLabel=function(){return this._label},Th.prototype.getEdges=function(){return this._edges},Th.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Th.prototype.getShell=function(){return this._shell},Th.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=e.getLocation(n,Nh.RIGHT);if(r===Su.NONE)return null;if(this._label.getLocation(n)===Su.NONE)return this._label.setLocation(n,r),null}},Th.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Th.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},Fh.prototype.isInResult=function(){return this._isInResult},Fh.prototype.isVisited=function(){return this._isVisited},Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh};var qh=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Rh(0,Su.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=Su.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Su.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Rh(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Rh)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===Su.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=Su.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Su.BOUNDARY:n=Su.INTERIOR;break;case Su.INTERIOR:default:n=Su.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fh),Gh=function(){this.nodeMap=new Gi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Gh.prototype.find=function(t){return this.nodeMap.get(t)},Gh.prototype.addNode=function(){if(arguments[0]instanceof bu){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof qh){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Gh.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Gh.prototype.iterator=function(){return this.nodeMap.values().iterator()},Gh.prototype.values=function(){return this.nodeMap.values()},Gh.prototype.getBoundaryNodes=function(t){for(var e=new bc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Su.BOUNDARY&&e.add(r)}return e},Gh.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var Bh=function(){},kh={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.isNorthern=function(t){return t===Bh.NE||t===Bh.NW},Bh.isOpposite=function(t,e){if(t===e)return!1;return 2===(t-e+4)%4},Bh.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=te?t:e)?3:n},Bh.isInHalfPlane=function(t,e){return e===Bh.SE?t===Bh.SE||t===Bh.SW:t===e||t===e+1},Bh.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _u("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Bh.NE:Bh.SE:e>=0?Bh.NW:Bh.SW}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _u("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Bh.NE:Bh.SE:r.y>=n.y?Bh.NW:Bh.SW}},kh.NE.get=function(){return 0},kh.NW.get=function(){return 1},kh.SW.get=function(){return 2},kh.SE.get=function(){return 3},Object.defineProperties(Bh,kh);var zh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};zh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Yh.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},Yh.prototype.buildMaximalEdgeRings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Dh(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Yh.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Yh.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Yh.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),h=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var l=!1;h.contains(r)&&sc.isPointInRing(i,c.getCoordinates())&&(l=!0),l&&(null===o||s.contains(h))&&(o=u)}return o},Yh.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return tc.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Yh.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Uh.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Yh.prototype.interfaces_=function(){return[]},Yh.prototype.getClass=function(){return Yh};var Vh=function(){};Vh.prototype.getBounds=function(){},Vh.prototype.interfaces_=function(){return[]},Vh.prototype.getClass=function(){return Vh};var Hh=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Hh.prototype.getItem=function(){return this._item},Hh.prototype.getBounds=function(){return this._bounds},Hh.prototype.interfaces_=function(){return[Vh,Li]},Hh.prototype.getClass=function(){return Hh};var Wh=function(){this._size=null,this._items=null,this._size=0,this._items=new bc,this._items.add(null)};Wh.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Wh.prototype.size=function(){return this._size},Wh.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Wh.prototype.clear=function(){this._size=0,this._items.clear()},Wh.prototype.isEmpty=function(){return 0===this._size},Wh.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Jh=function(){};Jh.prototype.visitItem=function(t){},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Zh=function(){};Zh.prototype.insert=function(t,e){},Zh.prototype.remove=function(t,e){},Zh.prototype.query=function(){},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh};var Kh=function(){if(this._childBoundables=new bc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qh={serialVersionUID:{configurable:!0}};Kh.prototype.getLevel=function(){return this._level},Kh.prototype.size=function(){return this._childBoundables.size()},Kh.prototype.getChildBoundables=function(){return this._childBoundables},Kh.prototype.addChildBoundable=function(t){tc.isTrue(null===this._bounds),this._childBoundables.add(t)},Kh.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Kh.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Kh.prototype.interfaces_=function(){return[Vh,Li]},Kh.prototype.getClass=function(){return Kh},Qh.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Kh,Qh);var $h=function(){};$h.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$h.min=function(t){return $h.sort(t),t.get(0)},$h.sort=function(t,e){var n=t.toArray();e?qc.sort(n,e):qc.sort(n);for(var r=t.iterator(),i=0,o=n.length;itl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _u("neither boundable is composite")},tl.prototype.isLeaves=function(){return!(tl.isComposite(this._boundable1)||tl.isComposite(this._boundable2))},tl.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tl.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tl(o,e,this._itemDistance);s.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};el.prototype.getNodeCapacity=function(){return this._nodeCapacity},el.prototype.lastNode=function(t){return t.get(t.size()-1)},el.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Kh?t+=this.size(n):n instanceof Hh&&(t+=1)}return t}},el.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Hh&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},el.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bc:t}if(1===arguments.length){for(var e=arguments[0],n=new bc,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Kh){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Hh?n.add(i.getItem()):tc.shouldNeverReachHere()}return n.size()<=0?null:n}},el.prototype.insert=function(t,e){tc.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Hh(t,e))},el.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(tc.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Kh?this.boundablesAtLevel(n,s,i):(tc.isTrue(s instanceof Hh),-1===n&&i.add(s))}return null}},el.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bc;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;ut&&(t=r)}}return t+1}},el.prototype.createParentBoundables=function(t,e){tc.isTrue(!t.isEmpty());var n=new bc;n.add(this.createNode(e));var r=new bc(t);$h.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},el.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},el.prototype.interfaces_=function(){return[Li]},el.prototype.getClass=function(){return el},el.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new bc,r=0;r0;){var l=h.poll(),p=l.getDistance();if(p>=u)break;l.isLeaves()?(u=p,c=l):l.expandToQueue(h,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],y=new Hh(f,g),_=new tl(this.getRoot(),y,d);return this.nearestNeighbour(_)[0]}},e.prototype.interfaces_=function(){return[Zh,Li]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return sl},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(el),sl=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Yu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Kh),al=function(){};al.prototype.interfaces_=function(){return[]},al.prototype.getClass=function(){return al},al.relativeSign=function(t,e){return te?1:0},al.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=al.relativeSign(e.x,n.x),i=al.relativeSign(e.y,n.y);switch(t){case 0:return al.compareValue(r,i);case 1:return al.compareValue(i,r);case 2:return al.compareValue(i,-r);case 3:return al.compareValue(-r,i);case 4:return al.compareValue(-r,-i);case 5:return al.compareValue(-i,-r);case 6:return al.compareValue(-i,r);case 7:return al.compareValue(r,-i)}return tc.shouldNeverReachHere("invalid octant value"),0},al.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ul=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new bu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ul.prototype.getCoordinate=function(){return this.coord},ul.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ul.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:al.compare(this._segmentOctant,this.coord,e.coord)},ul.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ul.prototype.isInterior=function(){return this._isInterior},ul.prototype.interfaces_=function(){return[xu]},ul.prototype.getClass=function(){return ul};var cl=function(){this._nodeMap=new Gi,this._edge=null;var t=arguments[0];this._edge=t};cl.prototype.getSplitCoordinates=function(){var t=new Nc;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cl.prototype.addCollapsedNodes=function(){var t=new bc;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},cl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _u("Cannot compute the octant for two identical points "+i);return hl.octant(s,a)}};var ll=function(){};ll.prototype.getCoordinates=function(){},ll.prototype.size=function(){},ll.prototype.getCoordinate=function(t){},ll.prototype.isClosed=function(){},ll.prototype.setData=function(t){},ll.prototype.getData=function(){},ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll};var pl=function(){};pl.prototype.addIntersection=function(t,e){},pl.prototype.interfaces_=function(){return[ll]},pl.prototype.getClass=function(){return pl};var fl=function(){this._nodeList=new cl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fl.prototype.getCoordinates=function(){return this._pts},fl.prototype.size=function(){return this._pts.length},fl.prototype.getCoordinate=function(t){return this._pts[t]},fl.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fl.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fl.prototype.setData=function(t){this._data=t},fl.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hl.octant(t,e)},fl.prototype.getData=function(){return this._data},fl.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new bu(n.getIntersection(i));this.addIntersection(o,r)}},fl.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},fl.prototype.getNodeList=function(){return this._nodeList},fl.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof bu){var r=arguments[0];return sc.orientationIndex(this.p0,this.p1,r)}},gl.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gl.prototype.isVertical=function(){return this.p0.x===this.p1.x},gl.prototype.equals=function(t){if(!(t instanceof gl))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gl.prototype.intersection=function(t){var e=new rc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gl.prototype.project=function(){if(arguments[0]instanceof bu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new bu(t);var e=this.projectionFactor(t),n=new bu;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gl){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gl(s,a)}},gl.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gl.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gl.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gl.prototype.distancePerpendicular=function(t){return sc.distancePointLinePerpendicular(t,this.p0,this.p1)},gl.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gl.prototype.midPoint=function(){return gl.midPoint(this.p0,this.p1)},gl.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return mu.NaN;return((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gl.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=mu.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))0&&e<1)return this.project(t);return this.p0.distance(t)1||mu.isNaN(e))&&(e=1),e},gl.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gl.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gl.prototype.distance=function(){if(arguments[0]instanceof gl){var t=arguments[0];return sc.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof bu){var e=arguments[0];return sc.distancePointLine(e,this.p0,this.p1)}},gl.prototype.pointAlong=function(t){var e=new bu;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gl.prototype.hashCode=function(){var t=mu.doubleToLongBits(this.p0.x);t^=31*mu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=mu.doubleToLongBits(this.p1.x);n^=31*mu.doubleToLongBits(this.p1.y);return e^(Math.trunc(n)^Math.trunc(n>>32))},gl.prototype.interfaces_=function(){return[xu,Li]},gl.prototype.getClass=function(){return gl},gl.midPoint=function(t,e){return new bu((t.x+e.x)/2,(t.y+e.y)/2)},dl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gl,dl);var yl=function(){this.tempEnv1=new Yu,this.tempEnv2=new Yu,this._overlapSeg1=new gl,this._overlapSeg2=new gl};yl.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var _l=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_l.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_l.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Bh.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return wl},Object.defineProperties(e,n),e}(xl),wl=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yl),bl=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Il={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};bl.prototype.getEndCapStyle=function(){return this._endCapStyle},bl.prototype.isSingleSided=function(){return this._isSingleSided},bl.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=bl.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=bl.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==bl.JOIN_ROUND&&(this._quadrantSegments=bl.DEFAULT_QUADRANT_SEGMENTS)},bl.prototype.getJoinStyle=function(){return this._joinStyle},bl.prototype.setJoinStyle=function(t){this._joinStyle=t},bl.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},bl.prototype.getSimplifyFactor=function(){return this._simplifyFactor},bl.prototype.getQuadrantSegments=function(){return this._quadrantSegments},bl.prototype.setEndCapStyle=function(t){this._endCapStyle=t},bl.prototype.getMitreLimit=function(){return this._mitreLimit},bl.prototype.setMitreLimit=function(t){this._mitreLimit=t},bl.prototype.setSingleSided=function(t){this._isSingleSided=t},bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},bl.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Il.CAP_ROUND.get=function(){return 1},Il.CAP_FLAT.get=function(){return 2},Il.CAP_SQUARE.get=function(){return 3},Il.JOIN_ROUND.get=function(){return 1},Il.JOIN_MITRE.get=function(){return 2},Il.JOIN_BEVEL.get=function(){return 3},Il.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Il.DEFAULT_MITRE_LIMIT.get=function(){return 5},Il.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(bl,Il);var Nl=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=sc.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Nl.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&(!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r))},Nl.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n=0;r--)this.addPt(t[r])},Sl.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Ll.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ll.PI_TIMES_2;return t},Ll.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ll.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Ll.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Ll.interiorAngle=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Math.abs(i-r)},Ll.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ll.PI_TIMES_2;t>=Ll.PI_TIMES_2&&(t=0)}else{for(;t>=Ll.PI_TIMES_2;)t-=Ll.PI_TIMES_2;t<0&&(t=0)}return t},Ll.angleBetween=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Ll.diff(r,i)},Ll.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},Ll.toRadians=function(t){return t*Math.PI/180},Ll.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ll.COUNTERCLOCKWISE:n<0?Ll.CLOCKWISE:Ll.NONE},Ll.angleBetweenOriented=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n)-r;return i<=-Math.PI?i+Ll.PI_TIMES_2:i>Math.PI?i-Ll.PI_TIMES_2:i},Pl.PI_TIMES_2.get=function(){return 2*Math.PI},Pl.PI_OVER_2.get=function(){return Math.PI/2},Pl.PI_OVER_4.get=function(){return Math.PI/4},Pl.COUNTERCLOCKWISE.get=function(){return sc.COUNTERCLOCKWISE},Pl.CLOCKWISE.get=function(){return sc.CLOCKWISE},Pl.NONE.get=function(){return sc.COLLINEAR},Object.defineProperties(Ll,Pl);var Ol=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gl,this._seg1=new gl,this._offset0=new gl,this._offset1=new gl,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new rc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===bl.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Rl={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ol.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=sc.computeOrientation(this._s0,this._s1,this._s2),r=n===sc.CLOCKWISE&&this._side===Nh.LEFT||n===sc.COUNTERCLOCKWISE&&this._side===Nh.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ol.prototype.addLineEndCap=function(t,e){var n=new gl(t,e),r=new gl;this.computeOffsetSegment(n,Nh.LEFT,this._distance,r);var i=new gl;this.computeOffsetSegment(n,Nh.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,sc.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case bl.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case bl.CAP_SQUARE:var u=new bu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new bu(r.p1.x+u.x,r.p1.y+u.y),h=new bu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},Ol.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ol.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Uu.intersection(e.p0,e.p1,n.p0,n.p1);(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof ju))throw t;o=new bu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ol.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,h=Math.atan2(c,u);r===sc.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},Ol.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new bu((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new bu((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ol.prototype.createCircle=function(t){var e=new bu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ol.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ol.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sl,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ol.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ol.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===bl.JOIN_BEVEL||this._bufParams.getJoinStyle()===bl.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,sc.CLOCKWISE,this._distance))},Ol.prototype.closeRing=function(){this._segList.closeRing()},Ol.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol},Rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ol,Rl);var Tl=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Tl.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Cc.reverse(o),o},Tl.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Tl.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Nh.RIGHT&&(r=-r);var i=Nl.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Tl.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Nl.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Nh.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Nl.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Nh.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Tl.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:e.createCircle(t);break;case bl.CAP_SQUARE:e.createSquare(t)}},Tl.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Tl.prototype.getBufferParameters=function(){return this._bufParams},Tl.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Tl.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Tl.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Tl.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Tl.prototype.getSegGen=function(t){return new Ol(this._precisionModel,this._bufParams,t)},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},Tl.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&arguments[1]instanceof jh)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;cthis._seg.p1.y&&this._seg.reverse();if(!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||sc.computeOrientation(this._seg.p0,this._seg.p1,o)===sc.RIGHT)){var h=s.getDepth(Nh.LEFT);this._seg.p0.equals(u[c])||(h=s.getDepth(Nh.RIGHT));var l=new Fl(this._seg,h);a.add(l)}}else if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&Lu(arguments[1],wc))for(var p=arguments[0],f=arguments[1],g=arguments[2],d=f.iterator();d.hasNext();){var y=d.next();y.isForward()&&this.findStabbedSegments(p,y,g)}},Al.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(0===e.size())return 0;return $h.min(e)._leftDepth},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},Dl.DepthSegment.get=function(){return Fl},Object.defineProperties(Al,Dl);var Fl=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gl(t),this._leftDepth=e};Fl.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n?n:0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fl.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fl.prototype.toString=function(){return this._upwardSeg.toString()},Fl.prototype.interfaces_=function(){return[xu]},Fl.prototype.getClass=function(){return Fl};var ql=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};ql.prototype.area=function(){return ql.area(this.p0,this.p1,this.p2)},ql.prototype.signedArea=function(){return ql.signedArea(this.p0,this.p1,this.p2)},ql.prototype.interpolateZ=function(t){if(null===t)throw new _u("Supplied point is null.");return ql.interpolateZ(t,this.p0,this.p1,this.p2)},ql.prototype.longestSideLength=function(){return ql.longestSideLength(this.p0,this.p1,this.p2)},ql.prototype.isAcute=function(){return ql.isAcute(this.p0,this.p1,this.p2)},ql.prototype.circumcentre=function(){return ql.circumcentre(this.p0,this.p1,this.p2)},ql.prototype.area3D=function(){return ql.area3D(this.p0,this.p1,this.p2)},ql.prototype.centroid=function(){return ql.centroid(this.p0,this.p1,this.p2)},ql.prototype.inCentre=function(){return ql.inCentre(this.p0,this.p1,this.p2)},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},ql.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},ql.det=function(t,e,n,r){return t*r-e*n},ql.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},ql.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},ql.isAcute=function(t,e,n){return!!Ll.isAcute(t,e,n)&&(!!Ll.isAcute(e,n,t)&&!!Ll.isAcute(n,t,e))},ql.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*ql.det(o,s,a,u),h=ql.det(s,o*o+s*s,u,a*a+u*u),l=ql.det(o,o*o+s*s,a,a*a+u*u);return new bu(r-h/c,i+l/c)},ql.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Uu(t.x+n/2,t.y+r/2,1),o=new Uu(t.x-r+n/2,t.y+n+r/2,1);return new Uu(i,o)},ql.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new bu(t.x+i*o,t.y+i*s)},ql.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,h=o*s-r*u,l=r*a-i*s,p=c*c+h*h+l*l,f=Math.sqrt(p)/2;return f},ql.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new bu(r,i)},ql.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new bu(a,u)};var Gl=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gl.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addPolygon=function(t){var e=this._distance,n=Nh.LEFT;this._distance<0&&(e=-this._distance,n=Nh.RIGHT);var r=t.getExteriorRing(),i=Cc.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,Su.EXTERIOR,Su.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Nh.opposite(n),Su.INTERIOR,Su.EXTERIOR)}},Gl.prototype.isTriangleErodedCompletely=function(t,e){var n=new ql(t[0],t[1],t[2]),r=n.inCentre();return sc.distancePointLine(r,n.p0,n.p1)=eh.MINIMUM_VALID_SIZE&&sc.isCCW(t)&&(o=i,s=r,n=Nh.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gl.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $c?this.addPolygon(t):t instanceof Jc?this.addLineString(t):t instanceof Kc?this.addPoint(t):t instanceof th?this.addCollection(t):t instanceof Xc?this.addCollection(t):t instanceof nh?this.addCollection(t):t instanceof jc&&this.addCollection(t)},Gl.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gl.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof jc?(this._subcollectionIterator=new kl(t),this._subcollectionIterator.next()):t},kl.prototype.remove=function(){throw new Error(this.getClass().getName())},kl.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},kl.prototype.interfaces_=function(){return[Ec]},kl.prototype.getClass=function(){return kl},kl.isAtomic=function(t){return!(t instanceof jc)};var zl=function(){this._geom=null;var t=arguments[0];this._geom=t};zl.prototype.locate=function(t){return zl.locate(t,this._geom)},zl.prototype.interfaces_=function(){return[Bl]},zl.prototype.getClass=function(){return zl},zl.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&sc.isPointInRing(t,e.getCoordinates())},zl.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zl.isPointInRing(t,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Nh.LEFT),r=t.getDepth(Nh.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Mh("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(tc.isTrue(null!==e,"found null for first outgoing dirEdge"),tc.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){e.next().isInResult()&&t++}return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();){i.next().getEdgeRing()===n&&r++}return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=Su.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Su.INTERIOR;break}if(r.isInResult()){t=Su.EXTERIOR;break}}}if(t===Su.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===Su.INTERIOR):(s.isInResult()&&(i=Su.EXTERIOR),a.isInResult()&&(i=Su.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Rh(Su.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==Su.INTERIOR&&o!==Su.BOUNDARY||this._label.setLocation(i,Su.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jl),Ul=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new qh(t,new Xl)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),Yl=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yl.prototype.compareTo=function(t){var e=t;return Yl.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yl.prototype.interfaces_=function(){return[xu]},Yl.prototype.getClass=function(){return Yl},Yl.orientation=function(t){return 1===Cc.increasingDirection(t)},Yl.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var h=t[u].compareTo(n[c]);if(0!==h)return h;var l=(u+=i)===s,p=(c+=o)===a;if(l&&!p)return-1;if(!l&&p)return 1;if(l&&p)return 0}};var Vl=function(){this._edges=new bc,this._ocaMap=new Gi};Vl.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Vl.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Vl.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new ep(o,new Rh(this.edge._label))},Zl.prototype.add=function(t,e,n){var r=new Jl(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Zl.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Kl=function(){};Kl.prototype.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=this.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(en?e:n},Ql.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(r=1),this._depth[t][n]=r}}},$l.prototype.getDelta=function(t){return this._depth[t][Nh.RIGHT]-this._depth[t][Nh.LEFT]},$l.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Su.EXTERIOR:Su.INTERIOR},$l.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$l.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==Su.EXTERIOR&&r!==Su.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=$l.depthAtLocation(r):this._depth[e][n]+=$l.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===Su.INTERIOR&&this._depth[i][o]++}},$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l},$l.depthAtLocation=function(t){return t===Su.EXTERIOR?0:t===Su.INTERIOR?1:$l.NULL_VALUE},tp.NULL_VALUE.get=function(){return-1},Object.defineProperties($l,tp);var ep=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $l,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);t[0]=this.pts[0],t[1]=this.pts[1];return new e(t,Rh.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Ql(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Yu;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return tc.isTrue(!(s&&a),"Found bad envelope test"),a},sp.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new bu(this._maxx,this._maxy),this._corner[1]=new bu(this._minx,this._maxy),this._corner[2]=new bu(this._minx,this._miny),this._corner[3]=new bu(this._maxx,this._miny)},sp.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sp.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sp.prototype.getCoordinate=function(){return this._originalPt},sp.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sp.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sp.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Yu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sp.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},sp.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!r)||(!!t.equals(this._pt)||!!e.equals(this._pt))))))},sp.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp},ap.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sp,ap);var up=function(){this.tempEnv1=new Yu,this.selectedSegment=new gl};up.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up};var cp=function(){this._index=null;var t=arguments[0];this._index=t},hp={HotPixelSnapAction:{configurable:!0}};cp.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new lp(e,n,r);return this._index.query(i,{interfaces_:function(){return[Jh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},hp.HotPixelSnapAction.get=function(){return lp},Object.defineProperties(cp,hp);var lp=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(up),pp=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bc};pp.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Mh))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gp.precisionScaleFactor(this._argGeom,this._distance,n),i=new fh(r);this.bufferFixedPrecision(i)}},gp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fh.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gp.prototype.bufferOriginalPrecision=function(){try{var t=new np(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Qu))throw t;this._saveException=t}},gp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gp(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new gp(n);o.setQuadrantSegments(i);return o.getResultGeometry(r)}if(arguments[2]instanceof bl&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new gp(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],h=arguments[1],l=arguments[2],p=arguments[3],f=new gp(c);f.setQuadrantSegments(l),f.setEndCapStyle(p);return f.getResultGeometry(h)}},gp.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=Pu.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},dp.CAP_ROUND.get=function(){return bl.CAP_ROUND},dp.CAP_BUTT.get=function(){return bl.CAP_FLAT},dp.CAP_FLAT.get=function(){return bl.CAP_FLAT},dp.CAP_SQUARE.get=function(){return bl.CAP_SQUARE},dp.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gp,dp);var yp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};yp.prototype.getCoordinates=function(){return this._pt},yp.prototype.getCoordinate=function(t){return this._pt[t]},yp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);rthis._distance&&this.initialize(e,n,r)}},yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp};var _p=function(){};_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.computeDistance=function(){if(arguments[2]instanceof yp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new gl,o=0;o0||this._isIn?Su.INTERIOR:Su.EXTERIOR)},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip};var Np=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Cp={INSIDE_AREA:{configurable:!0}};Np.prototype.isInsideArea=function(){return this._segIndex===Np.INSIDE_AREA},Np.prototype.getCoordinate=function(){return this._pt},Np.prototype.getGeometryComponent=function(){return this._component},Np.prototype.getSegmentIndex=function(){return this._segIndex},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np},Cp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Np,Cp);var Sp=function(t){this._pts=t||null};Sp.prototype.filter=function(t){t instanceof Kc&&this._pts.add(t)},Sp.prototype.interfaces_=function(){return[kc]},Sp.prototype.getClass=function(){return Sp},Sp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kc?$h.singletonList(t):Sp.getPoints(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kc?n.add(e):e instanceof jc&&e.apply(new Sp(n)),n}};var Mp=function(){this._locations=null;var t=arguments[0];this._locations=t};Mp.prototype.filter=function(t){(t instanceof Kc||t instanceof Jc||t instanceof $c)&&this._locations.add(new Np(t,0,t.getCoordinate()))},Mp.prototype.interfaces_=function(){return[kc]},Mp.prototype.getClass=function(){return Mp},Mp.getLocations=function(t){var e=new bc;return t.apply(new Mp(e)),e};var Lp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ip,this._minDistanceLocation=null,this._minDistance=mu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=wp.getPolygons(this._geom[e]);if(i.size()>0){var o=Mp.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;cthis._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;fthis._distance&&this.initialize(e,n,r)}},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp};var Op=function(){};Op.prototype.interfaces_=function(){return[]},Op.prototype.getClass=function(){return Op},Op.computeDistance=function(){if(arguments[2]instanceof Pp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gl,i=t.getCoordinates(),o=0;o1||t<=0)throw new _u("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rp.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rp.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rp.prototype.computeOrientedDistance=function(t,e,n){var r=new Ap(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dp(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Rp.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rp.prototype.interfaces_=function(){return[]},Rp.prototype.getClass=function(){return Rp},Rp.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Rp(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Rp(n,r);return o.setDensifyFraction(i),o.distance()}},Tp.MaxPointDistanceFilter.get=function(){return Ap},Tp.MaxDensifiedByFractionDistanceFilter.get=function(){return Dp},Object.defineProperties(Rp,Tp);var Ap=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._euclideanDist=new Op,this._geom=null;var t=arguments[0];this._geom=t};Ap.prototype.filter=function(t){this._minPtDist.initialize(),Op.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ap.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ap.prototype.interfaces_=function(){return[pc]},Ap.prototype.getClass=function(){return Ap};var Dp=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dp.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;sn){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ku.toLineString(i[0],i[1])+")"}},Fp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fp.VERBOSE&&Xu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fp.prototype.checkNegativeValid=function(){if(!(this._input instanceof $c||this._input instanceof nh||this._input instanceof jc))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fp.prototype.getErrorIndicator=function(){return this._errorIndicator},Fp.prototype.checkMinimumDistance=function(t,e,n){var r=new Lp(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gp.prototype.report=function(t){if(!Gp.VERBOSE)return null;Xu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gp.prototype.getErrorMessage=function(){return this._errorMsg},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.isValidMsg=function(t,e,n){var r=new Gp(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gp.isValid=function(t,e,n){return!!new Gp(t,e,n).isValid()},Bp.VERBOSE.get=function(){return!1},Bp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gp,Bp);var kp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};kp.prototype.getCoordinates=function(){return this._pts},kp.prototype.size=function(){return this._pts.length},kp.prototype.getCoordinate=function(t){return this._pts[t]},kp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},kp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hl.octant(this.getCoordinate(t),this.getCoordinate(t+1))},kp.prototype.setData=function(t){this._data=t},kp.prototype.getData=function(){return this._data},kp.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},kp.prototype.interfaces_=function(){return[ll]},kp.prototype.getClass=function(){return kp};var zp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zp.prototype.getIntersectionSegments=function(){return this._intSegments},zp.prototype.count=function(){return this._intersectionCount},zp.prototype.getIntersections=function(){return this._intersections},zp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zp.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){if(!(this.isEndSegment(t,e)||this.isEndSegment(n,r)))return null}var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zp.prototype.interfaces_=function(){return[Hl]},zp.prototype.getClass=function(){return zp},zp.createAllIntersectionsFinder=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e},zp.createAnyIntersectionFinder=function(t){return new zp(t)},zp.createIntersectionCounter=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jp=function(){this._li=new rc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jp.prototype.getIntersections=function(){return this._segInt.getIntersections()},jp.prototype.isValid=function(){return this.execute(),this._isValid},jp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new El;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Mh(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ku.toLineString(t[0],t[1])+" and "+Ku.toLineString(t[2],t[3])},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.computeIntersections=function(t){var e=new jp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Xp=function t(){this._nv=null;var e=arguments[0];this._nv=new jp(t.toSegmentStrings(e))};Xp.prototype.checkValid=function(){this._nv.checkValid()},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp},Xp.toSegmentStrings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new kp(r.getCoordinates(),r))}return e},Xp.checkValid=function(t){new Xp(t).checkValid()};var Up=function(t){this._mapOp=t};Up.prototype.map=function(t){for(var e=new bc,n=0;n0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp};var Wp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gl,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jc&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Wp.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r=0&&t.add(o+1,new bu(i),!1)}},Wp.prototype.findSegmentIndexToSnap=function(t,e){for(var n=mu.MAX_VALUE,r=-1,i=0;ie&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Jp.computeOverlaySnapTolerance(i),Jp.computeOverlaySnapTolerance(o))}},Jp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jp.SNAP_PRECISION_FACTOR},Jp.snapToSelf=function(t,e,n){return new Jp(t).snapToSelf(e,n)},Zp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jp,Zp);var Kp=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wp(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hp),Qp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qp.prototype.getCommon=function(){return mu.longBitsToDouble(this._commonBits)},Qp.prototype.add=function(t){var e=mu.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Qp.signExpBits(this._commonBits),this._isFirst=!1,null;if(Qp.signExpBits(e)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Qp.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Qp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Qp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=mu.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+mu.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qp.prototype.interfaces_=function(){return[]},Qp.prototype.getClass=function(){return Qp},Qp.getBit=function(t,e){return 0!=(t&1<>52},Qp.zeroLowerBits=function(t,e){return t&~((1<=0;r--){if(Qp.getBit(t,r)!==Qp.getBit(e,r))return n;n++}return 52};var $p=function(){this._commonCoord=null,this._ccFilter=new ef},tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};$p.prototype.addCommonBits=function(t){var e=new nf(this._commonCoord);t.apply(e),t.geometryChanged()},$p.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new bu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new nf(e);return t.apply(n),t.geometryChanged(),t},$p.prototype.getCommonCoordinate=function(){return this._commonCoord},$p.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},$p.prototype.interfaces_=function(){return[]},$p.prototype.getClass=function(){return $p},tf.CommonCoordinateFilter.get=function(){return ef},tf.Translater.get=function(){return nf},Object.defineProperties($p,tf);var ef=function(){this._commonBitsX=new Qp,this._commonBitsY=new Qp};ef.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ef.prototype.getCommonCoordinate=function(){return new bu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ef.prototype.interfaces_=function(){return[pc]},ef.prototype.getClass=function(){return ef};var nf=function(){this.trans=null;var t=arguments[0];this.trans=t};nf.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},nf.prototype.isDone=function(){return!1},nf.prototype.isGeometryChanged=function(){return!0},nf.prototype.interfaces_=function(){return[zc]},nf.prototype.getClass=function(){return nf};var rf=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};rf.prototype.selfSnap=function(t){return new Jp(t).snapTo(t,this._snapTolerance)},rf.prototype.removeCommonBits=function(t){this._cbr=new $p,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},rf.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rf.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Cf.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rf.prototype.checkValid=function(t){t.isValid()||Xu.out.println("Snapped geometry is invalid")},rf.prototype.computeSnapTolerance=function(){this._snapTolerance=Jp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rf.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jp.snap(e[0],e[1],this._snapTolerance)},rf.prototype.interfaces_=function(){return[]},rf.prototype.getClass=function(){return rf},rf.overlayOp=function(t,e,n){return new rf(t,e).getResultGeometry(n)},rf.union=function(t,e){return rf.overlayOp(t,e,Cf.UNION)},rf.intersection=function(t,e){return rf.overlayOp(t,e,Cf.INTERSECTION)},rf.symDifference=function(t,e){return rf.overlayOp(t,e,Cf.SYMDIFFERENCE)},rf.difference=function(t,e){return rf.overlayOp(t,e,Cf.DIFFERENCE)};var of=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};of.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Cf.overlayOp(this._geom[0],this._geom[1],t);n=!0}catch(t){if(!(t instanceof Qu))throw t;r=t}if(!n)try{e=rf.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Qu?r:t}return e},of.prototype.interfaces_=function(){return[]},of.prototype.getClass=function(){return of},of.overlayOp=function(t,e,n){return new of(t,e).getResultGeometry(n)},of.union=function(t,e){return of.overlayOp(t,e,Cf.UNION)},of.intersection=function(t,e){return of.overlayOp(t,e,Cf.INTERSECTION)},of.symDifference=function(t,e){return of.overlayOp(t,e,Cf.SYMDIFFERENCE)},of.difference=function(t,e){return of.overlayOp(t,e,Cf.DIFFERENCE)};var sf=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};sf.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};var af=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},uf={INSERT:{configurable:!0},DELETE:{configurable:!0}};af.prototype.isDelete=function(){return this._eventType===af.DELETE},af.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},af.prototype.getObject=function(){return this._obj},af.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},af.prototype.getInsertEvent=function(){return this._insertEvent},af.prototype.isInsert=function(){return this._eventType===af.INSERT},af.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},af.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},af.prototype.interfaces_=function(){return[xu]},af.prototype.getClass=function(){return af},uf.INSERT.get=function(){return 1},uf.DELETE.get=function(){return 2},Object.defineProperties(af,uf);var cf=function(){};cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};hf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hf.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hf.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},hf.prototype.hasProperIntersection=function(){return this._hasProper},hf.prototype.hasIntersection=function(){return this._hasIntersection},hf.prototype.isDone=function(){return this._isDone},hf.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},hf.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hf.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lf=function(t){function e(){t.call(this),this.events=new bc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$h.sort(this.events);for(var t=0;te||this._maxo?1:0},gf.prototype.interfaces_=function(){return[wu]},gf.prototype.getClass=function(){return gf};var df=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),yf=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),_f=function(){this._leaves=new bc,this._root=null,this._level=0};_f.prototype.buildTree=function(){$h.sort(this._leaves,new pf.NodeComparator);for(var t=this._leaves,e=null,n=new bc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_f.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new df(t,e,n))},_f.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_f.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_f.prototype.printNode=function(t){Xu.out.println(Ku.toLineString(new bu(t._min,this._level),new bu(t._max,this._level)))},_f.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_f.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===Su.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Cc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;sc.isCCW(r)&&(i=n,o=e);var s=new ep(r,new Rh(this._argIndex,Su.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],Su.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Rh(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lf},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof nh&&(this._useBoundaryDeterminationRule=!1),e instanceof $c)this.addPolygon(e);else if(e instanceof Jc)this.addLineString(e);else if(e instanceof Kc)this.addPoint(e);else if(e instanceof th)this.addCollection(e);else if(e instanceof Xc)this.addCollection(e);else if(e instanceof nh)this.addCollection(e);else{if(!(e instanceof jc))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new vf(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?Su.BOUNDARY:Su.INTERIOR},e}(Uh),If=function(){if(this._li=new rc,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bf(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,e,r),this._arg[1]=new bf(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,i,s),this._arg[1]=new bf(1,o,s)}};If.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},If.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If};var Nf=function(){};Nf.prototype.interfaces_=function(){return[]},Nf.prototype.getClass=function(){return Nf},Nf.map=function(){if(arguments[0]instanceof cc&&Lu(arguments[1],Nf.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bc,r=0;r=t.size()?null:t.get(e)},Tf.union=function(t){return new Tf(t).union()},Af.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Tf,Af);var Df=function(){};Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.UNION)};var Ff=function(){return new Yi};Yi.prototype={constructor:Yi,reset:function(){this.s=this.t=0},add:function(t){Vi(qf,t,this.t),Vi(this,qf.s,this.s),this.s?this.t+=qf.t:this.s=qf.t},valueOf:function(){return this.s}};var qf=new Yi,Gf=1e-6,Bf=Math.PI,kf=Bf/2,zf=Bf/4,jf=2*Bf,Xf=180/Bf,Uf=Bf/180,Yf=Math.abs,Vf=Math.atan,Hf=Math.atan2,Wf=Math.cos,Jf=Math.exp,Zf=Math.log,Kf=Math.sin,Qf=Math.sqrt,$f=Math.tan,tg={Feature:function(t,e){Ji(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r2?t[2]*Uf:0),e.invert=function(e){return e=t.invert(e[0]*Uf,e[1]*Uf),e[0]*=Xf,e[1]*=Xf,e},e},og=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},sg=function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,h=1,l=e[0]-a,p=e[1]-u;if(s=n-a,l||!(s>0)){if(s/=l,l<0){if(s0){if(s>h)return;s>c&&(c=s)}if(s=i-a,l||!(s<0)){if(s/=l,l<0){if(s>h)return;s>c&&(c=s)}else if(l>0){if(s0)){if(s/=p,p<0){if(s0){if(s>h)return;s>c&&(c=s)}if(s=o-u,p||!(s<0)){if(s/=p,p<0){if(s>h)return;s>c&&(c=s)}else if(p>0){if(s0&&(t[0]=a+c*l,t[1]=u+c*p),h<1&&(e[0]=a+h*l,e[1]=u+h*p),!0}}}}},ag=function(t,e){return Yf(t[0]-e[0])=0;--o)i.point((h=c[o])[0],h[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},cg=function(t,e){return te?1:t>=e?0:NaN},hg=(function(t){1===t.length&&(t=function(t){return function(e,n){return cg(t(e),n)}}(t))}(cg),function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}),lg=1e9,pg=-lg,fg=Ff(),gg=(Ff(),function(t){return t}),dg=(Ff(),Ff(),1/0),yg=dg,_g=-dg,mg=_g,vg={point:function(t,e){t_g&&(_g=t),emg&&(mg=e)},lineStart:Wi,lineEnd:Wi,polygonStart:Wi,polygonEnd:Wi,result:function(){var t=[[dg,yg],[_g,mg]];return _g=mg=-(yg=dg=1/0),t}},xg=(Ff(),function(t,e,n,r){return function(i,o){function s(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function a(t,e){var n=i(t,e);y.point(n[0],n[1])}function u(){E.point=a,y.lineStart()}function c(){E.point=s,y.lineEnd()}function h(t,e){d.push([t,e]);var n=i(t,e);v.point(n[0],n[1])}function l(){v.lineStart(),d=[]}function p(){h(d[0][0],d[0][1]),v.lineEnd();var t,e,n,r,i=v.clean(),s=m.result(),a=s.length;if(d.pop(),f.push(d),d=null,a)if(1&i){if(n=s[0],(e=n.length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&s.push(s.pop().concat(s.shift())),g.push(s.filter(go))}var f,g,d,y=e(o),_=i.invert(r[0],r[1]),m=og(),v=e(m),x=!1,E={point:s,lineStart:u,lineEnd:c,polygonStart:function(){E.point=h,E.lineStart=l,E.lineEnd=p,g=[],f=[]},polygonEnd:function(){E.point=s,E.lineStart=u,E.lineEnd=c,g=hg(g);var t=function(t,e){var n=e[0],r=e[1],i=[Kf(n),-Wf(n),0],o=0,s=0;fg.reset();for(var a=0,u=t.length;a=0?1:-1,I=b*w,N=I>Bf,C=g*x;if(fg.add(Hf(C*b*Kf(I),d*E+C*Wf(I))),o+=N?w+b*jf:w,N^p>=n^m>=n){var S=eo($i(l),$i(_));io(S);var M=eo(i,S);io(M);var L=(N^w>=0?-1:1)*Hi(M[2]);(r>L||r===L&&(S[0]||S[1]))&&(s+=N^w>=0?1:-1)}}return(o<-Gf||o0?Bf:-Bf,u=Yf(o-n);Yf(u-Bf)0?kf:-kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Bf&&(Yf(n-i)Gf?Vf((Kf(e)*(o=Wf(r))*Kf(n)-Kf(r)*(i=Wf(e))*Kf(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*kf,r.point(-Bf,i),r.point(0,i),r.point(Bf,i),r.point(Bf,0),r.point(Bf,-i),r.point(0,-i),r.point(-Bf,-i),r.point(-Bf,0),r.point(-Bf,i);else if(Yf(t[0]-e[0])>Gf){var o=t[0]o}function r(t,e,n){var r=[1,0,0],i=eo($i(t),$i(e)),s=to(i,i),a=i[0],u=s-a*a;if(!u)return!n&&t;var c=o*s/u,h=-o*a/u,l=eo(r,i),p=ro(r,c);no(p,ro(i,h));var f=l,g=to(p,f),d=to(f,f),y=g*g-d*(to(p,p)-1);if(!(y<0)){var _=Qf(y),m=ro(f,(-g-_)/d);if(no(m,p),m=Qi(m),!n)return m;var v,x=t[0],E=e[0],w=t[1],b=e[1];E0^m[1]<(Yf(m[0]-x)Bf^(x<=m[0]&&m[0]<=E)){var C=ro(f,(-g+_)/d);return no(C,p),[m,Qi(C)]}}}function i(e,n){var r=s?t:Bf-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var o=Wf(t),s=o>0,a=Yf(o)>Gf;return xg(n,function(t){var e,o,u,c,h;return{lineStart:function(){c=u=!1,h=1},point:function(l,p){var f,g=[l,p],d=n(l,p),y=s?d?0:i(l,p):d?i(l+(l<0?Bf:-Bf),p):0;if(!e&&(c=u=d)&&t.lineStart(),d!==u&&(!(f=r(e,g))||ag(e,f)||ag(g,f))&&(g[0]+=Gf,g[1]+=Gf,d=n(g[0],g[1])),d!==u)h=0,d?(t.lineStart(),f=r(g,e),t.point(f[0],f[1])):(f=r(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(a&&e&&s^d){var _;y&o||!(_=r(g,e,!0))||(h=0,s?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!d||e&&ag(e,g)||t.point(g[0],g[1]),e=g,u=d,o=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(c&&u)<<1}}},function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Wf(e),a=Kf(e),u=r*n;null==i?(i=e+r*jf,o=e-u/2):(i=ho(s,i),o=ho(s,o),(r>0?io)&&(i+=r*jf));for(var c,h=i;r>0?h>o:h4*e&&d--){var x=s+p,E=a+f,w=u+g,b=Qf(x*x+E*E+w*w),I=Hi(w/=b),N=Yf(Yf(w)-1)e||Yf((_*L+m*P)/v-.5)>.3||s*p+a*f+u*g2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)};t.projection=Cs,t.random=gu,t.clusters=du,t.helpers=ko,t.invariant=jo,t.meta=zo,t.isolines=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=rt(t,{zProperty:r,flip:!0});return c(function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach(function(t){S(t,p)}),t}(function(t,e,n,r,i){for(var o=[],s=1;ss;)r=Math.floor((o+1)*Math.random()),n=i[r],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=he,t.square=le,t.circle=fe,t.midpoint=function(t,e){return pe(t,qt(t,e)/2,ge(t,e))},t.center=de,t.centerOfMass=_e,t.centroid=ye,t.combine=function(t){function n(t,e,n){n?r[e].coordinates=r[e].coordinates.concat(t.geometry.coordinates):r[e].coordinates.push(t.geometry.coordinates),r[e].properties.push(t.properties)}var r={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(r).reduce(function(t,e){return t[e.replace("Multi","")]=e,t},{});return O(t,function(t){t.geometry&&(r[t.geometry.type]?n(t,t.geometry.type,!0):i[t.geometry.type]&&n(t,i[t.geometry.type],!1))}),c(Object.keys(r).filter(function(t){return r[t].coordinates.length}).sort().map(function(t){return e({type:t,coordinates:r[t].coordinates},{collectedProperties:r[t].properties})}))},t.distance=qt,t.explode=me,t.bbox=j,t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=De(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(De(t))}),e},t.bboxPolygon=ce,t.booleanPointInPolygon=Pt,t.nearestPoint=Fe,t.nearestPointOnLine=on,t.nearestPointToLine=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.units,i=n.properties||{};if(!t)throw new Error("points is required");if(!(t=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return A(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t;default:throw new Error("points must be a Point Collection")}}(t)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==K(e))throw new Error("line must be a LineString");var o=1/0,s=null;return O(t,function(t){var n=gn(t,e,{units:r});n=0&&c<=1&&(f.onLine1=!0),h>=0&&h<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);s&&i.features.push(r([s[0],s[1]]))}})}),i},t.pointOnFeature=yn,t.area=mn,t.along=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!b(e))throw new Error("distance must be a number");for(var o=0,s=0;s=o&&s===i.length-1);s++){if(o>=e){var a=e-o;if(a){var u=ge(i[s],i[s-1])-180;return pe(i[s],a,u,n)}return r(i[s])}o+=qt(i[s],i[s+1],n)}return r(i[i.length-1])},t.length=bn,t.lineSlice=function(t,e,n){var r=U(n);if("LineString"!==K(n))throw new Error("line must be a LineString");for(var i,o=on(n,t),s=on(n,e),u=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],c=i[0].properties.index+1;c is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=Gt(t));var i=[];switch(t.type){case"GeometryCollection":return A(t,function(t){sr(t,n)}),t;case"FeatureCollection":return O(t,function(t){O(sr(t,n),function(t){i.push(t)})}),c(i)}return sr(t,n)},t.isobands=function(t,e,n){if(n=n||{},!I(n))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},s=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=cr(t,{zProperty:r,flip:!0}),u=function(t,e,n){for(var r=[],i=1;i0}(t,e);case"Polygon":return!br(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!br(t,e);case"Polygon":return!function(t,e){for(var n=0;n0)for(var n=0;n0))throw new Error("Invalid maxDistance");if(!(void 0===r||null===r||Math.sign(r)>0))throw new Error("Invalid minPoints");t=Gt(t),r=r||3;var o=new Ha.DBSCAN,s=-1;return o.run(T(t),E(e,i),r,qt).forEach(function(e){s++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=s,n.properties.dbscan="core"})}),o.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,r=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(n=n||Math.round(Math.sqrt(i/2)))>i&&(n=i),!1!==r&&void 0!==r||(t=Gt(t));var o=T(t),s=o.slice(0,n),a=eu(o,n,s),u={};return a.centroids.forEach(function(t,e){u[e]=t}),O(t,function(t,e){var n=a.idxs[e];t.properties.cluster=n,t.properties.centroid=u[n]}),t},t.pointToLineDistance=gn,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Dr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Dr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=en(te(t)).features,r=en(te(e)).features,i=0;i=d;){for(var T=[],A=[],D=g+w,F=0;D<=y;){var q=r([D,O]),G=function(t,e){for(var n=0;n0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var r=Po(e,o);0!==r&&(e-=r)}if(e!==+u){var l=i[e];l&&c&&(void 0!==n&&l.properties[n]!==c.properties[n]||Tr(c,l)&&function(t,e){var n=a(T(t)),r=a(T(e));return nn(n,r).features.length>0}(c,l)&&(i[u]=Mo(c,l),o.push(t.properties.origIndexPosition),o.sort(function(t,e){return t-e}),s.remove(t),i.splice(e,1),c.properties.origIndexPosition=u,s.remove(c,function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition}),h=!0))}}),h){if(!c)continue;c.properties.origIndexPosition=u,s.insert(c),u--}}return i.forEach(function(t){delete t.properties.origIndexPosition,delete t.bbox}),r},t.hexGrid=Oo,t.mask=function(t,e){var n=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),r=function(t){var e=[],n=[];return F(t,function(t){var r=t.geometry.coordinates,i=r[0],s=r.slice(1);e.push(o([i])),s.forEach(function(t){n.push(o([t]))})}),[c(e),c(n)]}(t),i=r[0],s=r[1];return function(t,e,n){var r=[];return r.push(t.geometry.coordinates[0]),F(e,function(t){r.push(t.geometry.coordinates[0])}),F(n,function(t){r.push(t.geometry.coordinates[0])}),o(r)}(n,i=Ro(i),s=Ro(s))},t.squareGrid=Ao,t.triangleGrid=Do,t.interpolate=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=j(t);switch(r){case"point":case"points":s=Ln(a,e,n);break;case"square":case"squares":s=Ao(a,e,n);break;case"hex":case"hexes":s=Oo(a,e,n);break;case"triangle":case"triangles":s=Do(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return O(s,function(e){var s=0,a=0;O(t,function(t){var u,c=qt("point"===r?e:ye(e),t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u});var c=Gt(e);c.properties[i]=s/a,u.push(c)}),c(u)},t.pointOnSurface=yn,t.polygonToLineString=kn,t.lineStringToPolygon=jn,t.inside=Pt,t.within=Rt,t.bezier=ue,t.nearest=Fe,t.pointOnLine=on,t.lineDistance=bn,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=_,t.distanceToRadians=y,t.radiansToDistance=d,t.bearingToAngle=m,t.convertDistance=E,t.toMercator=cn,t.toWgs84=hn,t.randomPosition=_i,t.randomPoint=mi,t.randomPolygon=vi,t.randomLineString=xi,t.getCluster=wi,t.clusterEach=bi,t.clusterReduce=Ii,t.createBins=Ni,t.applyFilter=Ci,t.propertiesContainsFilter=Si,t.filterProperties=Mi,t.earthRadius=Fo,t.factors=qo,t.unitsFactors=Go,t.areaFactors=Bo,t.feature=e,t.geometry=n,t.point=r,t.points=i,t.polygon=o,t.polygons=s,t.lineString=a,t.lineStrings=u,t.featureCollection=c,t.multiLineString=h,t.multiPoint=l,t.multiPolygon=p,t.geometryCollection=f,t.round=g,t.radiansToLength=d,t.lengthToRadians=y,t.lengthToDegrees=_,t.bearingToAzimuth=m,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=E,t.convertArea=w,t.isNumber=b,t.isObject=I,t.validateBBox=N,t.validateId=C,t.getCoord=X,t.getCoords=U,t.containsNumber=Y,t.geojsonType=V,t.featureOf=H,t.collectionOf=W,t.getGeom=J,t.getGeomType=Z,t.getType=K,t.coordEach=S,t.coordReduce=M,t.propEach=L,t.propReduce=P,t.featureEach=O,t.featureReduce=R,t.coordAll=T,t.geomEach=A,t.geomReduce=D,t.flattenEach=F,t.flattenReduce=q,t.segmentEach=G,t.segmentReduce=B,t.lineEach=k,t.lineReduce=z,Object.defineProperty(t,"__esModule",{value:!0})}); /***/ }), -/* 266 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2330,16 +2330,16 @@ module.exports = invariant; /***/ }), -/* 267 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var constants = __webpack_require__(367); -var client = __webpack_require__(368); -var getUser = __webpack_require__(315); +var invariant = __webpack_require__(302); +var constants = __webpack_require__(403); +var client = __webpack_require__(404); +var getUser = __webpack_require__(351); /** * Services all have the same constructor pattern: you initialize them @@ -2393,9 +2393,9 @@ module.exports = makeService; /***/ }), -/* 268 */, -/* 269 */, -/* 270 */ +/* 304 */, +/* 305 */, +/* 306 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2410,10 +2410,10 @@ module.exports = makeService; var defaultClient, mixin, responsePromise, client; -defaultClient = __webpack_require__(307); -mixin = __webpack_require__(276); -responsePromise = __webpack_require__(283); -client = __webpack_require__(282); +defaultClient = __webpack_require__(343); +mixin = __webpack_require__(312); +responsePromise = __webpack_require__(319); +client = __webpack_require__(318); /** * Interceptors have the ability to intercept the request and/org response @@ -2547,16 +2547,16 @@ module.exports = interceptor; /***/ }), -/* 271 */, -/* 272 */ +/* 307 */, +/* 308 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var corslite = __webpack_require__(362), - strict = __webpack_require__(77).strict, - config = __webpack_require__(81); +var corslite = __webpack_require__(398), + strict = __webpack_require__(82).strict, + config = __webpack_require__(86); var protocol = /^(https?:)?(?=\/\/(.|api)\.tiles\.mapbox\.com\/)/; @@ -2587,7 +2587,7 @@ module.exports = function(url, callback) { /***/ }), -/* 273 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -3134,16 +3134,16 @@ module.exports = { /***/ }), -/* 274 */, -/* 275 */ +/* 310 */, +/* 311 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var request = __webpack_require__(272), - format_url = __webpack_require__(79), - util = __webpack_require__(77); +var request = __webpack_require__(308), + format_url = __webpack_require__(84), + util = __webpack_require__(82); module.exports = { _loadTileJSON: function(_) { @@ -3166,7 +3166,7 @@ module.exports = { /***/ }), -/* 276 */ +/* 312 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3210,10 +3210,10 @@ module.exports = mixin; /***/ }), -/* 277 */, -/* 278 */, -/* 279 */, -/* 280 */ +/* 313 */, +/* 314 */, +/* 315 */, +/* 316 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3232,7 +3232,7 @@ module.exports = new Feedback(); /***/ }), -/* 281 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3241,15 +3241,15 @@ module.exports = new Feedback(); // Installs ES6 Promise polyfill if a native Promise is not available if (typeof Promise === 'undefined') { - __webpack_require__(369).polyfill(); + __webpack_require__(405).polyfill(); } module.export = Promise; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module))) /***/ }), -/* 282 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3310,7 +3310,7 @@ module.exports = function client(impl, target) { /***/ }), -/* 283 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3325,7 +3325,7 @@ module.exports = function client(impl, target) { /*jshint latedef: nofunc */ -var normalizeHeaderName = __webpack_require__(308); +var normalizeHeaderName = __webpack_require__(344); function property(promise, name) { return promise.then( @@ -3451,7 +3451,7 @@ module.exports = responsePromise; /***/ }), -/* 284 */ +/* 320 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3466,7 +3466,7 @@ module.exports = responsePromise; var uriEncoder, operations, prefixRE; -uriEncoder = __webpack_require__(377); +uriEncoder = __webpack_require__(413); prefixRE = /^([^:]*):([0-9]+)$/; operations = { @@ -3618,13 +3618,13 @@ module.exports = { /***/ }), -/* 285 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariantLocation = __webpack_require__(286); +var invariantLocation = __webpack_require__(322); /** * Format waypionts in a way that's friendly to the directions and surface @@ -3647,13 +3647,13 @@ module.exports = formatPoints; /***/ }), -/* 286 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); +var invariant = __webpack_require__(302); /** * Given an object that should be a location, ensure that it has @@ -3677,7 +3677,7 @@ module.exports = invariantLocation; /***/ }), -/* 287 */ +/* 323 */ /***/ (function(module, exports) { /** @@ -3890,15 +3890,15 @@ module.exports = { /***/ }), -/* 288 */, -/* 289 */, -/* 290 */, -/* 291 */, -/* 292 */, -/* 293 */, -/* 294 */, -/* 295 */, -/* 296 */ +/* 324 */, +/* 325 */, +/* 326 */, +/* 327 */, +/* 328 */, +/* 329 */, +/* 330 */, +/* 331 */, +/* 332 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* @@ -13075,17 +13075,17 @@ L.Map.include({ }(window, document)); /***/ }), -/* 297 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isArray = __webpack_require__(361), - util = __webpack_require__(77), - format_url = __webpack_require__(79), - feedback = __webpack_require__(280), - request = __webpack_require__(272); +var isArray = __webpack_require__(397), + util = __webpack_require__(82), + format_url = __webpack_require__(84), + feedback = __webpack_require__(316), + request = __webpack_require__(308); // Low-level geocoding interface - wraps specific API calls and their // return values. @@ -13224,21 +13224,21 @@ module.exports = function(url, options) { /***/ }), -/* 298 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - Mustache = __webpack_require__(299); +var util = __webpack_require__(82), + Mustache = __webpack_require__(335); var GridControl = L.Control.extend({ options: { pinnable: true, follow: false, - sanitizer: __webpack_require__(78), + sanitizer: __webpack_require__(83), touchTeaser: true, location: true }, @@ -13429,7 +13429,7 @@ module.exports.gridControl = function(_, options) { /***/ }), -/* 299 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -14067,17 +14067,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/* 300 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - format_url = __webpack_require__(79), - request = __webpack_require__(272), - marker = __webpack_require__(80), - simplestyle = __webpack_require__(301); +var util = __webpack_require__(82), + format_url = __webpack_require__(84), + request = __webpack_require__(308), + marker = __webpack_require__(85), + simplestyle = __webpack_require__(337); // # featureLayer // @@ -14086,7 +14086,7 @@ var util = __webpack_require__(77), var FeatureLayer = L.FeatureGroup.extend({ options: { filter: function() { return true; }, - sanitizer: __webpack_require__(78), + sanitizer: __webpack_require__(83), style: simplestyle.style, popupOptions: { closeButton: false } }, @@ -14201,7 +14201,7 @@ module.exports.featureLayer = function(_, options) { /***/ }), -/* 301 */ +/* 337 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14253,7 +14253,7 @@ module.exports = { /***/ }), -/* 302 */ +/* 338 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14263,7 +14263,7 @@ var LegendControl = L.Control.extend({ options: { position: 'bottomright', - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(options) { @@ -14327,16 +14327,16 @@ module.exports.legendControl = function(options) { /***/ }), -/* 303 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var format_url = __webpack_require__(79); +var format_url = __webpack_require__(84); var ShareControl = L.Control.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { position: 'topleft', @@ -14455,20 +14455,20 @@ module.exports.shareControl = function(_, options) { /***/ }), -/* 304 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77); +var util = __webpack_require__(82); var formatPattern = /\.((?:png|jpg)\d*)(?=$|\?)/; var TileLayer = L.TileLayer.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, // http://mapbox.com/developers/api/#image_quality @@ -14560,7 +14560,7 @@ module.exports.tileLayer = function(_, options) { /***/ }), -/* 305 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14569,7 +14569,7 @@ module.exports.tileLayer = function(_, options) { var InfoControl = L.Control.extend({ options: { position: 'bottomright', - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(options) { @@ -14682,19 +14682,19 @@ module.exports.infoControl = function(options) { /***/ }), -/* 306 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77), - request = __webpack_require__(272), - grid = __webpack_require__(364); +var util = __webpack_require__(82), + request = __webpack_require__(308), + grid = __webpack_require__(400); // forked from danzel/L.UTFGrid var GridLayer = L.Class.extend({ - includes: [L.Mixin.Events, __webpack_require__(275)], + includes: [L.Mixin.Events, __webpack_require__(311)], options: { template: function() { return ''; } @@ -14912,7 +14912,7 @@ module.exports.gridLayer = function(_, options) { /***/ }), -/* 307 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14983,7 +14983,7 @@ module.exports.gridLayer = function(_, options) { var client, target, platformDefault; -client = __webpack_require__(282); +client = __webpack_require__(318); if (typeof Promise !== 'function' && console && console.log) { console.log('An ES6 Promise implementation is required to use rest.js. See https://github.com/cujojs/when/blob/master/docs/es6-promise-shim.md for using when.js as a Promise polyfill.'); @@ -15035,7 +15035,7 @@ module.exports = client(defaultClient); /***/ }), -/* 308 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15070,7 +15070,7 @@ module.exports = normalizeHeaderName; /***/ }), -/* 309 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15085,8 +15085,8 @@ module.exports = normalizeHeaderName; var interceptor, UrlBuilder; -interceptor = __webpack_require__(270); -UrlBuilder = __webpack_require__(373); +interceptor = __webpack_require__(306); +UrlBuilder = __webpack_require__(409); function startsWith(str, prefix) { return str.indexOf(prefix) === 0; @@ -15126,7 +15126,7 @@ module.exports = interceptor({ /***/ }), -/* 310 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15214,7 +15214,7 @@ module.exports = { /***/ }), -/* 311 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15262,7 +15262,7 @@ module.exports = { /***/ }), -/* 312 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15277,9 +15277,9 @@ module.exports = { var interceptor, uriTemplate, mixin; -interceptor = __webpack_require__(270); -uriTemplate = __webpack_require__(284); -mixin = __webpack_require__(276); +interceptor = __webpack_require__(306); +uriTemplate = __webpack_require__(320); +mixin = __webpack_require__(312); /** * Applies request params to the path as a URI Template @@ -15315,7 +15315,7 @@ module.exports = interceptor({ /***/ }), -/* 313 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15349,24 +15349,24 @@ module.exports = attempt; /***/ }), -/* 314 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.decode = exports.parse = __webpack_require__(389); -exports.encode = exports.stringify = __webpack_require__(390); +exports.decode = exports.parse = __webpack_require__(425); +exports.encode = exports.stringify = __webpack_require__(426); /***/ }), -/* 315 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var b64 = __webpack_require__(393); +var b64 = __webpack_require__(429); /** * Access tokens actually are data, and using them we can derive @@ -15399,7 +15399,7 @@ module.exports = getUser; /***/ }), -/* 316 */ +/* 352 */ /***/ (function(module, exports) { /* @@ -15446,13 +15446,13 @@ function extend() { /***/ }), -/* 317 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html -var getCoord = __webpack_require__(287).getCoord; -var helpers = __webpack_require__(273); +var getCoord = __webpack_require__(323).getCoord; +var helpers = __webpack_require__(309); var point = helpers.point; var distanceToRadians = helpers.distanceToRadians; @@ -15498,7 +15498,7 @@ module.exports = function (origin, distance, bearing, units) { /***/ }), -/* 318 */ +/* 354 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -16499,74 +16499,74 @@ function lineReduce(geojson, callback, initialValue) { /***/ }), -/* 319 */, -/* 320 */, -/* 321 */, -/* 322 */, -/* 323 */, -/* 324 */, -/* 325 */, -/* 326 */, -/* 327 */, -/* 328 */, -/* 329 */, -/* 330 */, -/* 331 */, -/* 332 */, -/* 333 */, -/* 334 */, -/* 335 */, -/* 336 */, -/* 337 */, -/* 338 */, -/* 339 */, -/* 340 */, -/* 341 */, -/* 342 */, -/* 343 */, -/* 344 */, -/* 345 */, -/* 346 */, -/* 347 */, -/* 348 */, -/* 349 */, -/* 350 */, -/* 351 */, -/* 352 */, -/* 353 */, -/* 354 */, /* 355 */, /* 356 */, /* 357 */, -/* 358 */ +/* 358 */, +/* 359 */, +/* 360 */, +/* 361 */, +/* 362 */, +/* 363 */, +/* 364 */, +/* 365 */, +/* 366 */, +/* 367 */, +/* 368 */, +/* 369 */, +/* 370 */, +/* 371 */, +/* 372 */, +/* 373 */, +/* 374 */, +/* 375 */, +/* 376 */, +/* 377 */, +/* 378 */, +/* 379 */, +/* 380 */, +/* 381 */, +/* 382 */, +/* 383 */, +/* 384 */, +/* 385 */, +/* 386 */, +/* 387 */, +/* 388 */, +/* 389 */, +/* 390 */, +/* 391 */, +/* 392 */, +/* 393 */, +/* 394 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = window.L = __webpack_require__(296); +module.exports = window.L = __webpack_require__(332); /***/ }), -/* 359 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var geocoderControl = __webpack_require__(360), - gridControl = __webpack_require__(298), - featureLayer = __webpack_require__(300), - legendControl = __webpack_require__(302), - shareControl = __webpack_require__(303), - tileLayer = __webpack_require__(304), - infoControl = __webpack_require__(305), - map = __webpack_require__(363), - gridLayer = __webpack_require__(306), - styleLayer = __webpack_require__(366); +var geocoderControl = __webpack_require__(396), + gridControl = __webpack_require__(334), + featureLayer = __webpack_require__(336), + legendControl = __webpack_require__(338), + shareControl = __webpack_require__(339), + tileLayer = __webpack_require__(340), + infoControl = __webpack_require__(341), + map = __webpack_require__(399), + gridLayer = __webpack_require__(342), + styleLayer = __webpack_require__(402); L.mapbox = module.exports = { - VERSION: __webpack_require__(82).version, - geocoder: __webpack_require__(297), - marker: __webpack_require__(80), - simplestyle: __webpack_require__(301), + VERSION: __webpack_require__(87).version, + geocoder: __webpack_require__(333), + marker: __webpack_require__(85), + simplestyle: __webpack_require__(337), tileLayer: tileLayer.tileLayer, TileLayer: tileLayer.TileLayer, styleLayer: styleLayer.styleLayer, @@ -16587,10 +16587,10 @@ L.mapbox = module.exports = { FeatureLayer: featureLayer.FeatureLayer, map: map.map, Map: map.Map, - config: __webpack_require__(81), - sanitize: __webpack_require__(78), - template: __webpack_require__(299).to_html, - feedback: __webpack_require__(280) + config: __webpack_require__(86), + sanitize: __webpack_require__(83), + template: __webpack_require__(335).to_html, + feedback: __webpack_require__(316) }; @@ -16602,18 +16602,18 @@ window.L.Icon.Default.imagePath = ((document.location.protocol === 'https:' || document.location.protocol === 'http:') ? '' : 'https:') + '//api.tiles.mapbox.com/mapbox.js/' + 'v' + - __webpack_require__(82).version + '/images'; + __webpack_require__(87).version + '/images'; /***/ }), -/* 360 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var geocoder = __webpack_require__(297), - util = __webpack_require__(77); +var geocoder = __webpack_require__(333), + util = __webpack_require__(82); var GeocoderControl = L.Control.extend({ includes: L.Mixin.Events, @@ -16817,7 +16817,7 @@ module.exports.geocoderControl = function(_, options) { /***/ }), -/* 361 */ +/* 397 */ /***/ (function(module, exports) { module.exports = Array.isArray || function (arr) { @@ -16826,7 +16826,7 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 362 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { function corslite(url, callback, cors) { @@ -16925,21 +16925,21 @@ if (true) module.exports = corslite; /***/ }), -/* 363 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var tileLayer = __webpack_require__(304).tileLayer, - featureLayer = __webpack_require__(300).featureLayer, - gridLayer = __webpack_require__(306).gridLayer, - gridControl = __webpack_require__(298).gridControl, - infoControl = __webpack_require__(305).infoControl, - shareControl = __webpack_require__(303).shareControl, - legendControl = __webpack_require__(302).legendControl, - mapboxLogoControl = __webpack_require__(365).mapboxLogoControl, - feedback = __webpack_require__(280); +var tileLayer = __webpack_require__(340).tileLayer, + featureLayer = __webpack_require__(336).featureLayer, + gridLayer = __webpack_require__(342).gridLayer, + gridControl = __webpack_require__(334).gridControl, + infoControl = __webpack_require__(341).infoControl, + shareControl = __webpack_require__(339).shareControl, + legendControl = __webpack_require__(338).legendControl, + mapboxLogoControl = __webpack_require__(401).mapboxLogoControl, + feedback = __webpack_require__(316); function withAccessToken(options, accessToken) { if (!accessToken || options.accessToken) @@ -16948,7 +16948,7 @@ function withAccessToken(options, accessToken) { } var LMap = L.Map.extend({ - includes: [__webpack_require__(275)], + includes: [__webpack_require__(311)], options: { tileLayer: {}, @@ -16958,7 +16958,7 @@ var LMap = L.Map.extend({ gridControl: {}, infoControl: false, shareControl: false, - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, _tilejson: {}, @@ -17166,7 +17166,7 @@ module.exports.map = function(element, _, options) { /***/ }), -/* 364 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17189,7 +17189,7 @@ module.exports = function(data) { /***/ }), -/* 365 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17228,20 +17228,20 @@ module.exports.mapboxLogoControl = function(options) { /***/ }), -/* 366 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(77); -var format_url = __webpack_require__(79); -var request = __webpack_require__(272); +var util = __webpack_require__(82); +var format_url = __webpack_require__(84); +var request = __webpack_require__(308); var StyleLayer = L.TileLayer.extend({ options: { - sanitizer: __webpack_require__(78) + sanitizer: __webpack_require__(83) }, initialize: function(_, options) { @@ -17316,7 +17316,7 @@ module.exports.styleLayer = function(_, options) { /***/ }), -/* 367 */ +/* 403 */ /***/ (function(module, exports) { @@ -17324,35 +17324,35 @@ module.exports.DEFAULT_ENDPOINT = 'https://api.mapbox.com'; /***/ }), -/* 368 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var rest = __webpack_require__(370); +var rest = __webpack_require__(406); // rest.js client with MIME support module.exports = function(config) { return rest - .wrap(__webpack_require__(372)) - .wrap(__webpack_require__(309), { prefix: config.endpoint }) - .wrap(__webpack_require__(374), { mime: 'application/json' }) - .wrap(__webpack_require__(312)) - .wrap(__webpack_require__(383), { + .wrap(__webpack_require__(408)) + .wrap(__webpack_require__(345), { prefix: config.endpoint }) + .wrap(__webpack_require__(410), { mime: 'application/json' }) + .wrap(__webpack_require__(348)) + .wrap(__webpack_require__(419), { params: { access_token: config.accessToken } }) - .wrap(__webpack_require__(384), { access_token: config.accessToken }) - .wrap(__webpack_require__(391)) - .wrap(__webpack_require__(392)); + .wrap(__webpack_require__(420), { access_token: config.accessToken }) + .wrap(__webpack_require__(427)) + .wrap(__webpack_require__(428)); }; /***/ }), -/* 369 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global) {/*! @@ -18535,10 +18535,10 @@ return Promise$1; //# sourceMappingURL=es6-promise.map -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(5))) /***/ }), -/* 370 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18551,8 +18551,8 @@ return Promise$1; -var rest = __webpack_require__(307), - browser = __webpack_require__(371); +var rest = __webpack_require__(343), + browser = __webpack_require__(407); rest.setPlatformDefaultClient(browser); @@ -18560,7 +18560,7 @@ module.exports = rest; /***/ }), -/* 371 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18575,9 +18575,9 @@ module.exports = rest; var normalizeHeaderName, responsePromise, client, headerSplitRE; -normalizeHeaderName = __webpack_require__(308); -responsePromise = __webpack_require__(283); -client = __webpack_require__(282); +normalizeHeaderName = __webpack_require__(344); +responsePromise = __webpack_require__(319); +client = __webpack_require__(318); // according to the spec, the line break is '\r\n', but doesn't hold true in practice headerSplitRE = /[\r|\n]+/; @@ -18734,7 +18734,7 @@ module.exports = client(function xhr(request) { /***/ }), -/* 372 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18749,7 +18749,7 @@ module.exports = client(function xhr(request) { var interceptor; -interceptor = __webpack_require__(270); +interceptor = __webpack_require__(306); /** * Rejects the response promise based on the status code. @@ -18777,7 +18777,7 @@ module.exports = interceptor({ /***/ }), -/* 373 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18792,8 +18792,8 @@ module.exports = interceptor({ var mixin, xWWWFormURLEncoder, origin, urlRE, absoluteUrlRE, fullyQualifiedUrlRE; -mixin = __webpack_require__(276); -xWWWFormURLEncoder = __webpack_require__(310); +mixin = __webpack_require__(312); +xWWWFormURLEncoder = __webpack_require__(346); urlRE = /([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?(\/[^?#]*)?(\?[^#]*)?(#\S*)?/i; absoluteUrlRE = /^([a-z][a-z0-9\-\+\.]*:\/\/|\/)/i; @@ -19000,7 +19000,7 @@ module.exports = UrlBuilder; /***/ }), -/* 374 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19015,10 +19015,10 @@ module.exports = UrlBuilder; var interceptor, mime, registry, noopConverter, missingConverter, attempt; -interceptor = __webpack_require__(270); -mime = __webpack_require__(311); -registry = __webpack_require__(375); -attempt = __webpack_require__(313); +interceptor = __webpack_require__(306); +mime = __webpack_require__(347); +registry = __webpack_require__(411); +attempt = __webpack_require__(349); noopConverter = { read: function (obj) { return obj; }, @@ -19116,7 +19116,7 @@ module.exports = interceptor({ /***/ }), -/* 375 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19131,7 +19131,7 @@ module.exports = interceptor({ var mime, registry; -mime = __webpack_require__(311); +mime = __webpack_require__(347); function Registry(mimes) { @@ -19215,11 +19215,11 @@ function Registry(mimes) { registry = new Registry({}); // include provided serializers -registry.register('application/hal', __webpack_require__(376)); -registry.register('application/json', __webpack_require__(380)); -registry.register('application/x-www-form-urlencoded', __webpack_require__(310)); -registry.register('multipart/form-data', __webpack_require__(381)); -registry.register('text/plain', __webpack_require__(382)); +registry.register('application/hal', __webpack_require__(412)); +registry.register('application/json', __webpack_require__(416)); +registry.register('application/x-www-form-urlencoded', __webpack_require__(346)); +registry.register('multipart/form-data', __webpack_require__(417)); +registry.register('text/plain', __webpack_require__(418)); registry.register('+json', registry.delegate('application/json')); @@ -19227,7 +19227,7 @@ module.exports = registry; /***/ }), -/* 376 */ +/* 412 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19242,11 +19242,11 @@ module.exports = registry; var pathPrefix, template, find, lazyPromise, responsePromise; -pathPrefix = __webpack_require__(309); -template = __webpack_require__(312); -find = __webpack_require__(378); -lazyPromise = __webpack_require__(379); -responsePromise = __webpack_require__(283); +pathPrefix = __webpack_require__(345); +template = __webpack_require__(348); +find = __webpack_require__(414); +lazyPromise = __webpack_require__(415); +responsePromise = __webpack_require__(319); function defineProperty(obj, name, value) { Object.defineProperty(obj, name, { @@ -19362,7 +19362,7 @@ module.exports = { /***/ }), -/* 377 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19539,7 +19539,7 @@ module.exports = { /***/ }), -/* 378 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19577,7 +19577,7 @@ module.exports = { /***/ }), -/* 379 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19590,7 +19590,7 @@ module.exports = { -var attempt = __webpack_require__(313); +var attempt = __webpack_require__(349); /** * Create a promise whose work is started only when a handler is registered. @@ -19630,7 +19630,7 @@ module.exports = lazyPromise; /***/ }), -/* 380 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19674,7 +19674,7 @@ module.exports = createConverter(); /***/ }), -/* 381 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19745,7 +19745,7 @@ module.exports = { /***/ }), -/* 382 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19772,7 +19772,7 @@ module.exports = { /***/ }), -/* 383 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -19787,8 +19787,8 @@ module.exports = { var interceptor, mixinUtil, defaulter; -interceptor = __webpack_require__(270); -mixinUtil = __webpack_require__(276); +interceptor = __webpack_require__(306); +mixinUtil = __webpack_require__(312); defaulter = (function () { @@ -19848,19 +19848,19 @@ module.exports = interceptor({ /***/ }), -/* 384 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var interceptor = __webpack_require__(270); -var linkParser = __webpack_require__(385); -var url = __webpack_require__(386); -var querystring = __webpack_require__(314); +var interceptor = __webpack_require__(306); +var linkParser = __webpack_require__(421); +var url = __webpack_require__(422); +var querystring = __webpack_require__(350); var paginator = interceptor({ success: function (response, config) { @@ -19894,7 +19894,7 @@ module.exports = paginator; /***/ }), -/* 385 */ +/* 421 */ /***/ (function(module, exports) { module.exports = (function(){ @@ -21087,7 +21087,7 @@ module.exports = (function(){ /***/ }), -/* 386 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -21114,8 +21114,8 @@ module.exports = (function(){ -var punycode = __webpack_require__(387); -var util = __webpack_require__(388); +var punycode = __webpack_require__(423); +var util = __webpack_require__(424); exports.parse = urlParse; exports.resolve = urlResolve; @@ -21190,7 +21190,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i, 'gopher:': true, 'file:': true }, - querystring = __webpack_require__(314); + querystring = __webpack_require__(350); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; @@ -21826,7 +21826,7 @@ Url.prototype.parseHost = function() { /***/ }), -/* 387 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ @@ -22362,10 +22362,10 @@ Url.prototype.parseHost = function() { }(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5))) /***/ }), -/* 388 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22388,7 +22388,7 @@ module.exports = { /***/ }), -/* 389 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22479,7 +22479,7 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 390 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22571,10 +22571,10 @@ var objectKeys = Object.keys || function (obj) { /***/ }), -/* 391 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { -var interceptor = __webpack_require__(270); +var interceptor = __webpack_require__(306); var standardResponse = interceptor({ response: transform, @@ -22596,16 +22596,16 @@ module.exports = standardResponse; /***/ }), -/* 392 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // install ES6 Promise polyfill -__webpack_require__(281); +__webpack_require__(317); -var interceptor = __webpack_require__(270); +var interceptor = __webpack_require__(306); var callbackify = interceptor({ success: function (response) { @@ -22634,7 +22634,7 @@ module.exports = callbackify; /***/ }), -/* 393 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22787,14 +22787,14 @@ module.exports = { /***/ }), -/* 394 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxGeocoding @@ -23065,15 +23065,15 @@ module.exports = MapboxGeocoding; /***/ }), -/* 395 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxSurface @@ -23170,15 +23170,15 @@ module.exports = MapboxSurface; /***/ }), -/* 396 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxDirections @@ -23354,14 +23354,14 @@ module.exports = MapboxDirections; /***/ }), -/* 397 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxUploads @@ -23581,14 +23581,14 @@ MapboxUploads.prototype.deleteUpload = function(upload, callback) { /***/ }), -/* 398 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxMatching @@ -23723,15 +23723,15 @@ module.exports = MapboxMatching; /***/ }), -/* 399 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var hat = __webpack_require__(400); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var hat = __webpack_require__(436); +var makeService = __webpack_require__(303); /** * @class MapboxDatasets @@ -24168,7 +24168,7 @@ MapboxDatasets.prototype.deleteFeature = function(id, dataset, callback) { /***/ }), -/* 400 */ +/* 436 */ /***/ (function(module, exports) { /* eslint-disable */ @@ -24211,15 +24211,15 @@ var hat = module.exports = function (bits, base) { /***/ }), -/* 401 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var formatPoints = __webpack_require__(285); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var formatPoints = __webpack_require__(321); +var makeService = __webpack_require__(303); /** * @class MapboxMatrix @@ -24337,14 +24337,14 @@ module.exports = MapboxMatrix; /***/ }), -/* 402 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTilestats @@ -24440,15 +24440,15 @@ MapboxTilestats.prototype.putTilestats = function(tileset, statistics, callback) /***/ }), -/* 403 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Buffer) { -var invariant = __webpack_require__(266); -var uriTemplate = __webpack_require__(284); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var uriTemplate = __webpack_require__(320); +var makeService = __webpack_require__(303); /** * @class MapboxStyles @@ -24818,10 +24818,10 @@ MapboxStyles.prototype.embedStyle = function(styleid, options) { return this.endpoint + uriTemplate.expand(API_STYLES_EMBED, params); }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(404).Buffer)) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(440).Buffer)) /***/ }), -/* 404 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24835,9 +24835,9 @@ MapboxStyles.prototype.embedStyle = function(styleid, options) { -var base64 = __webpack_require__(405) -var ieee754 = __webpack_require__(406) -var isArray = __webpack_require__(407) +var base64 = __webpack_require__(441) +var ieee754 = __webpack_require__(442) +var isArray = __webpack_require__(443) exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer @@ -26615,10 +26615,10 @@ function isnan (val) { return val !== val // eslint-disable-line no-self-compare } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/* 405 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26776,7 +26776,7 @@ function fromByteArray (uint8) { /***/ }), -/* 406 */ +/* 442 */ /***/ (function(module, exports) { exports.read = function (buffer, offset, isLE, mLen, nBytes) { @@ -26866,7 +26866,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { /***/ }), -/* 407 */ +/* 443 */ /***/ (function(module, exports) { var toString = {}.toString; @@ -26877,18 +26877,18 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 408 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var xtend = __webpack_require__(316).extend; -var uriTemplate = __webpack_require__(284); -var encodeOverlay = __webpack_require__(409); -var invariantLocation = __webpack_require__(286); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var xtend = __webpack_require__(352).extend; +var uriTemplate = __webpack_require__(320); +var encodeOverlay = __webpack_require__(445); +var invariantLocation = __webpack_require__(322); +var makeService = __webpack_require__(303); /** * @class MapboxStatic @@ -27096,15 +27096,15 @@ module.exports = MapboxStatic; /***/ }), -/* 409 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266), - invariantLocation = __webpack_require__(286), - polyline = __webpack_require__(410); +var invariant = __webpack_require__(302), + invariantLocation = __webpack_require__(322), + polyline = __webpack_require__(446); /** * Given a list of markers, encode them for display @@ -27162,7 +27162,7 @@ module.exports.encodeGeoJSON = encodeGeoJSON; /***/ }), -/* 410 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27254,14 +27254,14 @@ module.exports = polyline; /***/ }), -/* 411 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTilesets @@ -27345,14 +27345,14 @@ MapboxTilesets.prototype.listTilesets = function(options, callback) { /***/ }), -/* 412 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var invariant = __webpack_require__(266); -var makeService = __webpack_require__(267); +var invariant = __webpack_require__(302); +var makeService = __webpack_require__(303); /** * @class MapboxTokens @@ -27566,13 +27566,13 @@ MapboxTokens.prototype.listScopes = function(callback) { /***/ }), -/* 413 */ +/* 449 */ /***/ (function(module, exports) { module.exports = {"_args":[["mapbox-gl-circle@1.6.5","/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client"]],"_from":"mapbox-gl-circle@1.6.5","_id":"mapbox-gl-circle@1.6.5","_inBundle":false,"_integrity":"sha512-VHA6lgxZE/WFtBXmMveU2zt7ZeVcBHe42k4U4b8xGEnrDSQs4/++EBPVywEMNqi01XQrbf1eiAhsIDZasR4drw==","_location":"/mapbox-gl-circle","_phantomChildren":{"@mapbox/geojson-area":"0.2.2","@mapbox/gl-matrix":"0.0.1","@mapbox/mapbox-gl-supported":"1.4.0","@mapbox/point-geometry":"0.1.0","@mapbox/shelf-pack":"3.2.0","@mapbox/tiny-sdf":"1.1.0","@mapbox/unitbezier":"0.0.0","@mapbox/vector-tile":"1.3.1","@mapbox/whoots-js":"3.1.0","brfs":"1.6.1","bubleify":"0.7.0","concat-stream":"1.6.2","csscolorparser":"1.0.3","earcut":"2.1.3","geojson-vt":"3.2.1","gray-matter":"3.1.1","grid-index":"1.1.0","jsonlint-lines-primitives":"1.6.0","minimist":"0.0.8","package-json-versionify":"1.0.4","pbf":"3.2.0","quickselect":"1.1.1","rw":"1.3.3","sharkdown":"0.1.1","shuffle-seed":"1.1.6","sort-object":"0.3.2","through2":"2.0.3","tinyqueue":"1.2.3","unassertify":"2.1.1","unflowify":"1.0.1","vt-pbf":"3.1.1","webworkify":"1.5.0"},"_requested":{"type":"version","registry":true,"raw":"mapbox-gl-circle@1.6.5","name":"mapbox-gl-circle","escapedName":"mapbox-gl-circle","rawSpec":"1.6.5","saveSpec":null,"fetchSpec":"1.6.5"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/mapbox-gl-circle/-/mapbox-gl-circle-1.6.5.tgz","_spec":"1.6.5","_where":"/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client","author":{"name":"Smith Micro Software, Inc."},"browserify":{"transform":["babelify"]},"bugs":{"url":"https://github.com/smithmicro/mapbox-gl-circle/issues"},"dependencies":{"@turf/bbox":"^4.7.3","@turf/bbox-polygon":"^4.7.3","@turf/bearing":"^4.5.2","@turf/circle":"^4.7.3","@turf/destination":"^4.7.3","@turf/distance":"^4.7.3","@turf/helpers":"^4.7.3","@turf/truncate":"^4.7.3","core-util-is":"^1.0.2","debug":"^3.0.0","events":"^1.1.1","fsevents":"^1.1.2","glob":"^7.1.2","inflight":"^1.0.6","inherits":"^2.0.3","jsonparse":"^1.3.1","lodash":"^4.17.5","lodash.debounce":"^4.0.8","mapbox-gl":"^0.44.1","minimatch":"^3.0.4","once":"^1.4.0","punycode":"^2.1.0","readable-stream":"^2.3.3","string_decoder":"^1.0.3","through2":"^2.0.3","util-deprecate":"^1.0.2","wrappy":"^1.0.2","xtend":"^4.0.1","yarn":"^0.27.5"},"description":"A google.maps.Circle replacement for Mapbox GL JS API","devDependencies":{"async-each":"^1.0.1","babel-preset-es2015":"^6.24.1","babelify":"^7.3.0","brfs":"^1.4.4","browserify":"^14.5.0","buble":"^0.15.2","budo":"^10.0.4","documentation":"^5.1.0","eslint":"^4.18.1","eslint-config-google":"^0.9.1","esutils":"^2.0.2","magic-string":"^0.22.4","uglify-js":"^3.3.12","vlq":"^0.2.3","watchify":"^3.10.0"},"directories":{"example":"example","lib":"lib"},"engines":{"node":">=7.6.0","npm":">=5.3.0"},"files":["lib/","example/","dist/"],"homepage":"https://github.com/smithmicro/mapbox-gl-circle#readme","keywords":["mapbox","circle","osm","gl"],"license":"ISC","main":"lib/main.js","name":"mapbox-gl-circle","optionalDependencies":{"core-util-is":"^1.0.2","debug":"^3.0.0","fsevents":"^1.1.2","glob":"^7.1.2","inflight":"^1.0.6","inherits":"^2.0.3","jsonparse":"^1.3.1","minimatch":"^3.0.4","once":"^1.4.0","punycode":"^2.1.0","readable-stream":"^2.3.3","string_decoder":"^1.0.3","through2":"^2.0.3","util-deprecate":"^1.0.2","wrappy":"^1.0.2","xtend":"^4.0.1","yarn":"^0.27.5"},"repository":{"type":"git","url":"git+ssh://git@github.com/smithmicro/mapbox-gl-circle.git"},"scripts":{"browserify":"mkdir -p dist && browserify lib/main.js -o dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.js --debug --delay=0 -v","docs":"documentation lint lib/main.js && documentation readme lib/main.js --access public --section=Usage","lint":"eslint lib","prepare":"mkdir -p dist && browserify --standalone MapboxCircle -t [ babelify --presets [ es2015 ] ] lib/main.js | uglifyjs -c -m > dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.min.js && cp -f dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.min.js dist/mapbox-gl-circle.min.js","start":"budo example/index.js --live --force-default-index --title budo/mapbox-gl-circle --verbose -- -t brfs","watchify":"mkdir -p dist && watchify lib/main.js -o dist/mapbox-gl-circle-${BUILD_VERSION:-dev}.js --debug -v"},"version":"1.6.5"} /***/ }), -/* 414 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -44689,322 +44689,14 @@ module.exports = {"_args":[["mapbox-gl-circle@1.6.5","/home/esokia-6/work/work41 } }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/* 415 */ -/***/ (function(module, exports) { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; -}; - -EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - - -/***/ }), -/* 416 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { -var destination = __webpack_require__(317); -var polygon = __webpack_require__(273).polygon; +var destination = __webpack_require__(353); +var polygon = __webpack_require__(309).polygon; /** * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision. @@ -45048,10 +44740,10 @@ module.exports = function (center, radius, steps, units, properties) { /***/ }), -/* 417 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { -var coordEach = __webpack_require__(318).coordEach; +var coordEach = __webpack_require__(354).coordEach; /** * Takes a set of features, calculates the bbox of all input features, and returns a bounding box. @@ -45080,10 +44772,10 @@ module.exports = function (geojson) { /***/ }), -/* 418 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { -var polygon = __webpack_require__(273).polygon; +var polygon = __webpack_require__(309).polygon; /** * Takes a bbox and returns an equivalent {@link Polygon|polygon}. @@ -45116,10 +44808,10 @@ module.exports = function (bbox) { /***/ }), -/* 419 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { -var coordEach = __webpack_require__(318).coordEach; +var coordEach = __webpack_require__(354).coordEach; /** * Takes a GeoJSON Feature or FeatureCollection and truncates the precision of the geometry. @@ -45186,11 +44878,11 @@ function truncate(coords, factor, coordinates) { /***/ }), -/* 420 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { -var getCoord = __webpack_require__(287).getCoord; -var radiansToDistance = __webpack_require__(273).radiansToDistance; +var getCoord = __webpack_require__(323).getCoord; +var radiansToDistance = __webpack_require__(309).radiansToDistance; //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html @@ -45233,10 +44925,10 @@ module.exports = function (from, to, units) { /***/ }), -/* 421 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { -var getCoord = __webpack_require__(287).getCoord; +var getCoord = __webpack_require__(323).getCoord; //http://en.wikipedia.org/wiki/Haversine_formula //http://www.movable-type.co.uk/scripts/latlong.html diff --git a/Phraseanet-production-client/dist/lightbox-mobile.js b/Phraseanet-production-client/dist/lightbox-mobile.js index fcc7d0d2e4..3a6871da87 100644 --- a/Phraseanet-production-client/dist/lightbox-mobile.js +++ b/Phraseanet-production-client/dist/lightbox-mobile.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 221); +/******/ return __webpack_require__(__webpack_require__.s = 257); /******/ }) /************************************************************************/ /******/ ({ @@ -83,31 +83,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -4634,7 +4726,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -4986,421 +5078,6 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; -/***/ }), - -/***/ 221: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function($) { - -var _bootstrap = __webpack_require__(222); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var lightboxMobileApplication = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.lightboxMobileApplication = lightboxMobileApplication; -} - -/*resize of PDF */ -$(window).on("load resize ", function (e) { - if ($('.pdf-iframe').length > 0) { - var pdfHeight = $('.pdf-iframe').width() / 0.707; - $('.pdf-iframe').css('height', pdfHeight); - } -}); -/*resize of VIDEO */ -$(window).on("load resize ", function (e) { - if ($('.video-iframe').length > 0) { - - var $sel = $('.center-image'); - var $window = $(window).height(); - - // V is for "video" ; K is for "container" ; N is for "new" - var VH = $('[name=videoHeight]').val(); - var VW = $('[name=videoWidth]').val(); - var KW = $sel.width(); - var KH = $sel.height(); - - if ($window <= 375) { - KH = 150; - } else { - if ($window > 375 && $window <= 480) { - KH = 200; - } - if ($window > 480 && $window <= 640) { - KH = 300; - } - - if ($window > 640 && $window <= 767) { - KH = 400; - } - if ($window > 767) { - KH = 550; - } - } - - var NW, NH; - if ((NH = VH / VW * (NW = KW)) > KH) { - // try to fit exact horizontally, adjust vertically - // too bad... new height overflows container height - NW = VW / VH * (NH = KH); // so fit exact vertically, adjust horizontally - } - $(".video-iframe", $sel).css('width', NW).css('height', NH); - } -}); - -module.exports = lightboxMobileApplication; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), - -/***/ 222: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -// import lightbox from './../components/lightbox/index'; -// import mainMenu from './../components/mainMenu'; - - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _config = __webpack_require__(223); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -__webpack_require__(14); -__webpack_require__(19); - -var Bootstrap = function () { - function Bootstrap(userConfig) { - var _this = this; - - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.validatorLoaded = false; - this.localeService = new _locale2.default({ - configService: this.configService - }); - - this.localeService.fetchTranslations().then(function () { - _this.onConfigReady(); - }); - - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this2 = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - window.bodySize = { - x: 0, - y: 0 - }; - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - // let $body = $('body'); - // window.bodySize.y = $body.height(); - // window.bodySize.x = $body.width(); - // - // this.appLightbox = lightbox(this.appServices); - // this.appLightbox.initialize({$container: $body}); - //mainMenu(this.appServices).initialize({$container: $body}); - _this2.mobileValidator(); - // this.isReleasable = this.configService.get('releasable'); - // - // if (this.isReleasable !== null) { - // this.appLightbox.setReleasable(this.isReleasable); - // } - }); - } - }, { - key: 'mobileValidator', - value: function mobileValidator() { - var _this4 = this; - - display_basket(); - - /*Get status before send validation*/ - function _getReseaseStatus(el) { - _jquery2.default.ajax({ - url: '/lightbox/ajax/GET_ELEMENTS/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', - dataType: 'json', - error: function error(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - timeout: function timeout(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - success: function success(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - if (data.datas) { - if (data.datas) { - if (data.datas.counts.nul == 0) { - _setRelease((0, _jquery2.default)(this)); - } else { - console.log(data.datas.counts); - (0, _jquery2.default)("#FeedbackRelease .record_accepted").html(data.datas.counts.yes); - (0, _jquery2.default)("#FeedbackRelease .record_refused").html(data.datas.counts.no); - (0, _jquery2.default)("#FeedbackRelease .record_null").html(data.datas.counts.nul); - (0, _jquery2.default)("#FeedbackRelease").modal("show"); - } - } - } - - return; - } - }); - } - - /*Send validation*/ - function _setRelease(el) { - var _this3 = this; - - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_RELEASE/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', - dataType: 'json', - error: function error(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - timeout: function timeout(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - success: function success(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - if (data.datas) { - // alert(data.datas); - window.location.href = "/lightbox"; - } - if (!data.error) { - _this3.isReleasable = false; - //this.appLightbox.setReleasable(this.isReleasable); - } - - return; - } - }); - }; - - (0, _jquery2.default)('body').on('touchstart click', '.confirm_report', function (event) { - event.preventDefault(); - var $el = (0, _jquery2.default)(event.currentTarget); - _getReseaseStatus($el); - - return false; - }); - (0, _jquery2.default)('body').on('touchstart click', '#validate-release', function (event) { - event.preventDefault(); - (0, _jquery2.default)("#FeedbackRelease").modal("hide"); - _setRelease((0, _jquery2.default)(_this4)); - console.log('validation is done'); - - return false; - }); - - (0, _jquery2.default)('body').on('touchstart click', '.agreement_radio', function (event) { - event.preventDefault(); - //$('.agreement_radio').on('mousedown', (event) => { - var $el = (0, _jquery2.default)(event.currentTarget); - var sselcont_id = $el.attr('for').split('_').pop(); - var agreement = (0, _jquery2.default)('#' + $el.attr('for')).val() === 'yes' ? '1' : '-1'; - - _jquery2.default.mobile.loading(); - - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_ELEMENT_AGREEMENT/' + sselcont_id + '/', - dataType: 'json', - data: { - agreement: agreement - }, - error: function error(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - timeout: function timeout(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - success: function success(datas) { - if (!datas.error) { - if (agreement === 1) { - (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('disagree').addClass('agree'); - } else { - (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('agree').addClass('disagree'); - } - _jquery2.default.mobile.loading(); - if (datas.error) { - alert(datas.datas); - return; - } - _this4.isReleasable = datas.release; - //this.appLightbox.setReleasable(this.isReleasable); - window.location.reload(); - } else { - console.log(datas.datas); - } - return; - } - }); - //return false; - }); - - (0, _jquery2.default)('body').on('touchstart click', '.note_area_validate', function (event) { - - var $el = (0, _jquery2.default)(event.currentTarget); - var sselcont_id = $el.closest('form').find('input[name="sselcont_id"]').val(); - - _jquery2.default.mobile.loading(); - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_NOTE/' + sselcont_id + '/', - dataType: 'json', - data: { - note: (0, _jquery2.default)('#note_form_' + sselcont_id).find('textarea').val() - }, - error: function error(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - timeout: function timeout(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - success: function success(datas) { - _jquery2.default.mobile.loading(); - if (datas.error) { - console.log(datas.datas); - return; - } - - (0, _jquery2.default)('#notes_' + sselcont_id).empty().append(datas.datas); - window.location.reload(); - return; - } - }); - return false; - }); - - function display_basket() { - var sc_wrapper = (0, _jquery2.default)('#sc_wrapper'); - - (0, _jquery2.default)('.basket_element', sc_wrapper).parent().bind('click', function (event) { - scid_click(event, this); - adjust_visibility(this); - return false; - }); - - (0, _jquery2.default)('.agree_button, .disagree_button', sc_wrapper).bind('click', function (event) { - - var sselcont_id = (0, _jquery2.default)(this).closest('.basket_element').attr('id').split('_').pop(); - - var agreement = (0, _jquery2.default)(this).hasClass('agree_button') ? '1' : '-1'; - - set_agreement(event, (0, _jquery2.default)(this), sselcont_id, agreement); - return false; - }).addClass('clickable'); - - var n = (0, _jquery2.default)('.basket_element', sc_wrapper).length; - (0, _jquery2.default)('#sc_container').width(n * (0, _jquery2.default)('.basket_element_wrapper:first', sc_wrapper).outerWidth() + 1); - } - - this.validatorLoaded = true; - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 223: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/prod/language/' -}; - -exports.default = defaultConfig; - /***/ }), /***/ 24: @@ -5408,7 +5085,7 @@ exports.default = defaultConfig; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -5831,8 +5508,8 @@ var I18n = function (_EventEmitter) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -5979,15 +5656,430 @@ var ResourceStore = function (_EventEmitter) { /***/ }), +/***/ 257: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +var _bootstrap = __webpack_require__(258); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var lightboxMobileApplication = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.lightboxMobileApplication = lightboxMobileApplication; +} + +/*resize of PDF */ +$(window).on("load resize ", function (e) { + if ($('.pdf-iframe').length > 0) { + var pdfHeight = $('.pdf-iframe').width() / 0.707; + $('.pdf-iframe').css('height', pdfHeight); + } +}); +/*resize of VIDEO */ +$(window).on("load resize ", function (e) { + if ($('.video-iframe').length > 0) { + + var $sel = $('.center-image'); + var $window = $(window).height(); + + // V is for "video" ; K is for "container" ; N is for "new" + var VH = $('[name=videoHeight]').val(); + var VW = $('[name=videoWidth]').val(); + var KW = $sel.width(); + var KH = $sel.height(); + + if ($window <= 375) { + KH = 150; + } else { + if ($window > 375 && $window <= 480) { + KH = 200; + } + if ($window > 480 && $window <= 640) { + KH = 300; + } + + if ($window > 640 && $window <= 767) { + KH = 400; + } + if ($window > 767) { + KH = 550; + } + } + + var NW, NH; + if ((NH = VH / VW * (NW = KW)) > KH) { + // try to fit exact horizontally, adjust vertically + // too bad... new height overflows container height + NW = VW / VH * (NH = KH); // so fit exact vertically, adjust horizontally + } + $(".video-iframe", $sel).css('width', NW).css('height', NH); + } +}); + +module.exports = lightboxMobileApplication; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), + +/***/ 258: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +// import lightbox from './../components/lightbox/index'; +// import mainMenu from './../components/mainMenu'; + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _config = __webpack_require__(259); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +__webpack_require__(14); +__webpack_require__(19); + +var Bootstrap = function () { + function Bootstrap(userConfig) { + var _this = this; + + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.validatorLoaded = false; + this.localeService = new _locale2.default({ + configService: this.configService + }); + + this.localeService.fetchTranslations().then(function () { + _this.onConfigReady(); + }); + + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this2 = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + window.bodySize = { + x: 0, + y: 0 + }; + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + // let $body = $('body'); + // window.bodySize.y = $body.height(); + // window.bodySize.x = $body.width(); + // + // this.appLightbox = lightbox(this.appServices); + // this.appLightbox.initialize({$container: $body}); + //mainMenu(this.appServices).initialize({$container: $body}); + _this2.mobileValidator(); + // this.isReleasable = this.configService.get('releasable'); + // + // if (this.isReleasable !== null) { + // this.appLightbox.setReleasable(this.isReleasable); + // } + }); + } + }, { + key: 'mobileValidator', + value: function mobileValidator() { + var _this4 = this; + + display_basket(); + + /*Get status before send validation*/ + function _getReseaseStatus(el) { + _jquery2.default.ajax({ + url: '/lightbox/ajax/GET_ELEMENTS/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', + dataType: 'json', + error: function error(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + timeout: function timeout(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + success: function success(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + if (data.datas) { + if (data.datas) { + if (data.datas.counts.nul == 0) { + _setRelease((0, _jquery2.default)(this)); + } else { + console.log(data.datas.counts); + (0, _jquery2.default)("#FeedbackRelease .record_accepted").html(data.datas.counts.yes); + (0, _jquery2.default)("#FeedbackRelease .record_refused").html(data.datas.counts.no); + (0, _jquery2.default)("#FeedbackRelease .record_null").html(data.datas.counts.nul); + (0, _jquery2.default)("#FeedbackRelease").modal("show"); + } + } + } + + return; + } + }); + } + + /*Send validation*/ + function _setRelease(el) { + var _this3 = this; + + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_RELEASE/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', + dataType: 'json', + error: function error(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + timeout: function timeout(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + success: function success(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + if (data.datas) { + // alert(data.datas); + window.location.href = "/lightbox"; + } + if (!data.error) { + _this3.isReleasable = false; + //this.appLightbox.setReleasable(this.isReleasable); + } + + return; + } + }); + }; + + (0, _jquery2.default)('body').on('touchstart click', '.confirm_report', function (event) { + event.preventDefault(); + var $el = (0, _jquery2.default)(event.currentTarget); + _getReseaseStatus($el); + + return false; + }); + (0, _jquery2.default)('body').on('touchstart click', '#validate-release', function (event) { + event.preventDefault(); + (0, _jquery2.default)("#FeedbackRelease").modal("hide"); + _setRelease((0, _jquery2.default)(_this4)); + console.log('validation is done'); + + return false; + }); + + (0, _jquery2.default)('body').on('touchstart click', '.agreement_radio', function (event) { + event.preventDefault(); + //$('.agreement_radio').on('mousedown', (event) => { + var $el = (0, _jquery2.default)(event.currentTarget); + var sselcont_id = $el.attr('for').split('_').pop(); + var agreement = (0, _jquery2.default)('#' + $el.attr('for')).val() === 'yes' ? '1' : '-1'; + + _jquery2.default.mobile.loading(); + + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_ELEMENT_AGREEMENT/' + sselcont_id + '/', + dataType: 'json', + data: { + agreement: agreement + }, + error: function error(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + timeout: function timeout(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + success: function success(datas) { + if (!datas.error) { + if (agreement === 1) { + (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('disagree').addClass('agree'); + } else { + (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('agree').addClass('disagree'); + } + _jquery2.default.mobile.loading(); + if (datas.error) { + alert(datas.datas); + return; + } + _this4.isReleasable = datas.release; + //this.appLightbox.setReleasable(this.isReleasable); + window.location.reload(); + } else { + console.log(datas.datas); + } + return; + } + }); + //return false; + }); + + (0, _jquery2.default)('body').on('touchstart click', '.note_area_validate', function (event) { + + var $el = (0, _jquery2.default)(event.currentTarget); + var sselcont_id = $el.closest('form').find('input[name="sselcont_id"]').val(); + + _jquery2.default.mobile.loading(); + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_NOTE/' + sselcont_id + '/', + dataType: 'json', + data: { + note: (0, _jquery2.default)('#note_form_' + sselcont_id).find('textarea').val() + }, + error: function error(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + timeout: function timeout(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + success: function success(datas) { + _jquery2.default.mobile.loading(); + if (datas.error) { + console.log(datas.datas); + return; + } + + (0, _jquery2.default)('#notes_' + sselcont_id).empty().append(datas.datas); + window.location.reload(); + return; + } + }); + return false; + }); + + function display_basket() { + var sc_wrapper = (0, _jquery2.default)('#sc_wrapper'); + + (0, _jquery2.default)('.basket_element', sc_wrapper).parent().bind('click', function (event) { + scid_click(event, this); + adjust_visibility(this); + return false; + }); + + (0, _jquery2.default)('.agree_button, .disagree_button', sc_wrapper).bind('click', function (event) { + + var sselcont_id = (0, _jquery2.default)(this).closest('.basket_element').attr('id').split('_').pop(); + + var agreement = (0, _jquery2.default)(this).hasClass('agree_button') ? '1' : '-1'; + + set_agreement(event, (0, _jquery2.default)(this), sselcont_id, agreement); + return false; + }).addClass('clickable'); + + var n = (0, _jquery2.default)('.basket_element', sc_wrapper).length; + (0, _jquery2.default)('#sc_container').width(n * (0, _jquery2.default)('.basket_element_wrapper:first', sc_wrapper).outerWidth() + 1); + } + + this.validatorLoaded = true; + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 259: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/prod/language/' +}; + +exports.default = defaultConfig; + +/***/ }), + /***/ 26: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -6590,7 +6682,7 @@ var PluralResolver = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -6867,9 +6959,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -7162,7 +7254,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -9567,11 +9659,39 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /***/ 5: +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ 6: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9639,34 +9759,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), - -/***/ 6: -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /***/ 7: @@ -22062,128 +22154,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/lightbox-mobile.min.js b/Phraseanet-production-client/dist/lightbox-mobile.min.js index fcc7d0d2e4..3a6871da87 100644 --- a/Phraseanet-production-client/dist/lightbox-mobile.min.js +++ b/Phraseanet-production-client/dist/lightbox-mobile.min.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 221); +/******/ return __webpack_require__(__webpack_require__.s = 257); /******/ }) /************************************************************************/ /******/ ({ @@ -83,31 +83,123 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /***/ 10: -/***/ (function(module, exports) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; +/* harmony export (immutable) */ __webpack_exports__["a"] = copy; +/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; +/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; +/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; +/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; +/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; +/* harmony export (immutable) */ __webpack_exports__["c"] = escape; +function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; +} +function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); +} + +function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; + } + + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + + var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()) + }; +} + +function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + + obj[k] = newValue; +} + +function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); +} + +function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + + if (!obj) return undefined; + return obj[k]; +} + +function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; +} + +function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} + +/* eslint-disable */ +var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': '"', + "'": ''', + "/": '/' +}; +/* eslint-enable */ + +function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + + return data; +} /***/ }), @@ -4634,7 +4726,7 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), @@ -4986,421 +5078,6 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; -/***/ }), - -/***/ 221: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function($) { - -var _bootstrap = __webpack_require__(222); - -var _bootstrap2 = _interopRequireDefault(_bootstrap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var lightboxMobileApplication = { - bootstrap: _bootstrap2.default -}; - -if (typeof window !== 'undefined') { - window.lightboxMobileApplication = lightboxMobileApplication; -} - -/*resize of PDF */ -$(window).on("load resize ", function (e) { - if ($('.pdf-iframe').length > 0) { - var pdfHeight = $('.pdf-iframe').width() / 0.707; - $('.pdf-iframe').css('height', pdfHeight); - } -}); -/*resize of VIDEO */ -$(window).on("load resize ", function (e) { - if ($('.video-iframe').length > 0) { - - var $sel = $('.center-image'); - var $window = $(window).height(); - - // V is for "video" ; K is for "container" ; N is for "new" - var VH = $('[name=videoHeight]').val(); - var VW = $('[name=videoWidth]').val(); - var KW = $sel.width(); - var KH = $sel.height(); - - if ($window <= 375) { - KH = 150; - } else { - if ($window > 375 && $window <= 480) { - KH = 200; - } - if ($window > 480 && $window <= 640) { - KH = 300; - } - - if ($window > 640 && $window <= 767) { - KH = 400; - } - if ($window > 767) { - KH = 550; - } - } - - var NW, NH; - if ((NH = VH / VW * (NW = KW)) > KH) { - // try to fit exact horizontally, adjust vertically - // too bad... new height overflows container height - NW = VW / VH * (NH = KH); // so fit exact vertically, adjust horizontally - } - $(".video-iframe", $sel).css('width', NW).css('height', NH); - } -}); - -module.exports = lightboxMobileApplication; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), - -/***/ 222: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -// import lightbox from './../components/lightbox/index'; -// import mainMenu from './../components/mainMenu'; - - -var _jquery = __webpack_require__(0); - -var _jquery2 = _interopRequireDefault(_jquery); - -var _configService = __webpack_require__(16); - -var _configService2 = _interopRequireDefault(_configService); - -var _locale = __webpack_require__(20); - -var _locale2 = _interopRequireDefault(_locale); - -var _config = __webpack_require__(223); - -var _config2 = _interopRequireDefault(_config); - -var _emitter = __webpack_require__(15); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _lodash = __webpack_require__(4); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -__webpack_require__(14); -__webpack_require__(19); - -var Bootstrap = function () { - function Bootstrap(userConfig) { - var _this = this; - - _classCallCheck(this, Bootstrap); - - var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); - - this.appEvents = new _emitter2.default(); - this.configService = new _configService2.default(configuration); - this.validatorLoaded = false; - this.localeService = new _locale2.default({ - configService: this.configService - }); - - this.localeService.fetchTranslations().then(function () { - _this.onConfigReady(); - }); - - return this; - } - - _createClass(Bootstrap, [{ - key: 'onConfigReady', - value: function onConfigReady() { - var _this2 = this; - - this.appServices = { - configService: this.configService, - localeService: this.localeService, - appEvents: this.appEvents - }; - - window.bodySize = { - x: 0, - y: 0 - }; - - /** - * add components - */ - - (0, _jquery2.default)(document).ready(function () { - // let $body = $('body'); - // window.bodySize.y = $body.height(); - // window.bodySize.x = $body.width(); - // - // this.appLightbox = lightbox(this.appServices); - // this.appLightbox.initialize({$container: $body}); - //mainMenu(this.appServices).initialize({$container: $body}); - _this2.mobileValidator(); - // this.isReleasable = this.configService.get('releasable'); - // - // if (this.isReleasable !== null) { - // this.appLightbox.setReleasable(this.isReleasable); - // } - }); - } - }, { - key: 'mobileValidator', - value: function mobileValidator() { - var _this4 = this; - - display_basket(); - - /*Get status before send validation*/ - function _getReseaseStatus(el) { - _jquery2.default.ajax({ - url: '/lightbox/ajax/GET_ELEMENTS/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', - dataType: 'json', - error: function error(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - timeout: function timeout(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - success: function success(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - if (data.datas) { - if (data.datas) { - if (data.datas.counts.nul == 0) { - _setRelease((0, _jquery2.default)(this)); - } else { - console.log(data.datas.counts); - (0, _jquery2.default)("#FeedbackRelease .record_accepted").html(data.datas.counts.yes); - (0, _jquery2.default)("#FeedbackRelease .record_refused").html(data.datas.counts.no); - (0, _jquery2.default)("#FeedbackRelease .record_null").html(data.datas.counts.nul); - (0, _jquery2.default)("#FeedbackRelease").modal("show"); - } - } - } - - return; - } - }); - } - - /*Send validation*/ - function _setRelease(el) { - var _this3 = this; - - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_RELEASE/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', - dataType: 'json', - error: function error(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - timeout: function timeout(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - }, - success: function success(data) { - (0, _jquery2.default)('.loader', el).css({ - visibility: 'hidden' - }); - if (data.datas) { - // alert(data.datas); - window.location.href = "/lightbox"; - } - if (!data.error) { - _this3.isReleasable = false; - //this.appLightbox.setReleasable(this.isReleasable); - } - - return; - } - }); - }; - - (0, _jquery2.default)('body').on('touchstart click', '.confirm_report', function (event) { - event.preventDefault(); - var $el = (0, _jquery2.default)(event.currentTarget); - _getReseaseStatus($el); - - return false; - }); - (0, _jquery2.default)('body').on('touchstart click', '#validate-release', function (event) { - event.preventDefault(); - (0, _jquery2.default)("#FeedbackRelease").modal("hide"); - _setRelease((0, _jquery2.default)(_this4)); - console.log('validation is done'); - - return false; - }); - - (0, _jquery2.default)('body').on('touchstart click', '.agreement_radio', function (event) { - event.preventDefault(); - //$('.agreement_radio').on('mousedown', (event) => { - var $el = (0, _jquery2.default)(event.currentTarget); - var sselcont_id = $el.attr('for').split('_').pop(); - var agreement = (0, _jquery2.default)('#' + $el.attr('for')).val() === 'yes' ? '1' : '-1'; - - _jquery2.default.mobile.loading(); - - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_ELEMENT_AGREEMENT/' + sselcont_id + '/', - dataType: 'json', - data: { - agreement: agreement - }, - error: function error(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - timeout: function timeout(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - success: function success(datas) { - if (!datas.error) { - if (agreement === 1) { - (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('disagree').addClass('agree'); - } else { - (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('agree').addClass('disagree'); - } - _jquery2.default.mobile.loading(); - if (datas.error) { - alert(datas.datas); - return; - } - _this4.isReleasable = datas.release; - //this.appLightbox.setReleasable(this.isReleasable); - window.location.reload(); - } else { - console.log(datas.datas); - } - return; - } - }); - //return false; - }); - - (0, _jquery2.default)('body').on('touchstart click', '.note_area_validate', function (event) { - - var $el = (0, _jquery2.default)(event.currentTarget); - var sselcont_id = $el.closest('form').find('input[name="sselcont_id"]').val(); - - _jquery2.default.mobile.loading(); - _jquery2.default.ajax({ - type: 'POST', - url: '/lightbox/ajax/SET_NOTE/' + sselcont_id + '/', - dataType: 'json', - data: { - note: (0, _jquery2.default)('#note_form_' + sselcont_id).find('textarea').val() - }, - error: function error(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - timeout: function timeout(datas) { - console.log('error'); - _jquery2.default.mobile.loading(); - }, - success: function success(datas) { - _jquery2.default.mobile.loading(); - if (datas.error) { - console.log(datas.datas); - return; - } - - (0, _jquery2.default)('#notes_' + sselcont_id).empty().append(datas.datas); - window.location.reload(); - return; - } - }); - return false; - }); - - function display_basket() { - var sc_wrapper = (0, _jquery2.default)('#sc_wrapper'); - - (0, _jquery2.default)('.basket_element', sc_wrapper).parent().bind('click', function (event) { - scid_click(event, this); - adjust_visibility(this); - return false; - }); - - (0, _jquery2.default)('.agree_button, .disagree_button', sc_wrapper).bind('click', function (event) { - - var sselcont_id = (0, _jquery2.default)(this).closest('.basket_element').attr('id').split('_').pop(); - - var agreement = (0, _jquery2.default)(this).hasClass('agree_button') ? '1' : '-1'; - - set_agreement(event, (0, _jquery2.default)(this), sselcont_id, agreement); - return false; - }).addClass('clickable'); - - var n = (0, _jquery2.default)('.basket_element', sc_wrapper).length; - (0, _jquery2.default)('#sc_container').width(n * (0, _jquery2.default)('.basket_element_wrapper:first', sc_wrapper).outerWidth() + 1); - } - - this.validatorLoaded = true; - } - }]); - - return Bootstrap; -}(); - -var bootstrap = function bootstrap(userConfig) { - return new Bootstrap(userConfig); -}; - -exports.default = bootstrap; - -/***/ }), - -/***/ 223: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultConfig = { - locale: 'fr', - basePath: '/', - translations: '/prod/language/' -}; - -exports.default = defaultConfig; - /***/ }), /***/ 24: @@ -5408,7 +5085,7 @@ exports.default = defaultConfig; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ResourceStore__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Translator__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__LanguageUtils__ = __webpack_require__(27); @@ -5831,8 +5508,8 @@ var I18n = function (_EventEmitter) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__EventEmitter__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -5979,15 +5656,430 @@ var ResourceStore = function (_EventEmitter) { /***/ }), +/***/ 257: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +var _bootstrap = __webpack_require__(258); + +var _bootstrap2 = _interopRequireDefault(_bootstrap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var lightboxMobileApplication = { + bootstrap: _bootstrap2.default +}; + +if (typeof window !== 'undefined') { + window.lightboxMobileApplication = lightboxMobileApplication; +} + +/*resize of PDF */ +$(window).on("load resize ", function (e) { + if ($('.pdf-iframe').length > 0) { + var pdfHeight = $('.pdf-iframe').width() / 0.707; + $('.pdf-iframe').css('height', pdfHeight); + } +}); +/*resize of VIDEO */ +$(window).on("load resize ", function (e) { + if ($('.video-iframe').length > 0) { + + var $sel = $('.center-image'); + var $window = $(window).height(); + + // V is for "video" ; K is for "container" ; N is for "new" + var VH = $('[name=videoHeight]').val(); + var VW = $('[name=videoWidth]').val(); + var KW = $sel.width(); + var KH = $sel.height(); + + if ($window <= 375) { + KH = 150; + } else { + if ($window > 375 && $window <= 480) { + KH = 200; + } + if ($window > 480 && $window <= 640) { + KH = 300; + } + + if ($window > 640 && $window <= 767) { + KH = 400; + } + if ($window > 767) { + KH = 550; + } + } + + var NW, NH; + if ((NH = VH / VW * (NW = KW)) > KH) { + // try to fit exact horizontally, adjust vertically + // too bad... new height overflows container height + NW = VW / VH * (NH = KH); // so fit exact vertically, adjust horizontally + } + $(".video-iframe", $sel).css('width', NW).css('height', NH); + } +}); + +module.exports = lightboxMobileApplication; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), + +/***/ 258: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +// import lightbox from './../components/lightbox/index'; +// import mainMenu from './../components/mainMenu'; + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _configService = __webpack_require__(16); + +var _configService2 = _interopRequireDefault(_configService); + +var _locale = __webpack_require__(20); + +var _locale2 = _interopRequireDefault(_locale); + +var _config = __webpack_require__(259); + +var _config2 = _interopRequireDefault(_config); + +var _emitter = __webpack_require__(15); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _lodash = __webpack_require__(4); + +var _lodash2 = _interopRequireDefault(_lodash); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +__webpack_require__(14); +__webpack_require__(19); + +var Bootstrap = function () { + function Bootstrap(userConfig) { + var _this = this; + + _classCallCheck(this, Bootstrap); + + var configuration = (0, _lodash2.default)({}, _config2.default, userConfig); + + this.appEvents = new _emitter2.default(); + this.configService = new _configService2.default(configuration); + this.validatorLoaded = false; + this.localeService = new _locale2.default({ + configService: this.configService + }); + + this.localeService.fetchTranslations().then(function () { + _this.onConfigReady(); + }); + + return this; + } + + _createClass(Bootstrap, [{ + key: 'onConfigReady', + value: function onConfigReady() { + var _this2 = this; + + this.appServices = { + configService: this.configService, + localeService: this.localeService, + appEvents: this.appEvents + }; + + window.bodySize = { + x: 0, + y: 0 + }; + + /** + * add components + */ + + (0, _jquery2.default)(document).ready(function () { + // let $body = $('body'); + // window.bodySize.y = $body.height(); + // window.bodySize.x = $body.width(); + // + // this.appLightbox = lightbox(this.appServices); + // this.appLightbox.initialize({$container: $body}); + //mainMenu(this.appServices).initialize({$container: $body}); + _this2.mobileValidator(); + // this.isReleasable = this.configService.get('releasable'); + // + // if (this.isReleasable !== null) { + // this.appLightbox.setReleasable(this.isReleasable); + // } + }); + } + }, { + key: 'mobileValidator', + value: function mobileValidator() { + var _this4 = this; + + display_basket(); + + /*Get status before send validation*/ + function _getReseaseStatus(el) { + _jquery2.default.ajax({ + url: '/lightbox/ajax/GET_ELEMENTS/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', + dataType: 'json', + error: function error(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + timeout: function timeout(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + success: function success(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + if (data.datas) { + if (data.datas) { + if (data.datas.counts.nul == 0) { + _setRelease((0, _jquery2.default)(this)); + } else { + console.log(data.datas.counts); + (0, _jquery2.default)("#FeedbackRelease .record_accepted").html(data.datas.counts.yes); + (0, _jquery2.default)("#FeedbackRelease .record_refused").html(data.datas.counts.no); + (0, _jquery2.default)("#FeedbackRelease .record_null").html(data.datas.counts.nul); + (0, _jquery2.default)("#FeedbackRelease").modal("show"); + } + } + } + + return; + } + }); + } + + /*Send validation*/ + function _setRelease(el) { + var _this3 = this; + + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_RELEASE/' + (0, _jquery2.default)('#basket_validation_id').val() + '/', + dataType: 'json', + error: function error(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + timeout: function timeout(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + }, + success: function success(data) { + (0, _jquery2.default)('.loader', el).css({ + visibility: 'hidden' + }); + if (data.datas) { + // alert(data.datas); + window.location.href = "/lightbox"; + } + if (!data.error) { + _this3.isReleasable = false; + //this.appLightbox.setReleasable(this.isReleasable); + } + + return; + } + }); + }; + + (0, _jquery2.default)('body').on('touchstart click', '.confirm_report', function (event) { + event.preventDefault(); + var $el = (0, _jquery2.default)(event.currentTarget); + _getReseaseStatus($el); + + return false; + }); + (0, _jquery2.default)('body').on('touchstart click', '#validate-release', function (event) { + event.preventDefault(); + (0, _jquery2.default)("#FeedbackRelease").modal("hide"); + _setRelease((0, _jquery2.default)(_this4)); + console.log('validation is done'); + + return false; + }); + + (0, _jquery2.default)('body').on('touchstart click', '.agreement_radio', function (event) { + event.preventDefault(); + //$('.agreement_radio').on('mousedown', (event) => { + var $el = (0, _jquery2.default)(event.currentTarget); + var sselcont_id = $el.attr('for').split('_').pop(); + var agreement = (0, _jquery2.default)('#' + $el.attr('for')).val() === 'yes' ? '1' : '-1'; + + _jquery2.default.mobile.loading(); + + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_ELEMENT_AGREEMENT/' + sselcont_id + '/', + dataType: 'json', + data: { + agreement: agreement + }, + error: function error(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + timeout: function timeout(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + success: function success(datas) { + if (!datas.error) { + if (agreement === 1) { + (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('disagree').addClass('agree'); + } else { + (0, _jquery2.default)('.valid_choice_' + sselcont_id).removeClass('agree').addClass('disagree'); + } + _jquery2.default.mobile.loading(); + if (datas.error) { + alert(datas.datas); + return; + } + _this4.isReleasable = datas.release; + //this.appLightbox.setReleasable(this.isReleasable); + window.location.reload(); + } else { + console.log(datas.datas); + } + return; + } + }); + //return false; + }); + + (0, _jquery2.default)('body').on('touchstart click', '.note_area_validate', function (event) { + + var $el = (0, _jquery2.default)(event.currentTarget); + var sselcont_id = $el.closest('form').find('input[name="sselcont_id"]').val(); + + _jquery2.default.mobile.loading(); + _jquery2.default.ajax({ + type: 'POST', + url: '/lightbox/ajax/SET_NOTE/' + sselcont_id + '/', + dataType: 'json', + data: { + note: (0, _jquery2.default)('#note_form_' + sselcont_id).find('textarea').val() + }, + error: function error(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + timeout: function timeout(datas) { + console.log('error'); + _jquery2.default.mobile.loading(); + }, + success: function success(datas) { + _jquery2.default.mobile.loading(); + if (datas.error) { + console.log(datas.datas); + return; + } + + (0, _jquery2.default)('#notes_' + sselcont_id).empty().append(datas.datas); + window.location.reload(); + return; + } + }); + return false; + }); + + function display_basket() { + var sc_wrapper = (0, _jquery2.default)('#sc_wrapper'); + + (0, _jquery2.default)('.basket_element', sc_wrapper).parent().bind('click', function (event) { + scid_click(event, this); + adjust_visibility(this); + return false; + }); + + (0, _jquery2.default)('.agree_button, .disagree_button', sc_wrapper).bind('click', function (event) { + + var sselcont_id = (0, _jquery2.default)(this).closest('.basket_element').attr('id').split('_').pop(); + + var agreement = (0, _jquery2.default)(this).hasClass('agree_button') ? '1' : '-1'; + + set_agreement(event, (0, _jquery2.default)(this), sselcont_id, agreement); + return false; + }).addClass('clickable'); + + var n = (0, _jquery2.default)('.basket_element', sc_wrapper).length; + (0, _jquery2.default)('#sc_container').width(n * (0, _jquery2.default)('.basket_element_wrapper:first', sc_wrapper).outerWidth() + 1); + } + + this.validatorLoaded = true; + } + }]); + + return Bootstrap; +}(); + +var bootstrap = function bootstrap(userConfig) { + return new Bootstrap(userConfig); +}; + +exports.default = bootstrap; + +/***/ }), + +/***/ 259: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultConfig = { + locale: 'fr', + basePath: '/', + translations: '/prod/language/' +}; + +exports.default = defaultConfig; + +/***/ }), + /***/ 26: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__postProcessor__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__compatibility_v1__ = __webpack_require__(13); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(10); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -6590,7 +6682,7 @@ var PluralResolver = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -6867,9 +6959,9 @@ var Logger = function () { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(9); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -7162,7 +7254,7 @@ var Connector = function (_EventEmitter) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logger__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__EventEmitter__ = __webpack_require__(6); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } @@ -9567,11 +9659,39 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), /***/ 5: +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ 6: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9639,34 +9759,6 @@ var EventEmitter = function () { /* harmony default export */ __webpack_exports__["a"] = (EventEmitter); -/***/ }), - -/***/ 6: -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /***/ 7: @@ -22062,128 +22154,36 @@ var ReactiveTest = Rx.ReactiveTest = { }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)(module), __webpack_require__(6), __webpack_require__(22))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5), __webpack_require__(22))) /***/ }), -/***/ 9: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 8: +/***/ (function(module, exports) { -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["e"] = makeString; -/* harmony export (immutable) */ __webpack_exports__["a"] = copy; -/* harmony export (immutable) */ __webpack_exports__["h"] = setPath; -/* harmony export (immutable) */ __webpack_exports__["f"] = pushPath; -/* harmony export (immutable) */ __webpack_exports__["d"] = getPath; -/* harmony export (immutable) */ __webpack_exports__["b"] = deepExtend; -/* harmony export (immutable) */ __webpack_exports__["g"] = regexEscape; -/* harmony export (immutable) */ __webpack_exports__["c"] = escape; -function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; -} +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; -function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); -} - -function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key; - } - - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - - var stack = typeof path !== 'string' ? [].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()) - }; -} - -function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - - obj[k] = newValue; -} - -function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); -} - -function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - - if (!obj) return undefined; - return obj[k]; -} - -function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; -} - -function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/* eslint-disable */ -var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' -}; -/* eslint-enable */ - -function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - - return data; -} /***/ }) diff --git a/Phraseanet-production-client/dist/lightbox.js b/Phraseanet-production-client/dist/lightbox.js index 0b451b1b92..76d124735f 100644 --- a/Phraseanet-production-client/dist/lightbox.js +++ b/Phraseanet-production-client/dist/lightbox.js @@ -17,13 +17,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), -/***/ 216: +/***/ 252: /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) { -var _bootstrap = __webpack_require__(217); +var _bootstrap = __webpack_require__(253); var _bootstrap2 = _interopRequireDefault(_bootstrap); @@ -63,7 +63,7 @@ module.exports = lightboxApplication; /***/ }), -/***/ 217: +/***/ 253: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87,7 +87,7 @@ var _locale = __webpack_require__(20); var _locale2 = _interopRequireDefault(_locale); -var _config = __webpack_require__(218); +var _config = __webpack_require__(254); var _config2 = _interopRequireDefault(_config); @@ -95,11 +95,11 @@ var _emitter = __webpack_require__(15); var _emitter2 = _interopRequireDefault(_emitter); -var _index = __webpack_require__(219); +var _index = __webpack_require__(255); var _index2 = _interopRequireDefault(_index); -var _mainMenu = __webpack_require__(74); +var _mainMenu = __webpack_require__(79); var _mainMenu2 = _interopRequireDefault(_mainMenu); @@ -113,7 +113,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons __webpack_require__(14); __webpack_require__(19); -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var Bootstrap = function () { function Bootstrap(userConfig) { @@ -190,7 +190,7 @@ exports.default = bootstrap; /***/ }), -/***/ 218: +/***/ 254: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -209,7 +209,7 @@ exports.default = defaultConfig; /***/ }), -/***/ 219: +/***/ 255: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -223,11 +223,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(58); var _utils2 = _interopRequireDefault(_utils); -var _download = __webpack_require__(220); +var _download = __webpack_require__(256); var _download2 = _interopRequireDefault(_download); @@ -237,8 +237,8 @@ var _pym2 = _interopRequireDefault(_pym); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(37); -var humane = __webpack_require__(8); +__webpack_require__(38); +var humane = __webpack_require__(9); var lightbox = function lightbox(services) { @@ -1185,7 +1185,7 @@ exports.default = lightbox; /***/ }), -/***/ 220: +/***/ 256: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1205,7 +1205,7 @@ var _dialog2 = _interopRequireDefault(_dialog); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var download = function download(services) { var configService = services.configService, @@ -1606,5 +1606,5 @@ exports.default = download; /***/ }) -},[216]); +},[252]); }); \ No newline at end of file diff --git a/Phraseanet-production-client/dist/lightbox.min.js b/Phraseanet-production-client/dist/lightbox.min.js index 0b451b1b92..76d124735f 100644 --- a/Phraseanet-production-client/dist/lightbox.min.js +++ b/Phraseanet-production-client/dist/lightbox.min.js @@ -17,13 +17,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), -/***/ 216: +/***/ 252: /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) { -var _bootstrap = __webpack_require__(217); +var _bootstrap = __webpack_require__(253); var _bootstrap2 = _interopRequireDefault(_bootstrap); @@ -63,7 +63,7 @@ module.exports = lightboxApplication; /***/ }), -/***/ 217: +/***/ 253: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87,7 +87,7 @@ var _locale = __webpack_require__(20); var _locale2 = _interopRequireDefault(_locale); -var _config = __webpack_require__(218); +var _config = __webpack_require__(254); var _config2 = _interopRequireDefault(_config); @@ -95,11 +95,11 @@ var _emitter = __webpack_require__(15); var _emitter2 = _interopRequireDefault(_emitter); -var _index = __webpack_require__(219); +var _index = __webpack_require__(255); var _index2 = _interopRequireDefault(_index); -var _mainMenu = __webpack_require__(74); +var _mainMenu = __webpack_require__(79); var _mainMenu2 = _interopRequireDefault(_mainMenu); @@ -113,7 +113,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons __webpack_require__(14); __webpack_require__(19); -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var Bootstrap = function () { function Bootstrap(userConfig) { @@ -190,7 +190,7 @@ exports.default = bootstrap; /***/ }), -/***/ 218: +/***/ 254: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -209,7 +209,7 @@ exports.default = defaultConfig; /***/ }), -/***/ 219: +/***/ 255: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -223,11 +223,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(58); var _utils2 = _interopRequireDefault(_utils); -var _download = __webpack_require__(220); +var _download = __webpack_require__(256); var _download2 = _interopRequireDefault(_download); @@ -237,8 +237,8 @@ var _pym2 = _interopRequireDefault(_pym); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(37); -var humane = __webpack_require__(8); +__webpack_require__(38); +var humane = __webpack_require__(9); var lightbox = function lightbox(services) { @@ -1185,7 +1185,7 @@ exports.default = lightbox; /***/ }), -/***/ 220: +/***/ 256: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1205,7 +1205,7 @@ var _dialog2 = _interopRequireDefault(_dialog); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var download = function download(services) { var configService = services.configService, @@ -1606,5 +1606,5 @@ exports.default = download; /***/ }) -},[216]); +},[252]); }); \ No newline at end of file diff --git a/Phraseanet-production-client/dist/permaview.js b/Phraseanet-production-client/dist/permaview.js index caf28ca5f2..1a8d7b23e3 100644 --- a/Phraseanet-production-client/dist/permaview.js +++ b/Phraseanet-production-client/dist/permaview.js @@ -70,40 +70,11 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 224); +/******/ return __webpack_require__(__webpack_require__.s = 260); /******/ }) /************************************************************************/ /******/ ({ -/***/ 10: -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), - /***/ 16: /***/ (function(module, exports, __webpack_require__) { @@ -3106,23 +3077,23 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 224: +/***/ 260: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _bootstrap = __webpack_require__(225); +var _bootstrap = __webpack_require__(261); var _bootstrap2 = _interopRequireDefault(_bootstrap); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(227); +__webpack_require__(263); var PermaviewApplication = { @@ -3137,7 +3108,7 @@ module.exports = PermaviewApplication; /***/ }), -/***/ 225: +/***/ 261: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3151,7 +3122,7 @@ var _configService = __webpack_require__(16); var _configService2 = _interopRequireDefault(_configService); -var _config = __webpack_require__(226); +var _config = __webpack_require__(262); var _config2 = _interopRequireDefault(_config); @@ -3187,7 +3158,7 @@ exports.default = bootstrap; /***/ }), -/***/ 226: +/***/ 262: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3216,7 +3187,7 @@ exports.default = defaultConfig; /***/ }), -/***/ 227: +/***/ 263: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin @@ -5204,11 +5175,11 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 6: +/***/ 5: /***/ (function(module, exports) { var g; @@ -5234,6 +5205,35 @@ try { module.exports = g; +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + /***/ }) /******/ }); diff --git a/Phraseanet-production-client/dist/permaview.min.js b/Phraseanet-production-client/dist/permaview.min.js index caf28ca5f2..1a8d7b23e3 100644 --- a/Phraseanet-production-client/dist/permaview.min.js +++ b/Phraseanet-production-client/dist/permaview.min.js @@ -70,40 +70,11 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/assets/production/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 224); +/******/ return __webpack_require__(__webpack_require__.s = 260); /******/ }) /************************************************************************/ /******/ ({ -/***/ 10: -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), - /***/ 16: /***/ (function(module, exports, __webpack_require__) { @@ -3106,23 +3077,23 @@ exports.default = ApplicationConfigService; } }()); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 224: +/***/ 260: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _bootstrap = __webpack_require__(225); +var _bootstrap = __webpack_require__(261); var _bootstrap2 = _interopRequireDefault(_bootstrap); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(227); +__webpack_require__(263); var PermaviewApplication = { @@ -3137,7 +3108,7 @@ module.exports = PermaviewApplication; /***/ }), -/***/ 225: +/***/ 261: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3151,7 +3122,7 @@ var _configService = __webpack_require__(16); var _configService2 = _interopRequireDefault(_configService); -var _config = __webpack_require__(226); +var _config = __webpack_require__(262); var _config2 = _interopRequireDefault(_config); @@ -3187,7 +3158,7 @@ exports.default = bootstrap; /***/ }), -/***/ 226: +/***/ 262: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3216,7 +3187,7 @@ exports.default = defaultConfig; /***/ }), -/***/ 227: +/***/ 263: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin @@ -5204,11 +5175,11 @@ function stubFalse() { module.exports = merge; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(10)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(8)(module))) /***/ }), -/***/ 6: +/***/ 5: /***/ (function(module, exports) { var g; @@ -5234,6 +5205,35 @@ try { module.exports = g; +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + /***/ }) /******/ }); diff --git a/Phraseanet-production-client/dist/production.js b/Phraseanet-production-client/dist/production.js index e678641ac2..c99e182a99 100644 --- a/Phraseanet-production-client/dist/production.js +++ b/Phraseanet-production-client/dist/production.js @@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.userModule = exports.utilsModule = exports.commonModule = exports.dialogModule = undefined; -var _common = __webpack_require__(90); +var _common = __webpack_require__(96); var _common2 = _interopRequireDefault(_common); @@ -44,11 +44,11 @@ var _dialog = __webpack_require__(1); var _dialog2 = _interopRequireDefault(_dialog); -var _user = __webpack_require__(45); +var _user = __webpack_require__(47); var _user2 = _interopRequireDefault(_user); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(58); var _utils2 = _interopRequireDefault(_utils); @@ -329,8 +329,33 @@ exports.default = Selectable; /* 34 */, /* 35 */, /* 36 */, -/* 37 */, -/* 38 */ +/* 37 */ +/***/ (function(module, exports) { + +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} + + +/***/ }), +/* 38 */, +/* 39 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -719,68 +744,6 @@ exports.default = Selectable; }.call(window)); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.generateRandStr = exports.cleanTags = exports.escapeHtml = undefined; - -var _phraseanetCommon = __webpack_require__(11); - -var AppCommons = _interopRequireWildcard(_phraseanetCommon); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '/': '/' -}; -var escapeHtml = function escapeHtml(string) { - return String(string).replace(/[&<>"'\/]/g, function (s) { - return entityMap[s]; - }); -}; -// @TODO - check legacy code -var cleanTags = function cleanTags(string) { - var chars2replace = [{ - f: '&', - t: '&' - }, { - f: '<', - t: '<' - }, { - f: '>', - t: '>' - }]; - for (var c in chars2replace) { - string = string.replace(RegExp(chars2replace[c].f, 'g'), chars2replace[c].t); - } - return string; -}; - -var generateRandStr = function generateRandStr() { - var sLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5; - - var s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; - return Array(sLength).join().split(',').map(function () { - return s.charAt(Math.floor(Math.random() * s.length)); - }).join(''); -}; - -exports.escapeHtml = escapeHtml; -exports.cleanTags = cleanTags; -exports.generateRandStr = generateRandStr; - /***/ }), /* 40 */ /***/ (function(module, exports) { @@ -910,7 +873,7 @@ var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; -var fixUrls = __webpack_require__(153); +var fixUrls = __webpack_require__(185); module.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { @@ -1223,8 +1186,70 @@ function updateLink (link, options, obj) { /***/ }), -/* 42 */, -/* 43 */ +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.generateRandStr = exports.cleanTags = exports.escapeHtml = undefined; + +var _phraseanetCommon = __webpack_require__(11); + +var AppCommons = _interopRequireWildcard(_phraseanetCommon); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +var entityMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '/': '/' +}; +var escapeHtml = function escapeHtml(string) { + return String(string).replace(/[&<>"'\/]/g, function (s) { + return entityMap[s]; + }); +}; +// @TODO - check legacy code +var cleanTags = function cleanTags(string) { + var chars2replace = [{ + f: '&', + t: '&' + }, { + f: '<', + t: '<' + }, { + f: '>', + t: '>' + }]; + for (var c in chars2replace) { + string = string.replace(RegExp(chars2replace[c].f, 'g'), chars2replace[c].t); + } + return string; +}; + +var generateRandStr = function generateRandStr() { + var sLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5; + + var s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + return Array(sLength).join().split(',').map(function () { + return s.charAt(Math.floor(Math.random() * s.length)); + }).join(''); +}; + +exports.escapeHtml = escapeHtml; +exports.cleanTags = cleanTags; +exports.generateRandStr = generateRandStr; + +/***/ }), +/* 43 */, +/* 44 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var win; @@ -1241,10 +1266,28 @@ if (typeof window !== "undefined") { module.exports = win; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/* 44 */ +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + API_ORIGIN: 'https://api.mapbox.com', + EVENT_PROGRESS_DOWNLOAD: 'downloadProgress', + EVENT_PROGRESS_UPLOAD: 'uploadProgress', + EVENT_ERROR: 'error', + EVENT_RESPONSE: 'response', + ERROR_HTTP: 'HttpError', + ERROR_REQUEST_ABORTED: 'RequestAbortedError' +}; + + +/***/ }), +/* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1310,7 +1353,7 @@ var Alerts = alert; exports.default = Alerts; /***/ }), -/* 45 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1326,7 +1369,7 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); // @TODO enable lints +var humane = __webpack_require__(9); // @TODO enable lints /* eslint-disable no-undef*/ @@ -1366,7 +1409,7 @@ function setPref(name, value) { exports.default = { setPref: setPref }; /***/ }), -/* 46 */ +/* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1380,11 +1423,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _notifyLayout = __webpack_require__(108); +var _notifyLayout = __webpack_require__(114); var _notifyLayout2 = _interopRequireDefault(_notifyLayout); -var _notifyService = __webpack_require__(109); +var _notifyService = __webpack_require__(115); var _notifyService2 = _interopRequireDefault(_notifyService); @@ -1497,7 +1540,7 @@ var notify = function notify(services) { exports.default = notify; /***/ }), -/* 47 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1515,67 +1558,67 @@ var _phraseanetCommon = __webpack_require__(11); var appCommons = _interopRequireWildcard(_phraseanetCommon); -var _toolbar = __webpack_require__(110); +var _toolbar = __webpack_require__(116); var _toolbar2 = _interopRequireDefault(_toolbar); -var _mainMenu = __webpack_require__(74); +var _mainMenu = __webpack_require__(79); var _mainMenu2 = _interopRequireDefault(_mainMenu); -var _keyboard = __webpack_require__(187); +var _keyboard = __webpack_require__(223); var _keyboard2 = _interopRequireDefault(_keyboard); -var _cgu = __webpack_require__(188); +var _cgu = __webpack_require__(224); var _cgu2 = _interopRequireDefault(_cgu); -var _edit = __webpack_require__(61); +var _edit = __webpack_require__(63); var _edit2 = _interopRequireDefault(_edit); -var _export = __webpack_require__(68); +var _export = __webpack_require__(73); var _export2 = _interopRequireDefault(_export); -var _share = __webpack_require__(189); +var _share = __webpack_require__(225); var _share2 = _interopRequireDefault(_share); -var _index = __webpack_require__(73); +var _index = __webpack_require__(78); var _index2 = _interopRequireDefault(_index); -var _addToBasket = __webpack_require__(190); +var _addToBasket = __webpack_require__(226); var _addToBasket2 = _interopRequireDefault(_addToBasket); -var _removeFromBasket = __webpack_require__(191); +var _removeFromBasket = __webpack_require__(227); var _removeFromBasket2 = _interopRequireDefault(_removeFromBasket); -var _print = __webpack_require__(72); +var _print = __webpack_require__(77); var _print2 = _interopRequireDefault(_print); -var _preferences = __webpack_require__(192); +var _preferences = __webpack_require__(228); var _preferences2 = _interopRequireDefault(_preferences); -var _order = __webpack_require__(75); +var _order = __webpack_require__(80); var _order2 = _interopRequireDefault(_order); -var _recordPreview = __webpack_require__(196); +var _recordPreview = __webpack_require__(232); var _recordPreview2 = _interopRequireDefault(_recordPreview); -var _alert = __webpack_require__(44); +var _alert = __webpack_require__(46); var _alert2 = _interopRequireDefault(_alert); -var _uploader = __webpack_require__(200); +var _uploader = __webpack_require__(236); var _uploader2 = _interopRequireDefault(_uploader); @@ -2001,19 +2044,19 @@ var ui = function ui(services) { exports.default = ui; /***/ }), -/* 48 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var implementation = __webpack_require__(123); +var implementation = __webpack_require__(129); module.exports = Function.prototype.bind || implementation; /***/ }), -/* 49 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2057,7 +2100,7 @@ module.exports = function isCallable(value) { /***/ }), -/* 50 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2079,21 +2122,21 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _markerCollection = __webpack_require__(145); +var _markerCollection = __webpack_require__(150); var _markerCollection2 = _interopRequireDefault(_markerCollection); -var _markerGLCollection = __webpack_require__(146); +var _markerGLCollection = __webpack_require__(151); var _markerGLCollection2 = _interopRequireDefault(_markerGLCollection); -var _utils = __webpack_require__(39); +var _utils = __webpack_require__(42); -var _provider = __webpack_require__(147); +var _provider = __webpack_require__(152); var _provider2 = _interopRequireDefault(_provider); -var _fr = __webpack_require__(148); +var _fr = __webpack_require__(153); var _fr2 = _interopRequireDefault(_fr); @@ -2101,13 +2144,20 @@ var _lodash = __webpack_require__(4); var _lodash2 = _interopRequireDefault(_lodash); +var _mapboxGlGeocoder = __webpack_require__(154); + +var _mapboxGlGeocoder2 = _interopRequireDefault(_mapboxGlGeocoder); + +__webpack_require__(183); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(149); -__webpack_require__(154); -__webpack_require__(156); -__webpack_require__(158); -__webpack_require__(162); +__webpack_require__(186); +__webpack_require__(190); +__webpack_require__(192); +__webpack_require__(194); +__webpack_require__(198); + var leafletMap = function leafletMap(services) { var configService = services.configService, localeService = services.localeService, @@ -2125,6 +2175,7 @@ var leafletMap = function leafletMap(services) { var map = null; var geocoder = null; var mapboxClient = null; + var markerGl = []; var $tabContent = void 0; var tabContainerName = 'leafletTabContainer'; var editable = void 0; @@ -2239,50 +2290,29 @@ var leafletMap = function leafletMap(services) { } __webpack_require__.e/* require.ensure */(3).then((function () { // select geocoding provider: - mapbox = __webpack_require__(259); - leafletDraw = __webpack_require__(260); - __webpack_require__(261); - mapboxgl = __webpack_require__(66); - var MapboxClient = __webpack_require__(262); - var MapboxLanguage = __webpack_require__(263); - MapboxCircle = __webpack_require__(264); - turf = __webpack_require__(265); + mapbox = __webpack_require__(295); + leafletDraw = __webpack_require__(296); + __webpack_require__(297); + mapboxgl = __webpack_require__(68); + var MapboxClient = __webpack_require__(298); + var MapboxLanguage = __webpack_require__(299); + MapboxCircle = __webpack_require__(300); + turf = __webpack_require__(301); $container.empty().append('
'); - if (editable) { - // init add marker context menu only if 1 record is available and has no coords - if (pois.length === 1) { - var poiIndex = 0; - var selectedPoi = pois[poiIndex]; - var poiCoords = haveValidCoords(selectedPoi); - if (poiCoords === false) { - mapOptions = (0, _lodash2.default)({ - contextmenu: true, - contextmenuWidth: 140, - contextmenuItems: [{ - text: localeService.t('mapMarkerAdd'), - callback: function callback(e) { - addMarkerOnce(e, poiIndex, selectedPoi); - } - }] - }, mapOptions); - } - } - } - if (!shouldUseMapboxGl()) { L.mapbox.accessToken = activeProvider.accessToken; - map = L.mapbox.map(mapUID, 'mapbox.streets', mapOptions); + map = L.mapbox.map(mapUID, _underscore2.default, mapOptions); shouldUpdateZoom = false; map.setView(activeProvider.defaultPosition, activeProvider.defaultZoom); if (searchable) { map.addControl(L.mapbox.geocoderControl('mapbox.places')); } var layers = { - Streets: L.mapbox.tileLayer('mapbox.streets'), - Outdoors: L.mapbox.tileLayer('mapbox.outdoors'), - Satellite: L.mapbox.tileLayer('mapbox.satellite') + Streets: L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'), + Outdoors: L.mapbox.styleLayer('mapbox://styles/mapbox/outdoors-v11'), + Satellite: L.mapbox.styleLayer('mapbox://styles/mapbox/satellite-v9') }; layers.Streets.addTo(map); @@ -2294,6 +2324,32 @@ var leafletMap = function leafletMap(services) { } addMarkersLayers(); refreshMarkers(pois); + addNoticeControlJS(drawable, editable); + + if (editable) { + map.on('contextmenu', function (eContext) { + var buttonText = localeService.t("Change position"); + if (pois.length === 1) { + var poiIndex = 0; + var selectedPoi = pois[poiIndex]; + var poiCoords = haveValidCoords(selectedPoi); + + // if has no coords + if (poiCoords === false) { + buttonText = localeService.t("mapMarkerAdd"); + } + } + + var popupDialog = L.popup({ closeOnClick: false }).setLatLng(eContext.latlng).setContent('').openOn(map); + + var popup = document.getElementsByClassName('leaflet-popup'); + (0, _jquery2.default)(popup[0]).on('click', '.add-position', function (event) { + for (var i = 0; i < pois.length; i++) { + addMarkerOnce(eContext, i, pois[i]); + } + }); + }); + } } else { mapboxgl.accessToken = activeProvider.accessToken; if (mapboxGLDefaultPosition == null) { @@ -2335,21 +2391,31 @@ var leafletMap = function leafletMap(services) { eventEmitter.emit('updateCircleGeo', { shapes: [], drawnItems: [] }); eventEmitter.emit('updateSearchValue'); removeCircleIfExist(); - removeNoticeControl(); + removeNoticeControlGL(); }); (0, _jquery2.default)('.submit-geo-search-action').on('click', function (event) { removeCircleIfExist(); - removeNoticeControl(); + removeNoticeControlGL(); }); addCircleDrawControl(); - addNoticeControl(); addCircleGeoDrawing(drawnItems); } else { map.addControl(new mapboxgl.NavigationControl()); } + addNoticeControlGL(drawable, editable); + + if (searchable) { + var geocoderSearch = new _mapboxGlGeocoder2.default({ + accessToken: mapboxgl.accessToken, + mapboxgl: mapboxgl, + marker: false + }); + map.addControl(geocoderSearch, 'top-left'); + } + map.on('style.load', function () { // Triggered when `setStyle` is called. if (map.getStyle().name == "Mapbox Streets" || map.getStyle().name == "Mapbox Light") { @@ -2380,6 +2446,15 @@ var leafletMap = function leafletMap(services) { } if (!drawable) { + + for (var _i = 0; _i < pois.length; _i++) { + // add class for the icon + var el = document.createElement('div'); + el.className = 'mapboxGl-phrasea-marker'; + + markerGl[pois[_i]._rid] = new mapboxgl.Marker(el); + } + addMarkersLayersGL(geojson); refreshMarkers(pois); } else { @@ -2399,6 +2474,38 @@ var leafletMap = function leafletMap(services) { //map.on('moveend', calculateBounds).on('zoomend', calculateBounds); } }); + + if (editable) { + map.on('contextmenu', function (eContext) { + var buttonText = localeService.t("Change position"); + if (pois.length === 1) { + var poiIndex = 0; + var selectedPoi = pois[poiIndex]; + var poiCoords = haveValidCoords(selectedPoi); + + // if has no coords + if (poiCoords === false) { + buttonText = localeService.t("mapMarkerAdd"); + } + } + + var popup = document.getElementsByClassName('mapboxgl-popup'); + // Check if there is already a popup on the map and if so, remove it + if (popup[0]) { + popup[0].parentElement.removeChild(popup[0]); + } + + var popupDialog = new mapboxgl.Popup({ closeOnClick: false }).setLngLat(eContext.lngLat).setHTML('').addTo(map); + + popup = document.getElementsByClassName('mapboxgl-popup'); + (0, _jquery2.default)(popup[0]).on('click', '.add-position', function (event) { + popup[0].parentElement.removeChild(popup[0]); + for (var i = 0; i < pois.length; i++) { + addMarkerOnce(eContext, i, pois[i]); + } + }); + }); + } } currentZoomLevel = activeProvider.markerDefaultZoom; @@ -2463,18 +2570,36 @@ var leafletMap = function leafletMap(services) { } }; - var addNoticeControl = function addNoticeControl() { - var controlContainerList = (0, _jquery2.default)('.mapboxgl-control-container'); - var $noticeButton = (0, _jquery2.default)(''); - controlContainerList.append($noticeButton); + var addNoticeControlGL = function addNoticeControlGL(drawable, editable) { + var controlContainerSearch = (0, _jquery2.default)('.map_search_dialog .mapboxgl-control-container'); + var controlContainerEdit = (0, _jquery2.default)('#EDITWINDOW .mapboxgl-control-container'); - var $noticeBox = (0, _jquery2.default)('
' + localeService.t("title notice") + '' + localeService.t("description notice") + '
'); - controlContainerList.append($noticeBox); + var $noticeButton = null; + var $noticeBox = null; + if (drawable) { + $noticeButton = (0, _jquery2.default)(''); - $noticeButton.on('click', function (event) { - $noticeBox.show(); - $noticeButton.hide(); - }); + $noticeBox = (0, _jquery2.default)('
' + localeService.t("title notice") + '' + localeService.t("description notice") + '
'); + + controlContainerSearch.append($noticeButton); + controlContainerSearch.append($noticeBox); + } + + if (editable) { + $noticeButton = (0, _jquery2.default)(''); + + $noticeBox = (0, _jquery2.default)('
' + localeService.t("prod:mapboxgl: title info") + '' + localeService.t("prod:mapboxgl: description info : right click to add position") + '
'); + + controlContainerEdit.append($noticeButton); + controlContainerEdit.append($noticeBox); + } + + if ($noticeButton != null) { + $noticeButton.on('click', function (event) { + $noticeBox.show(); + $noticeButton.hide(); + }); + } (0, _jquery2.default)('.notice-close-btn').on('click', function (event) { $noticeBox.hide(); @@ -2482,11 +2607,65 @@ var leafletMap = function leafletMap(services) { }); }; - var removeNoticeControl = function removeNoticeControl() { - var controlContainerList = (0, _jquery2.default)('.mapboxgl-control-container'); - if (controlContainerList.find('#notice-box').length > 0) { + var removeNoticeControlGL = function removeNoticeControlGL() { + var controlContainerSearch = (0, _jquery2.default)('.map_search_dialog .mapboxgl-control-container'); + var controlContainerEdit = (0, _jquery2.default)('#EDITWINDOW .mapboxgl-control-container'); + + if (controlContainerSearch.find('#notice-box').length > 0) { (0, _jquery2.default)('#notice-box').remove(); } + if (controlContainerEdit.find('#notice-info-box').length > 0) { + (0, _jquery2.default)('#notice-info-box').remove(); + } + }; + + var addNoticeControlJS = function addNoticeControlJS(drawable) { + var controlContainerSearch = (0, _jquery2.default)('.map_search_dialog .leaflet-control-container'); + var controlContainerEdit = (0, _jquery2.default)('#EDITWINDOW .leaflet-control-container'); + + var $noticeButtonJs = null; + var $noticeBoxJs = null; + if (drawable) { + $noticeButtonJs = (0, _jquery2.default)(''); + + $noticeBoxJs = (0, _jquery2.default)('
' + localeService.t("prod:mapboxjs: title notice") + '' + localeService.t("prod:mapboxjs: description notice") + '
'); + + controlContainerSearch.append($noticeButtonJs); + controlContainerSearch.append($noticeBoxJs); + } + + if (editable) { + $noticeButtonJs = (0, _jquery2.default)(''); + + $noticeBoxJs = (0, _jquery2.default)('
' + localeService.t("prod:mapboxjs: title info") + '' + localeService.t("prod:mapboxjs: description info : right click to add position") + '
'); + + controlContainerEdit.append($noticeButtonJs); + controlContainerEdit.append($noticeBoxJs); + } + + if ($noticeButtonJs != null) { + $noticeButtonJs.on('click', function (event) { + $noticeBoxJs.show(); + $noticeButtonJs.hide(); + }); + } + + (0, _jquery2.default)('.notice-close-btn').on('click', function (event) { + $noticeBoxJs.hide(); + $noticeButtonJs.show(); + }); + }; + + var removeNoticeControlJS = function removeNoticeControlJS() { + var controlContainerSearch = (0, _jquery2.default)('.map_search_dialog .leaflet-control-container'); + var controlContainerEdit = (0, _jquery2.default)('#EDITWINDOW .leaflet-control-container'); + + if (controlContainerSearch.find('#noticeJs-box').length > 0) { + (0, _jquery2.default)('#noticeJs-box').remove(); + } + if (controlContainerEdit.find('#notice-infoJs-box').length > 0) { + (0, _jquery2.default)('#notice-infoJs-box').remove(); + } }; var addCircleDrawControl = function addCircleDrawControl() { @@ -2735,7 +2914,13 @@ var leafletMap = function leafletMap(services) { }; var addMarkerOnce = function addMarkerOnce(e, poiIndex, poi) { // inject coords into poi's fields: - var mappedCoords = getMappedFields(e.latlng); + var mappedCoords = ''; + if (shouldUseMapboxGl()) { + mappedCoords = getMappedFields(e.lngLat); + } else { + mappedCoords = getMappedFields(e.latlng); + } + var pois = [(0, _lodash2.default)(poi, mappedCoords)]; refreshMarkers(pois).then(function () { // broadcast event: @@ -2750,7 +2935,9 @@ var leafletMap = function leafletMap(services) { var presets = { fields: wrappedMappedFields //presetFields }; - map.contextmenu.disable(); + if (!shouldUseMapboxGl()) { + map.contextmenu.disable(); + } eventEmitter.emit('recordEditor.addPresetValuesFromDataSource', { data: presets, recordIndex: poiIndex }); }); }; @@ -2782,15 +2969,23 @@ var leafletMap = function leafletMap(services) { data: geojson }); - map.addLayer({ - id: 'points', - source: 'data', - type: 'symbol', - layout: { - "icon-image": "star-15", - "icon-size": 1.5 - } - }); + // map.loadImage( + // '/assets/common/images/icons/marker_icon.png', + // function (error, image) { + // if (error) throw error; + // map.addImage('custom-marker', image); + // + // // Add a symbol layer + // map.addLayer({ + // id: 'points', + // source: 'data', + // type: 'symbol', + // layout: { + // "icon-image": 'custom-marker' + // }, + // }); + // } + // ); }; var addMarkersLayers = function addMarkersLayers() { @@ -2804,7 +2999,7 @@ var leafletMap = function leafletMap(services) { // To draw a circle overlay with a radius in meters, use L.circle() return L.circleMarker(latlng, { radius: feature.properties.radius || 10 }); } else { - var marker = __webpack_require__(80); //L.marker(feature); + var marker = __webpack_require__(85); //L.marker(feature); return marker.style(feature, latlng, { accessToken: activeProvider.accessToken }); } } @@ -2824,8 +3019,12 @@ var leafletMap = function leafletMap(services) { map.getSource('data').setData(geojson); + markerGl.forEach(function (item, index) { + item.remove(); + }); + var markerGlColl = (0, _markerGLCollection2.default)(services); - markerGlColl.initialize({ map: map, geojson: geojson, editable: editable }); + markerGlColl.initialize({ map: map, geojson: geojson, markerGl: markerGl, editable: editable }); if (geojson.features.length > 0) { shouldUpdateZoom = true; @@ -2859,7 +3058,6 @@ var leafletMap = function leafletMap(services) { position.lng = featureLayer.getGeoJSON()[0].geometry.coordinates[0]; position.lat = featureLayer.getGeoJSON()[0].geometry.coordinates[1]; updateMarkerPosition(featureLayer.getGeoJSON()[0].properties.recordIndex, position); - console.log('ato'); } else { // set default position shouldUpdateZoom = false; @@ -2891,6 +3089,7 @@ var leafletMap = function leafletMap(services) { coordinates: poiCoords }, properties: { + _rid: poi._rid, recordIndex: poiIndex, 'marker-color': '0c4554', 'marker-zoom': currentZoomLevel, @@ -3110,7 +3309,7 @@ var leafletMap = function leafletMap(services) { exports.default = leafletMap; /***/ }), -/* 51 */ +/* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3226,12 +3425,12 @@ var FieldCollection = function () { exports.default = FieldCollection; /***/ }), -/* 52 */, -/* 53 */, /* 54 */, /* 55 */, /* 56 */, -/* 57 */ +/* 57 */, +/* 58 */, +/* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3251,7 +3450,7 @@ var _dialog2 = _interopRequireDefault(_dialog); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var lazyload = __webpack_require__(58); +var lazyload = __webpack_require__(60); var publication = function publication(services) { @@ -3694,7 +3893,7 @@ var publication = function publication(services) { exports.default = publication; /***/ }), -/* 58 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*** IMPORTS FROM imports-loader ***/ @@ -3947,7 +4146,7 @@ exports.default = publication; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 59 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ @@ -4172,7 +4371,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ /***/ }), -/* 60 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4194,10 +4393,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(97); +__webpack_require__(103); -__webpack_require__(37); -__webpack_require__(98); +__webpack_require__(38); +__webpack_require__(104); var workzoneFacets = function workzoneFacets(services) { @@ -4715,7 +4914,7 @@ var workzoneFacets = function workzoneFacets(services) { exports.default = workzoneFacets; /***/ }), -/* 61 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4729,7 +4928,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _index = __webpack_require__(112); +var _index = __webpack_require__(118); var _index2 = _interopRequireDefault(_index); @@ -4895,16 +5094,16 @@ var editRecord = function editRecord(services) { exports.default = editRecord; /***/ }), -/* 62 */ +/* 64 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_video_js__ = __webpack_require__(118); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_video_js__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_video_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_video_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_videojs_swf_package_json__ = __webpack_require__(142); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_videojs_swf_package_json__ = __webpack_require__(147); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_videojs_swf_package_json___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_videojs_swf_package_json__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_global_window__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_global_window__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_global_window___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_global_window__); @@ -6354,13 +6553,13 @@ Flash.VERSION = version$1; /***/ }), -/* 63 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var keys = __webpack_require__(124); +var keys = __webpack_require__(130); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; @@ -6419,14 +6618,14 @@ module.exports = defineProperties; /***/ }), -/* 64 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bind = __webpack_require__(48); -var ES = __webpack_require__(126); +var bind = __webpack_require__(50); +var ES = __webpack_require__(132); var replace = bind.call(Function.call, String.prototype.replace); var leftWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/; @@ -6439,13 +6638,13 @@ module.exports = function trim() { /***/ }), -/* 65 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var implementation = __webpack_require__(64); +var implementation = __webpack_require__(66); var zeroWidthSpace = '\u200b'; @@ -6458,7 +6657,7 @@ module.exports = function getPolyfill() { /***/ }), -/* 66 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { /* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v1.11.0/LICENSE.txt */ @@ -6506,7 +6705,142 @@ return mapboxgl; /***/ }), -/* 67 */ +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var browser = __webpack_require__(162); +var MapiClient = __webpack_require__(70); + +function BrowserClient(options) { + MapiClient.call(this, options); +} +BrowserClient.prototype = Object.create(MapiClient.prototype); +BrowserClient.prototype.constructor = BrowserClient; + +BrowserClient.prototype.sendRequest = browser.browserSend; +BrowserClient.prototype.abortRequest = browser.browserAbort; + +/** + * Create a client for the browser. + * + * @param {Object} options + * @param {string} options.accessToken + * @param {string} [options.origin] + * @returns {MapiClient} + */ +function createBrowserClient(options) { + return new BrowserClient(options); +} + +module.exports = createBrowserClient; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var parseToken = __webpack_require__(71); +var MapiRequest = __webpack_require__(168); +var constants = __webpack_require__(45); + +/** + * A low-level Mapbox API client. Use it to create service clients + * that share the same configuration. + * + * Services and `MapiRequest`s use the underlying `MapiClient` to + * determine how to create, send, and abort requests in a way + * that is appropriate to the configuration and environment + * (Node or the browser). + * + * @class MapiClient + * @property {string} accessToken - The Mapbox access token assigned + * to this client. + * @property {string} [origin] - The origin + * to use for API requests. Defaults to https://api.mapbox.com. + */ + +function MapiClient(options) { + if (!options || !options.accessToken) { + throw new Error('Cannot create a client without an access token'); + } + // Try parsing the access token to determine right away if it's valid. + parseToken(options.accessToken); + + this.accessToken = options.accessToken; + this.origin = options.origin || constants.API_ORIGIN; +} + +MapiClient.prototype.createRequest = function createRequest(requestOptions) { + return new MapiRequest(this, requestOptions); +}; + +module.exports = MapiClient; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var base64 = __webpack_require__(167); + +var tokenCache = {}; + +function parseToken(token) { + if (tokenCache[token]) { + return tokenCache[token]; + } + + var parts = token.split('.'); + var usage = parts[0]; + var rawPayload = parts[1]; + if (!rawPayload) { + throw new Error('Invalid token'); + } + + var parsedPayload = parsePaylod(rawPayload); + + var result = { + usage: usage, + user: parsedPayload.u + }; + if (has(parsedPayload, 'a')) result.authorization = parsedPayload.a; + if (has(parsedPayload, 'exp')) result.expires = parsedPayload.exp * 1000; + if (has(parsedPayload, 'iat')) result.created = parsedPayload.iat * 1000; + if (has(parsedPayload, 'scopes')) result.scopes = parsedPayload.scopes; + if (has(parsedPayload, 'client')) result.client = parsedPayload.client; + if (has(parsedPayload, 'll')) result.lastLogin = parsedPayload.ll; + if (has(parsedPayload, 'iu')) result.impersonator = parsedPayload.iu; + + tokenCache[token] = result; + return result; +} + +function parsePaylod(rawPayload) { + try { + return JSON.parse(base64.decode(rawPayload)); + } catch (parseError) { + throw new Error('Invalid token'); + } +} + +function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +module.exports = parseToken; + + +/***/ }), +/* 72 */ /***/ (function(module, exports) { module.exports = function escape(url) { @@ -6528,7 +6862,7 @@ module.exports = function escape(url) { /***/ }), -/* 68 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6548,7 +6882,7 @@ var _dialog2 = _interopRequireDefault(_dialog); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var exportRecord = function exportRecord(services) { var configService = services.configService, @@ -6946,7 +7280,7 @@ var exportRecord = function exportRecord(services) { exports.default = exportRecord; /***/ }), -/* 69 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6960,11 +7294,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _feedback = __webpack_require__(171); +var _feedback = __webpack_require__(207); var _feedback2 = _interopRequireDefault(_feedback); -var _listManager = __webpack_require__(172); +var _listManager = __webpack_require__(208); var _listManager2 = _interopRequireDefault(_listManager); @@ -7074,7 +7408,7 @@ var pushRecord = function pushRecord(services) { exports.default = pushRecord; /***/ }), -/* 70 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7091,7 +7425,7 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var Lists = function Lists() {}; @@ -7289,7 +7623,7 @@ exports.Lists = Lists; exports.List = List; /***/ }), -/* 71 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7322,7 +7656,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /** * triggered via workzone > Basket > context menu */ -__webpack_require__(38); +__webpack_require__(39); var pushAddUser = function pushAddUser(services) { var configService = services.configService, @@ -7463,7 +7797,7 @@ var pushAddUser = function pushAddUser(services) { exports.default = pushAddUser; /***/ }), -/* 72 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7554,7 +7888,7 @@ var printRecord = function printRecord(services) { exports.default = printRecord; /***/ }), -/* 73 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7572,15 +7906,15 @@ var _dialog = __webpack_require__(1); var _dialog2 = _interopRequireDefault(_dialog); -var _videoScreenCapture = __webpack_require__(181); +var _videoScreenCapture = __webpack_require__(217); var _videoScreenCapture2 = _interopRequireDefault(_videoScreenCapture); -var _videoRangeCapture = __webpack_require__(184); +var _videoRangeCapture = __webpack_require__(220); var _videoRangeCapture2 = _interopRequireDefault(_videoRangeCapture); -var _videoSubtitleCapture = __webpack_require__(185); +var _videoSubtitleCapture = __webpack_require__(221); var _videoSubtitleCapture2 = _interopRequireDefault(_videoSubtitleCapture); @@ -7592,10 +7926,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(186); +__webpack_require__(222); -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var recordVideoEditorModal = function recordVideoEditorModal(services, datas) { var activeTab = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; @@ -7683,8 +8017,8 @@ var recordVideoEditorModal = function recordVideoEditorModal(services, datas) { exports.default = recordVideoEditorModal; /***/ }), -/* 74 */, -/* 75 */ +/* 79 */, +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7698,7 +8032,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _orderItem = __webpack_require__(195); +var _orderItem = __webpack_require__(231); var _orderItem2 = _interopRequireDefault(_orderItem); @@ -7943,7 +8277,7 @@ var order = function order(services) { exports.default = order; /***/ }), -/* 76 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8052,7 +8386,7 @@ var resultInfos = function resultInfos(services) { exports.default = resultInfos; /***/ }), -/* 77 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8104,10 +8438,10 @@ module.exports = { /***/ }), -/* 78 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { -var html_sanitize = __webpack_require__(164); +var html_sanitize = __webpack_require__(200); module.exports = function(_) { if (!_) return ''; @@ -8128,14 +8462,14 @@ function cleanId(id) { return id; } /***/ }), -/* 79 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var config = __webpack_require__(81), - version = __webpack_require__(82).version; +var config = __webpack_require__(86), + version = __webpack_require__(87).version; module.exports = function(path, accessToken) { accessToken = accessToken || L.mapbox.accessToken; @@ -8195,15 +8529,15 @@ module.exports.style = function(styleURL, accessToken) { /***/ }), -/* 80 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var format_url = __webpack_require__(79), - util = __webpack_require__(77), - sanitize = __webpack_require__(78); +var format_url = __webpack_require__(84), + util = __webpack_require__(82), + sanitize = __webpack_require__(83); // mapbox-related markers functionality // provide an icon from mapbox's simple-style spec and hosted markers @@ -8267,7 +8601,7 @@ module.exports = { /***/ }), -/* 81 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8282,18 +8616,18 @@ module.exports = { /***/ }), -/* 82 */ +/* 87 */ /***/ (function(module, exports) { module.exports = {"_args":[["mapbox.js@2.4.0","/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client"]],"_from":"mapbox.js@2.4.0","_id":"mapbox.js@2.4.0","_inBundle":false,"_integrity":"sha1-xDsISl3XEzTIPuHfKPpnRD1zwpw=","_location":"/mapbox.js","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"mapbox.js@2.4.0","name":"mapbox.js","escapedName":"mapbox.js","rawSpec":"2.4.0","saveSpec":null,"fetchSpec":"2.4.0"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/mapbox.js/-/mapbox.js-2.4.0.tgz","_spec":"2.4.0","_where":"/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client","author":{"name":"Mapbox"},"bugs":{"url":"https://github.com/mapbox/mapbox.js/issues"},"dependencies":{"corslite":"0.0.6","isarray":"0.0.1","leaflet":"0.7.7","mustache":"2.2.1","sanitize-caja":"0.1.3"},"description":"mapbox javascript api","devDependencies":{"browserify":"^13.0.0","clean-css":"~2.0.7","eslint":"^0.23.0","expect.js":"0.3.1","happen":"0.1.3","leaflet-fullscreen":"0.0.4","leaflet-hash":"0.2.1","marked":"~0.3.0","minifyify":"^6.1.0","minimist":"0.0.5","mocha":"2.4.5","mocha-phantomjs":"4.0.2","sinon":"1.10.2"},"engines":{"node":"*"},"homepage":"http://mapbox.com/","license":"BSD-3-Clause","main":"src/index.js","name":"mapbox.js","optionalDependencies":{},"repository":{"type":"git","url":"git://github.com/mapbox/mapbox.js.git"},"scripts":{"test":"eslint --no-eslintrc -c .eslintrc src && mocha-phantomjs test/index.html"},"version":"2.4.0"} /***/ }), -/* 83 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var topLevel = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {} -var minDoc = __webpack_require__(119); +var minDoc = __webpack_require__(125); var doccy; @@ -8309,10 +8643,10 @@ if (typeof document !== 'undefined') { module.exports = doccy; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), -/* 84 */ +/* 89 */ /***/ (function(module, exports) { function clean (s) { @@ -8331,7 +8665,7 @@ module.exports = function tsml (sa) { } /***/ }), -/* 85 */ +/* 90 */ /***/ (function(module, exports) { module.exports = SafeParseTuple @@ -8351,15 +8685,15 @@ function SafeParseTuple(obj, reviver) { /***/ }), -/* 86 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var window = __webpack_require__(43) -var isFunction = __webpack_require__(120) -var parseHeaders = __webpack_require__(121) -var xtend = __webpack_require__(137) +var window = __webpack_require__(44) +var isFunction = __webpack_require__(126) +var parseHeaders = __webpack_require__(127) +var xtend = __webpack_require__(37) module.exports = createXHR createXHR.XMLHttpRequest = window.XMLHttpRequest || noop @@ -8599,9 +8933,317 @@ function noop() {} /***/ }), -/* 87 */, -/* 88 */, -/* 89 */ +/* 92 */, +/* 93 */ +/***/ (function(module, exports) { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; + } + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + + +/***/ }), +/* 94 */, +/* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8611,11 +9253,11 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _utils = __webpack_require__(39); +var _utils = __webpack_require__(42); var utils = _interopRequireWildcard(_utils); -var _bootstrap = __webpack_require__(92); +var _bootstrap = __webpack_require__(98); var _bootstrap2 = _interopRequireDefault(_bootstrap); @@ -8623,14 +9265,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(209); +__webpack_require__(245); -__webpack_require__(210); -__webpack_require__(211); -__webpack_require__(212); -__webpack_require__(213); -__webpack_require__(214); -__webpack_require__(215); +__webpack_require__(246); +__webpack_require__(247); +__webpack_require__(248); +__webpack_require__(249); +__webpack_require__(250); +__webpack_require__(251); _jquery2.default.widget.bridge('uitooltip', _jquery2.default.fn.tooltip); //window.btn = $.fn.button.noConflict(); // reverts $.fn.button to jqueryui btn @@ -8647,7 +9289,7 @@ if (typeof window !== 'undefined') { module.exports = ProductionApplication; /***/ }), -/* 90 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8704,7 +9346,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /* eslint-disable semi*/ /* eslint-disable no-loop-func*/ -var cookie = __webpack_require__(91); +var cookie = __webpack_require__(97); var initialize = function initialize() { // $(document).ready(function () { @@ -8799,7 +9441,7 @@ exports.default = { }; /***/ }), -/* 91 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -8972,7 +9614,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! /***/ }), -/* 92 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8992,15 +9634,15 @@ var _phraseanetCommon = __webpack_require__(11); var AppCommons = _interopRequireWildcard(_phraseanetCommon); -var _publication = __webpack_require__(57); +var _publication = __webpack_require__(59); var _publication2 = _interopRequireDefault(_publication); -var _workzone = __webpack_require__(93); +var _workzone = __webpack_require__(99); var _workzone2 = _interopRequireDefault(_workzone); -var _index = __webpack_require__(46); +var _index = __webpack_require__(48); var _index2 = _interopRequireDefault(_index); @@ -9008,7 +9650,7 @@ var _locale = __webpack_require__(20); var _locale2 = _interopRequireDefault(_locale); -var _ui = __webpack_require__(47); +var _ui = __webpack_require__(49); var _ui2 = _interopRequireDefault(_ui); @@ -9020,7 +9662,7 @@ var _i18next = __webpack_require__(21); var _i18next2 = _interopRequireDefault(_i18next); -var _config = __webpack_require__(201); +var _config = __webpack_require__(237); var _config2 = _interopRequireDefault(_config); @@ -9028,19 +9670,19 @@ var _emitter = __webpack_require__(15); var _emitter2 = _interopRequireDefault(_emitter); -var _user = __webpack_require__(202); +var _user = __webpack_require__(238); var _user2 = _interopRequireDefault(_user); -var _basket = __webpack_require__(203); +var _basket = __webpack_require__(239); var _basket2 = _interopRequireDefault(_basket); -var _search = __webpack_require__(204); +var _search = __webpack_require__(240); var _search2 = _interopRequireDefault(_search); -var _utils = __webpack_require__(39); +var _utils = __webpack_require__(42); var _utils2 = _interopRequireDefault(_utils); @@ -9058,8 +9700,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var humane = __webpack_require__(8); -__webpack_require__(208); +var humane = __webpack_require__(9); +__webpack_require__(244); var Bootstrap = function () { function Bootstrap(userConfig) { @@ -9336,7 +9978,7 @@ var bootstrap = function bootstrap(userConfig) { exports.default = bootstrap; /***/ }), -/* 93 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9354,15 +9996,15 @@ var _phraseanetCommon = __webpack_require__(11); var appCommons = _interopRequireWildcard(_phraseanetCommon); -var _index = __webpack_require__(94); +var _index = __webpack_require__(100); var _index2 = _interopRequireDefault(_index); -var _index3 = __webpack_require__(60); +var _index3 = __webpack_require__(62); var _index4 = _interopRequireDefault(_index3); -var _index5 = __webpack_require__(99); +var _index5 = __webpack_require__(105); var _index6 = _interopRequireDefault(_index5); @@ -9370,15 +10012,19 @@ var _selectable = __webpack_require__(23); var _selectable2 = _interopRequireDefault(_selectable); -var _alert = __webpack_require__(44); +var _alert = __webpack_require__(46); var _alert2 = _interopRequireDefault(_alert); +var _dialog = __webpack_require__(1); + +var _dialog2 = _interopRequireDefault(_dialog); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); __webpack_require__(14); __webpack_require__(19); @@ -9397,9 +10043,26 @@ var workzone = function workzone(services) { var nextBasketScroll = false; var warnOnRemove = true; var $container = void 0; + var dragBloc = (0, _jquery2.default)('#basket-tab').val(); + + function checkActiveBloc(destBloc) { + + if (document.getElementById('expose_tab') && document.getElementById('expose_tab').getAttribute('aria-expanded') == 'true') { + (0, _jquery2.default)('#basket-tab').val('#expose_tab'); + } + if (document.getElementById('baskets') && document.getElementById('baskets').getAttribute('aria-expanded') == 'true') { + (0, _jquery2.default)('#basket-tab').val('#baskets'); + } + + var destBloc = (0, _jquery2.default)('#basket-tab').val(); + console.log(destBloc); + return destBloc; + } + checkActiveBloc(dragBloc); var initialize = function initialize() { $container = (0, _jquery2.default)('#idFrameC'); + checkActiveBloc(dragBloc); $container.resizable({ handles: 'e', @@ -9439,13 +10102,43 @@ var workzone = function workzone(services) { } }); + (0, _jquery2.default)('#idFrameC .expose_li').on('click', function (event) { + checkActiveBloc(dragBloc); + }); + + (0, _jquery2.default)('.add_publication').on('click', function (event) { + openExposePublicationAdd((0, _jquery2.default)('#expose_list').val()); + }); + + (0, _jquery2.default)('.refresh-list').on('click', function (event) { + var exposeName = (0, _jquery2.default)('#expose_list').val(); + (0, _jquery2.default)('.publication-list').empty().html('loading'); + updatePublicationList(exposeName); + }); + + (0, _jquery2.default)('.display-list').on('click', function (event) { + var exposeName = (0, _jquery2.default)('#expose_list').val(); + (0, _jquery2.default)('.publication-list').empty().html('loading'); + updatePublicationList(exposeName); + }); + + (0, _jquery2.default)('#expose_list').on('change', function () { + (0, _jquery2.default)('.publication-list').empty().html('loading'); + updatePublicationList(this.value); + }); + + (0, _jquery2.default)('.publication-list').on('click', '.top-block', function (event) { + (0, _jquery2.default)(this).parent().find('.expose_item_deployed').toggleClass('open'); + (0, _jquery2.default)(this).toggleClass('open'); + }); + (0, _jquery2.default)('#idFrameC .ui-tabs-nav li').on('click', function (event) { if ($container.attr('data-status') === 'closed') { (0, _jquery2.default)('#retractableButton').find('i').removeClass('fa-angle-double-right').addClass('fa-angle-double-left'); $container.width(360); (0, _jquery2.default)('#rightFrame').css('left', 360); (0, _jquery2.default)('#rightFrame').width((0, _jquery2.default)(window).width() - 360); - (0, _jquery2.default)('#baskets, #proposals, #thesaurus_tab').hide(); + (0, _jquery2.default)('#baskets, #expose_tab, #proposals, #thesaurus_tab').hide(); (0, _jquery2.default)('.ui-resizable-handle, #basket_menu_trigger').show(); var IDname = (0, _jquery2.default)(this).attr('aria-controls'); (0, _jquery2.default)('#' + IDname).show(); @@ -9466,7 +10159,7 @@ var workzone = function workzone(services) { (0, _jquery2.default)('#rightFrame').css('left', 80); (0, _jquery2.default)('#rightFrame').width((0, _jquery2.default)(window).width() - 80); $container.attr('data-status', 'closed'); - (0, _jquery2.default)('#baskets, #proposals, #thesaurus_tab, .ui-resizable-handle, #basket_menu_trigger').hide(); + (0, _jquery2.default)('#baskets, #expose_tab, #proposals, #thesaurus_tab, .ui-resizable-handle, #basket_menu_trigger').hide(); (0, _jquery2.default)('#idFrameC .ui-tabs-nav li').removeClass('ui-state-active'); (0, _jquery2.default)('.WZbasketTab').css('background-position', '15px 16px'); $container.addClass('closed'); @@ -9595,6 +10288,7 @@ var workzone = function workzone(services) { } }; filterBaskets(); + (0, _jquery2.default)('#expose_tabs').tabs(); }; var getResultSelectionStream = function getResultSelectionStream() { @@ -9897,6 +10591,213 @@ var workzone = function workzone(services) { }); } + function activeExpose() { + var idFrameC = (0, _jquery2.default)('#idFrameC'); + + // drop on publication + idFrameC.find('.publication-droppable').droppable({ + scope: 'objects', + hoverClass: 'baskDrop', + tolerance: 'pointer', + accept: function accept(elem) { + if ((0, _jquery2.default)(elem).hasClass('CHIM')) { + if ((0, _jquery2.default)(elem).closest('.content').prev()[0] === (0, _jquery2.default)(this)[0]) { + return false; + } + } + if ((0, _jquery2.default)(elem).hasClass('grouping') || (0, _jquery2.default)(elem).parent()[0] === (0, _jquery2.default)(this)[0]) { + return false; + } + return true; + }, + drop: function drop(event, ui) { + dropOnBask(event, ui.draggable, (0, _jquery2.default)(this)); + } + }); + + // delete an asset from publication + idFrameC.find('.publication-droppable').on('click', '.removeAsset', function () { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var assetId = (0, _jquery2.default)(this).attr('data-asset-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed'); + + var buttons = {}; + + var $dialog = _dialog2.default.create(services, { + size: '480x160', + title: localeService.t('warning') + }); + + buttons[localeService.t('valider')] = function () { + $dialog.setContent('loading'); + + _jquery2.default.ajax({ + type: 'POST', + url: '/prod/expose/publication/delete-asset/' + publicationId + '/' + assetId + '/?exposeName=' + exposeName, + beforeSend: function beforeSend() { + assetsContainer.addClass('loading'); + }, + success: function success(data) { + if (data.success === true) { + $dialog.close(); + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + } else { + $dialog.setContent(data.message); + console.log(data); + } + } + }); + }; + + buttons[localeService.t('annuler')] = function () { + $dialog.close(); + }; + + var texte = '

' + localeService.t('removeAssetPublication') + '

'; + + $dialog.setOption('buttons', buttons); + $dialog.setContent(texte); + }); + + idFrameC.find('.publication-droppable').on('click', '.edit_expose', function (event) { + openExposePublicationEdit((0, _jquery2.default)(this)); + }); + + // delete a publication + idFrameC.find('.publication-droppable').on('click', '.delete-publication', function () { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var buttons = {}; + + var $dialog = _dialog2.default.create(services, { + size: '480x160', + title: localeService.t('warning') + }); + + buttons[localeService.t('valider')] = function () { + $dialog.setContent('loading'); + _jquery2.default.ajax({ + type: 'POST', + url: '/prod/expose/delete-publication/' + publicationId + '/?exposeName=' + exposeName, + success: function success(data) { + if (data.success === true) { + $dialog.close(); + updatePublicationList(exposeName); + } else { + $dialog.setContent(data.message); + console.log(data); + } + } + }); + }; + + buttons[localeService.t('annuler')] = function () { + $dialog.close(); + }; + + var texte = '

' + localeService.t('removeExposePublication') + '

'; + + $dialog.setOption('buttons', buttons); + $dialog.setContent(texte); + }); + + // refresh publication content + idFrameC.find('.publication-droppable').on('click', '.refresh-publication', function () { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed'); + + assetsContainer.empty().addClass('loading'); + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + }); + + // set publication cover + idFrameC.find('.publication-droppable').on('click', '.set-cover', function () { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var assetId = (0, _jquery2.default)(this).attr('data-asset-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var publicationData = JSON.stringify({ "cover": '/assets/' + assetId }, undefined, 4); + + _jquery2.default.ajax({ + type: "PUT", + url: '/prod/expose/update-publication/' + publicationId, + dataType: 'json', + data: { + exposeName: '' + exposeName, + publicationData: publicationData + }, + success: function success(data) { + if (data.success) { + updatePublicationList(exposeName); + } else { + console.log(data.message); + } + } + }); + }); + + // load more asset and append it at the end + idFrameC.find('.publication-droppable').on('click', '.load_more_asset', function () { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_bottom').find('.expose_drag_drop'); + var page = assetsContainer.find('#list_assets_page').val(); + + (0, _jquery2.default)(this).find('.loading_more').removeClass('hidden'); + getPublicationAssetsList(publicationId, exposeName, assetsContainer, parseInt(page) + 1); + }); + } + + function updatePublicationList(exposeName) { + _jquery2.default.ajax({ + type: 'GET', + url: '/prod/expose/list-publication/?exposeName=' + exposeName, + success: function success(data) { + (0, _jquery2.default)('.publication-list').empty().html(data); + + (0, _jquery2.default)('.expose_basket_item .top_block').on('click', function (event) { + (0, _jquery2.default)(this).parent().find('.expose_item_deployed').toggleClass('open'); + (0, _jquery2.default)(this).toggleClass('open'); + + if ((0, _jquery2.default)(this).hasClass('open')) { + var publicationId = (0, _jquery2.default)(this).attr('data-publication-id'); + var _exposeName = (0, _jquery2.default)('#expose_list').val(); + var assetsContainer = (0, _jquery2.default)(this).parents('.expose_basket_item').find('.expose_item_deployed'); + + assetsContainer.addClass('loading'); + getPublicationAssetsList(publicationId, _exposeName, assetsContainer, 1); + } + }); + + activeExpose(); + } + }); + } + + function getPublicationAssetsList(publicationId, exposeName, assetsContainer) { + var page = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + _jquery2.default.ajax({ + type: 'GET', + url: '/prod/expose/get-publication/' + publicationId + '/assets?exposeName=' + exposeName + '&page=' + page, + success: function success(data) { + if (typeof data.success === 'undefined') { + if (page === 1) { + assetsContainer.removeClass('loading'); + assetsContainer.empty().html(data); + } else { + assetsContainer.append(data); + assetsContainer.parents('.expose_item_bottom').find('.loading_more').addClass('hidden'); + assetsContainer.find('#list_assets_page').val(page); + } + } else { + console.log(data); + } + } + }); + } + function getContent(header, order) { if (window.console) { console.log('Reload content for ', header); @@ -10009,7 +10910,87 @@ var workzone = function workzone(services) { }); } + function openExposePublicationAdd(exposeName) { + (0, _jquery2.default)('#DIALOG-expose-add').attr('title', localeService.t('Edit expose title')).dialog({ + autoOpen: false, + closeOnEscape: true, + resizable: true, + draggable: true, + width: 900, + height: 575, + modal: true, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + }, + close: function close(e, ui) {} + }).dialog('open'); + (0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog'); + (0, _jquery2.default)('#DIALOG-expose-add').on('click', '.close-expose-modal', function () { + (0, _jquery2.default)('#DIALOG-expose-add').dialog('close'); + }); + + _jquery2.default.ajax({ + type: "GET", + url: '/prod/expose/list-publication/?format=json&exposeName=' + exposeName, + success: function success(data) { + (0, _jquery2.default)('#DIALOG-expose-add #publication_parent').empty().html(''); + var i = 0; + for (; i < data.publications.length; i++) { + (0, _jquery2.default)('#DIALOG-expose-add select#publication_parent').append(''); + } + } + }); + + _jquery2.default.ajax({ + type: "GET", + url: '/prod/expose/list-profile?exposeName=' + exposeName, + success: function success(data) { + (0, _jquery2.default)('#DIALOG-expose-add select#profile-field').empty().html('');; + var i = 0; + for (; i < data.profiles.length; i++) { + (0, _jquery2.default)('select#profile-field').append(''); + } + } + }); + } + + function openExposePublicationEdit(edit) { + (0, _jquery2.default)('#DIALOG-expose-edit').empty().html('loading'); + + (0, _jquery2.default)('#DIALOG-expose-edit').attr('title', localeService.t('Edit expose title')).dialog({ + autoOpen: false, + closeOnEscape: true, + resizable: true, + draggable: true, + width: 900, + height: 575, + modal: true, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + }, + close: function close(e, ui) { + (0, _jquery2.default)('#DIALOG-expose-edit').empty(); + } + }).dialog('open'); + (0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog'); + (0, _jquery2.default)('#DIALOG-expose-edit').on('click', '.close-expose-modal', function () { + (0, _jquery2.default)('#DIALOG-expose-edit').dialog('close'); + }); + + _jquery2.default.ajax({ + type: "GET", + url: '/prod/expose/get-publication/' + edit.data("id") + '?exposeName=' + (0, _jquery2.default)("#expose_list").val(), + success: function success(data) { + (0, _jquery2.default)('#DIALOG-expose-edit').empty().html(data); + } + }); + } + function dropOnBask(event, from, destKey, singleSelection) { + checkActiveBloc(dragBloc); + var action = ''; var dest_uri = ''; var lstbr = []; @@ -10109,31 +11090,60 @@ var workzone = function workzone(services) { return false; } - if (window.console) { - window.console.log('About to execute ajax POST on ', url, ' with datas ', data); - } + //save basket after drop elt + if ((0, _jquery2.default)('#basket-tab').val() === '#baskets') { - _jquery2.default.ajax({ - type: 'POST', - url: url, - data: data, - dataType: 'json', - beforeSend: function beforeSend() {}, - success: function success(data) { - if (!data.success) { - humane.error(data.message); - } else { - humane.info(data.message); - } - if (act === 'MOV' || (0, _jquery2.default)(destKey).next().is(':visible') === true || (0, _jquery2.default)(destKey).hasClass('content') === true) { - (0, _jquery2.default)('.CHIM.selected:visible').fadeOut(); - workzoneOptions.selection.empty(); - return workzoneOptions.reloadCurrent(); - } - - return true; + if (window.console) { + window.console.log('About to execute ajax POST on ', url, ' with datas ', data); } - }); + + _jquery2.default.ajax({ + type: 'POST', + url: url, + data: data, + dataType: 'json', + beforeSend: function beforeSend() {}, + success: function success(data) { + if (!data.success) { + humane.error(data.message); + } else { + humane.info(data.message); + } + if (act === 'MOV' || (0, _jquery2.default)(destKey).next().is(':visible') === true || (0, _jquery2.default)(destKey).hasClass('content') === true) { + (0, _jquery2.default)('.CHIM.selected:visible').fadeOut(); + workzoneOptions.selection.empty(); + return workzoneOptions.reloadCurrent(); + } + + return true; + } + }); + } else { + console.log(data.lst); + + var publicationId = destKey.attr('data-publication-id'); + var exposeName = (0, _jquery2.default)('#expose_list').val(); + var assetsContainer = destKey.find('.expose_item_deployed'); + assetsContainer.empty().addClass('loading'); + + _jquery2.default.ajax({ + type: 'POST', + url: '/prod/expose/publication/add-assets', + data: { + publicationId: publicationId, + exposeName: exposeName, + lst: data.lst + }, + dataType: 'json', + success: function success(data) { + setTimeout(function () { + getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1); + }, 6000); + + console.log(data.message); + } + }); + } } function fix() { @@ -10207,7 +11217,7 @@ var workzone = function workzone(services) { exports.default = workzone; /***/ }), -/* 94 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10221,13 +11231,13 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _index = __webpack_require__(95); +var _index = __webpack_require__(101); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(96); +__webpack_require__(102); var workzoneThesaurus = function workzoneThesaurus(services) { var configService = services.configService, @@ -10274,7 +11284,7 @@ var workzoneThesaurus = function workzoneThesaurus(services) { exports.default = workzoneThesaurus; /***/ }), -/* 95 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10292,7 +11302,7 @@ var _underscore = __webpack_require__(2); var _underscore2 = _interopRequireDefault(_underscore); -var _sprintfJs = __webpack_require__(59); +var _sprintfJs = __webpack_require__(61); var _phraseanetCommon = __webpack_require__(11); @@ -11497,19 +12507,19 @@ var thesaurusService = function thesaurusService(services) { exports.default = thesaurusService; /***/ }), -/* 96 */ +/* 102 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 97 */ +/* 103 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 98 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(jQuery) {/*! @@ -15856,7 +16866,7 @@ $.extend($.ui.fancytree, /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 99 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15870,35 +16880,35 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _delete = __webpack_require__(100); +var _delete = __webpack_require__(106); var _delete2 = _interopRequireDefault(_delete); -var _archive = __webpack_require__(101); +var _archive = __webpack_require__(107); var _archive2 = _interopRequireDefault(_archive); -var _create = __webpack_require__(102); +var _create = __webpack_require__(108); var _create2 = _interopRequireDefault(_create); -var _create3 = __webpack_require__(103); +var _create3 = __webpack_require__(109); var _create4 = _interopRequireDefault(_create3); -var _update = __webpack_require__(104); +var _update = __webpack_require__(110); var _update2 = _interopRequireDefault(_update); -var _browse = __webpack_require__(105); +var _browse = __webpack_require__(111); var _browse2 = _interopRequireDefault(_browse); -var _reorderContent = __webpack_require__(106); +var _reorderContent = __webpack_require__(112); var _reorderContent2 = _interopRequireDefault(_reorderContent); -var _reorderContent3 = __webpack_require__(107); +var _reorderContent3 = __webpack_require__(113); var _reorderContent4 = _interopRequireDefault(_reorderContent3); @@ -15971,7 +16981,7 @@ var workzoneBaskets = function workzoneBaskets(services) { exports.default = workzoneBaskets; /***/ }), -/* 100 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16109,7 +17119,7 @@ var deleteBasket = function deleteBasket(services) { exports.default = deleteBasket; /***/ }), -/* 101 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16181,7 +17191,7 @@ var archiveBasket = function archiveBasket(services) { exports.default = archiveBasket; /***/ }), -/* 102 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16304,7 +17314,7 @@ var basketCreate = function basketCreate(services) { exports.default = basketCreate; /***/ }), -/* 103 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16430,7 +17440,7 @@ var storyCreate = function storyCreate(services) { exports.default = storyCreate; /***/ }), -/* 104 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16454,7 +17464,7 @@ var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); /** +var humane = __webpack_require__(9); /** * triggered via workzone > Basket > context menu */ @@ -16547,7 +17557,7 @@ var basketUpdate = function basketUpdate(services) { exports.default = basketUpdate; /***/ }), -/* 105 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -16573,7 +17583,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de __webpack_require__(14); -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var basketBrowse = function basketBrowse(services) { var configService = services.configService, @@ -16850,7 +17860,7 @@ var basketBrowse = function basketBrowse(services) { exports.default = basketBrowse; /***/ }), -/* 106 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17134,7 +18144,7 @@ var basketReorderContent = function basketReorderContent(services) { exports.default = basketReorderContent; /***/ }), -/* 107 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17418,7 +18428,7 @@ var storyReorderContent = function storyReorderContent(services) { exports.default = storyReorderContent; /***/ }), -/* 108 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17666,7 +18676,7 @@ var notifyLayout = function notifyLayout(services) { exports.default = notifyLayout; /***/ }), -/* 109 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17729,7 +18739,7 @@ var notifyService = function notifyService(services) { exports.default = notifyService; /***/ }), -/* 110 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -17743,51 +18753,51 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _move = __webpack_require__(111); +var _move = __webpack_require__(117); var _move2 = _interopRequireDefault(_move); -var _edit = __webpack_require__(61); +var _edit = __webpack_require__(63); var _edit2 = _interopRequireDefault(_edit); -var _delete = __webpack_require__(168); +var _delete = __webpack_require__(204); var _delete2 = _interopRequireDefault(_delete); -var _export = __webpack_require__(68); +var _export = __webpack_require__(73); var _export2 = _interopRequireDefault(_export); -var _property = __webpack_require__(169); +var _property = __webpack_require__(205); var _property2 = _interopRequireDefault(_property); -var _push = __webpack_require__(170); +var _push = __webpack_require__(206); var _push2 = _interopRequireDefault(_push); -var _publish = __webpack_require__(175); +var _publish = __webpack_require__(211); var _publish2 = _interopRequireDefault(_publish); -var _index = __webpack_require__(176); +var _index = __webpack_require__(212); var _index2 = _interopRequireDefault(_index); -var _print = __webpack_require__(72); +var _print = __webpack_require__(77); var _print2 = _interopRequireDefault(_print); -var _feedback = __webpack_require__(178); +var _feedback = __webpack_require__(214); var _feedback2 = _interopRequireDefault(_feedback); -var _bridge = __webpack_require__(179); +var _bridge = __webpack_require__(215); var _bridge2 = _interopRequireDefault(_bridge); -var _index3 = __webpack_require__(73); +var _index3 = __webpack_require__(78); var _index4 = _interopRequireDefault(_index3); @@ -18076,7 +19086,7 @@ var toolbar = function toolbar(services) { exports.default = toolbar; /***/ }), -/* 111 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18096,7 +19106,7 @@ var _dialog2 = _interopRequireDefault(_dialog); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); var $dialog = null; @@ -18191,7 +19201,7 @@ var moveRecord = function moveRecord(services) { exports.default = moveRecord; /***/ }), -/* 112 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -18219,35 +19229,35 @@ var _phraseanetCommon = __webpack_require__(11); var appCommons = _interopRequireWildcard(_phraseanetCommon); -var _utils = __webpack_require__(39); +var _utils = __webpack_require__(42); -var _sprintfJs = __webpack_require__(59); +var _sprintfJs = __webpack_require__(61); -var _layout = __webpack_require__(113); +var _layout = __webpack_require__(119); var _layout2 = _interopRequireDefault(_layout); -var _presets = __webpack_require__(114); +var _presets = __webpack_require__(120); var _presets2 = _interopRequireDefault(_presets); -var _searchReplace = __webpack_require__(115); +var _searchReplace = __webpack_require__(121); var _searchReplace2 = _interopRequireDefault(_searchReplace); -var _preview = __webpack_require__(116); +var _preview = __webpack_require__(122); var _preview2 = _interopRequireDefault(_preview); -var _thesaurusDatasource = __webpack_require__(143); +var _thesaurusDatasource = __webpack_require__(148); var _thesaurusDatasource2 = _interopRequireDefault(_thesaurusDatasource); -var _geonameDatasource = __webpack_require__(144); +var _geonameDatasource = __webpack_require__(149); var _geonameDatasource2 = _interopRequireDefault(_geonameDatasource); -var _mapbox = __webpack_require__(50); +var _mapbox = __webpack_require__(52); var _mapbox2 = _interopRequireDefault(_mapbox); @@ -18255,15 +19265,15 @@ var _emitter = __webpack_require__(15); var _emitter2 = _interopRequireDefault(_emitter); -var _recordCollection = __webpack_require__(165); +var _recordCollection = __webpack_require__(201); var _recordCollection2 = _interopRequireDefault(_recordCollection); -var _fieldCollection = __webpack_require__(51); +var _fieldCollection = __webpack_require__(53); var _fieldCollection2 = _interopRequireDefault(_fieldCollection); -var _statusCollection = __webpack_require__(167); +var _statusCollection = __webpack_require__(203); var _statusCollection2 = _interopRequireDefault(_statusCollection); @@ -18624,7 +19634,7 @@ var recordEditorService = function recordEditorService(services) { }); recordEditorEvents.emit('recordSelection.changed', { - selection: getRecordSelection() + selection: loadSelectedRecords() }); } @@ -19244,10 +20254,12 @@ var recordEditorService = function recordEditorService(services) { var $record = (0, _jquery2.default)(selected[_pos]); selection.push($record.attr('id').split('_').pop()); } - recordEditorEvents.emit('recordSelection.changed', { - selection: getRecordSelection() - }); } + + recordEditorEvents.emit('recordSelection.changed', { + selection: loadSelectedRecords() + }); + /**trigger select all checkbox**/ if (selected.length < allRecords.length) { (0, _jquery2.default)("#select-all-diapo").removeAttr("checked"); @@ -19257,6 +20269,7 @@ var recordEditorService = function recordEditorService(services) { } }; options.lastClickId = recordIndex; + refreshFields(event); } @@ -19820,6 +20833,7 @@ var recordEditorService = function recordEditorService(services) { if (!record._selected) { continue; } + recordFieldValue["_rid"] = record.rid; for (var _recordIndex in options.recordConfig.records) { if (options.recordConfig.records[_recordIndex].id === record.rid) { recordFieldValue["technicalInfo"] = options.recordConfig.records[_recordIndex].technicalInfo; @@ -19880,7 +20894,7 @@ var recordEditorService = function recordEditorService(services) { exports.default = recordEditorService; /***/ }), -/* 113 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20040,7 +21054,7 @@ var recordEditorLayout = function recordEditorLayout(services) { exports.default = recordEditorLayout; /***/ }), -/* 114 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20054,7 +21068,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _utils = __webpack_require__(39); +var _utils = __webpack_require__(42); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20296,7 +21310,7 @@ var presetsModule = function presetsModule(services) { exports.default = presetsModule; /***/ }), -/* 115 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20316,7 +21330,7 @@ var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var humane = __webpack_require__(8); +var humane = __webpack_require__(9); /** * Editor Right tab plugin */ @@ -20421,7 +21435,7 @@ var searchReplace = function searchReplace(services) { exports.default = searchReplace; /***/ }), -/* 116 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20439,7 +21453,7 @@ var _pym = __webpack_require__(17); var _pym2 = _interopRequireDefault(_pym); -var _videoEditor = __webpack_require__(117); +var _videoEditor = __webpack_require__(123); var _videoEditor2 = _interopRequireDefault(_videoEditor); @@ -20635,7 +21649,7 @@ var preview = function preview(services) { exports.default = preview; /***/ }), -/* 117 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -20649,7 +21663,7 @@ var _jquery = __webpack_require__(0); var _jquery2 = _interopRequireDefault(_jquery); -var _videojsFlash = __webpack_require__(62); +var _videojsFlash = __webpack_require__(64); var _videojsFlash2 = _interopRequireDefault(_videojsFlash); @@ -20696,7 +21710,7 @@ var videoEditor = function videoEditor(services) { __webpack_require__.e/* require.ensure */(1/* duplicate */).then((function () { // load videoJs lib - rangeCapture = __webpack_require__(87).default; + rangeCapture = __webpack_require__(92).default; rangeCaptureInstance = rangeCapture(services); rangeCaptureInstance.initialize(params, options); @@ -20732,7 +21746,7 @@ var videoEditor = function videoEditor(services) { exports.default = videoEditor; /***/ }), -/* 118 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20749,12 +21763,12 @@ exports.default = videoEditor; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var window = _interopDefault(__webpack_require__(43)); -var document = _interopDefault(__webpack_require__(83)); -var tsml = _interopDefault(__webpack_require__(84)); -var safeParseTuple = _interopDefault(__webpack_require__(85)); -var xhr = _interopDefault(__webpack_require__(86)); -var vtt = _interopDefault(__webpack_require__(138)); +var window = _interopDefault(__webpack_require__(44)); +var document = _interopDefault(__webpack_require__(88)); +var tsml = _interopDefault(__webpack_require__(89)); +var safeParseTuple = _interopDefault(__webpack_require__(90)); +var xhr = _interopDefault(__webpack_require__(91)); +var vtt = _interopDefault(__webpack_require__(143)); var version = "6.13.0"; @@ -46074,13 +47088,13 @@ module.exports = videojs; /***/ }), -/* 119 */ +/* 125 */ /***/ (function(module, exports) { /* (ignored) */ /***/ }), -/* 120 */ +/* 126 */ /***/ (function(module, exports) { module.exports = isFunction @@ -46101,11 +47115,11 @@ function isFunction (fn) { /***/ }), -/* 121 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { -var trim = __webpack_require__(122) - , forEach = __webpack_require__(136) +var trim = __webpack_require__(128) + , forEach = __webpack_require__(142) , isArray = function(arg) { return Object.prototype.toString.call(arg) === '[object Array]'; } @@ -46138,18 +47152,18 @@ module.exports = function (headers) { /***/ }), -/* 122 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bind = __webpack_require__(48); -var define = __webpack_require__(63); +var bind = __webpack_require__(50); +var define = __webpack_require__(65); -var implementation = __webpack_require__(64); -var getPolyfill = __webpack_require__(65); -var shim = __webpack_require__(135); +var implementation = __webpack_require__(66); +var getPolyfill = __webpack_require__(67); +var shim = __webpack_require__(141); var boundTrim = bind.call(Function.call, getPolyfill()); @@ -46163,7 +47177,7 @@ module.exports = boundTrim; /***/ }), -/* 123 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46222,7 +47236,7 @@ module.exports = function bind(that) { /***/ }), -/* 124 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46232,7 +47246,7 @@ module.exports = function bind(that) { var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var slice = Array.prototype.slice; -var isArgs = __webpack_require__(125); +var isArgs = __webpack_require__(131); var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); @@ -46370,7 +47384,7 @@ module.exports = keysShim; /***/ }), -/* 125 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46394,28 +47408,28 @@ module.exports = function isArguments(value) { /***/ }), -/* 126 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var GetIntrinsic = __webpack_require__(127); +var GetIntrinsic = __webpack_require__(133); var $Object = GetIntrinsic('%Object%'); var $TypeError = GetIntrinsic('%TypeError%'); var $String = GetIntrinsic('%String%'); -var $isNaN = __webpack_require__(128); -var $isFinite = __webpack_require__(129); +var $isNaN = __webpack_require__(134); +var $isFinite = __webpack_require__(135); -var sign = __webpack_require__(130); -var mod = __webpack_require__(131); +var sign = __webpack_require__(136); +var mod = __webpack_require__(137); -var IsCallable = __webpack_require__(49); -var toPrimitive = __webpack_require__(132); +var IsCallable = __webpack_require__(51); +var toPrimitive = __webpack_require__(138); -var has = __webpack_require__(134); +var has = __webpack_require__(140); // https://es5.github.io/#x9 var ES5 = { @@ -46643,7 +47657,7 @@ module.exports = ES5; /***/ }), -/* 127 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46827,7 +47841,7 @@ module.exports = function GetIntrinsic(name, allowMissing) { /***/ }), -/* 128 */ +/* 134 */ /***/ (function(module, exports) { module.exports = Number.isNaN || function isNaN(a) { @@ -46836,7 +47850,7 @@ module.exports = Number.isNaN || function isNaN(a) { /***/ }), -/* 129 */ +/* 135 */ /***/ (function(module, exports) { var $isNaN = Number.isNaN || function (a) { return a !== a; }; @@ -46845,7 +47859,7 @@ module.exports = Number.isFinite || function (x) { return typeof x === 'number' /***/ }), -/* 130 */ +/* 136 */ /***/ (function(module, exports) { module.exports = function sign(number) { @@ -46854,7 +47868,7 @@ module.exports = function sign(number) { /***/ }), -/* 131 */ +/* 137 */ /***/ (function(module, exports) { module.exports = function mod(number, modulo) { @@ -46864,7 +47878,7 @@ module.exports = function mod(number, modulo) { /***/ }), -/* 132 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46872,9 +47886,9 @@ module.exports = function mod(number, modulo) { var toStr = Object.prototype.toString; -var isPrimitive = __webpack_require__(133); +var isPrimitive = __webpack_require__(139); -var isCallable = __webpack_require__(49); +var isCallable = __webpack_require__(51); // https://es5.github.io/#x8.12 var ES5internalSlots = { @@ -46908,7 +47922,7 @@ module.exports = function ToPrimitive(input, PreferredType) { /***/ }), -/* 133 */ +/* 139 */ /***/ (function(module, exports) { module.exports = function isPrimitive(value) { @@ -46917,26 +47931,26 @@ module.exports = function isPrimitive(value) { /***/ }), -/* 134 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bind = __webpack_require__(48); +var bind = __webpack_require__(50); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), -/* 135 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var define = __webpack_require__(63); -var getPolyfill = __webpack_require__(65); +var define = __webpack_require__(65); +var getPolyfill = __webpack_require__(67); module.exports = function shimStringTrim() { var polyfill = getPolyfill(); @@ -46946,13 +47960,13 @@ module.exports = function shimStringTrim() { /***/ }), -/* 136 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isCallable = __webpack_require__(49); +var isCallable = __webpack_require__(51); var toStr = Object.prototype.toString; var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -47015,32 +48029,7 @@ module.exports = forEach; /***/ }), -/* 137 */ -/***/ (function(module, exports) { - -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} - - -/***/ }), -/* 138 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47064,12 +48053,12 @@ function extend() { // forth between JSON. If we don't then it's not that big of a deal since we're // off browser. -var window = __webpack_require__(43); +var window = __webpack_require__(44); var vttjs = module.exports = { - WebVTT: __webpack_require__(139), - VTTCue: __webpack_require__(140), - VTTRegion: __webpack_require__(141) + WebVTT: __webpack_require__(144), + VTTCue: __webpack_require__(145), + VTTRegion: __webpack_require__(146) }; window.vttjs = vttjs; @@ -47096,7 +48085,7 @@ if (!window.VTTCue) { /***/ }), -/* 139 */ +/* 144 */ /***/ (function(module, exports) { /** @@ -48431,7 +49420,7 @@ module.exports = WebVTT; /***/ }), -/* 140 */ +/* 145 */ /***/ (function(module, exports) { /** @@ -48742,7 +49731,7 @@ module.exports = VTTCue; /***/ }), -/* 141 */ +/* 146 */ /***/ (function(module, exports) { /** @@ -48882,13 +49871,13 @@ module.exports = VTTRegion; /***/ }), -/* 142 */ +/* 147 */ /***/ (function(module, exports) { module.exports = {"_args":[["videojs-swf@5.4.1","/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client"]],"_from":"videojs-swf@5.4.1","_id":"videojs-swf@5.4.1","_inBundle":false,"_integrity":"sha1-IHfvccdJ8seCPvSbq65N0qywj4c=","_location":"/videojs-swf","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"videojs-swf@5.4.1","name":"videojs-swf","escapedName":"videojs-swf","rawSpec":"5.4.1","saveSpec":null,"fetchSpec":"5.4.1"},"_requiredBy":["/videojs-flash"],"_resolved":"https://registry.npmjs.org/videojs-swf/-/videojs-swf-5.4.1.tgz","_spec":"5.4.1","_where":"/home/esokia-6/work/work41/Phraseanet/Phraseanet-production-client","author":{"name":"Brightcove"},"bugs":{"url":"https://github.com/videojs/video-js-swf/issues"},"copyright":"Copyright 2014 Brightcove, Inc. https://github.com/videojs/video-js-swf/blob/master/LICENSE","description":"The Flash-fallback video player for video.js (http://videojs.com)","devDependencies":{"async":"~0.2.9","chg":"^0.3.2","flex-sdk":"4.6.0-0","grunt":"~0.4.0","grunt-bumpup":"~0.5.0","grunt-cli":"~0.1.0","grunt-connect":"~0.2.0","grunt-contrib-jshint":"~0.4.3","grunt-contrib-qunit":"~0.2.1","grunt-contrib-watch":"~0.1.4","grunt-npm":"~0.0.2","grunt-prompt":"~0.1.2","grunt-shell":"~0.6.1","grunt-tagrelease":"~0.3.1","qunitjs":"~1.12.0","video.js":"^5.9.2"},"homepage":"http://videojs.com","keywords":["flash","video","player"],"name":"videojs-swf","repository":{"type":"git","url":"git+https://github.com/videojs/video-js-swf.git"},"scripts":{"version":"chg release -y && grunt dist && git add -f dist/ && git add CHANGELOG.md"},"version":"5.4.1"} /***/ }), -/* 143 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49109,7 +50098,7 @@ var thesaurusDatasource = function thesaurusDatasource(services) { exports.default = thesaurusDatasource; /***/ }), -/* 144 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49129,7 +50118,7 @@ var _underscore2 = _interopRequireDefault(_underscore); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(38); +__webpack_require__(39); var geonameDatasource = function geonameDatasource(services) { var configService = services.configService, @@ -49423,7 +50412,7 @@ var geonameDatasource = function geonameDatasource(services) { exports.default = geonameDatasource; /***/ }), -/* 145 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49552,7 +50541,7 @@ var markerCollection = function markerCollection(services) { exports.default = markerCollection; /***/ }), -/* 146 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49568,17 +50557,17 @@ var _jquery2 = _interopRequireDefault(_jquery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var mapboxgl = __webpack_require__(66); +var mapboxgl = __webpack_require__(68); var markerGLCollection = function markerGLCollection(services) { var configService = services.configService, localeService = services.localeService, eventEmitter = services.eventEmitter; - var markerCollection = {}; var cachedGeoJson = void 0; var map = void 0; var geojson = void 0; + var markerGl = void 0; var editable = void 0; var isDraggable = false; var isCursorOverPoint = false; @@ -49589,7 +50578,7 @@ var markerGLCollection = function markerGLCollection(services) { var initialize = function initialize(params) { var _params; - var initWith = (_params = params, map = _params.map, geojson = _params.geojson, _params); + var initWith = (_params = params, map = _params.map, geojson = _params.geojson, markerGl = _params.markerGl, _params); editable = params.editable || false; setCollection(geojson); }; @@ -49613,158 +50602,92 @@ var markerGLCollection = function markerGLCollection(services) { }; var setPoint = function setPoint(marker) { + + var markerElement = getMarker(marker.properties._rid); + + markerElement.feature = { + properties: { + recordIndex: marker.properties.recordIndex + } + }; + + // add marker to map + markerElement.setLngLat(marker.geometry.coordinates).addTo(map); + var $content = (0, _jquery2.default)('
'); var template = '

' + marker.properties.title + '

'; if (editable === true) { - template += '\n
\n \n
\n
\n

' + localeService.t('mapMarkerMoveLabel') + '

\n

\n
\n \n \n
\n
'; + template += '\n
\n \n
\n
\n

' + localeService.t('mapMarkerMoveLabel') + '

\n

\n
\n \n \n
\n
'; } $content.append(template); $content.find('.edit-mode').hide(); - // + + var popupDialog = new mapboxgl.Popup({ closeOnClick: false }).setDOMContent($content.get(0)); + + popupDialog.on('close', function (event) { + if (editable) { + markerElement.setDraggable(false); + } + }); + + // bind popup to the marker element + markerElement.setPopup(popupDialog); + + markerElement.on('dragend', function () { + var position = markerElement.getLngLat().wrap(); + $content.find('.updated-position').html(position.lat + '
' + position.lng); + $content.find('.edit-mode').show(); + }); + $content.on('click', '.edit-position', function (event) { var $el = (0, _jquery2.default)(event.currentTarget); - var marker = getMarker($el.data('marker-id')); - marker._originalPosition = marker.lngLat.wrap(); + var markerSelected = getMarker($el.data('marker-id')); + markerSelected._originalPosition = markerElement.getLngLat().wrap(); $content.find('.view-mode').hide(); $content.find('.edit-mode').show(); $content.find('.help').show(); - isDraggable = true; - map.on('mousedown', mouseDown); + markerSelected.setDraggable(true); }); $content.on('click', '.submit-position', function (event) { var $el = (0, _jquery2.default)(event.currentTarget); - var marker = getMarker($el.data('marker-id')); + var markerSelected = getMarker($el.data('marker-id')); - isDraggable = false; + markerSelected.setDraggable(false); $content.find('.view-mode').show(); $content.find('.help').hide(); $content.find('.updated-position').html(''); $content.find('.edit-mode').hide(); - var popup = document.getElementsByClassName('mapboxgl-popup'); - if (popup[0]) popup[0].parentElement.removeChild(popup[0]); + markerSelected.togglePopup(); - marker.lngLat = { - lng: cachedGeoJson.features[0].geometry.coordinates[0], - lat: cachedGeoJson.features[0].geometry.coordinates[1] - }; - marker.feature = marker.features[0]; - eventEmitter.emit('markerChange', { marker: marker, position: marker.lngLat }); + markerSelected._originalPosition = markerSelected.getLngLat().wrap(); + eventEmitter.emit('markerChange', { marker: markerSelected, position: markerSelected.getLngLat().wrap() }); }); $content.on('click', '.cancel-position', function (event) { var $el = (0, _jquery2.default)(event.currentTarget); - var marker = getMarker($el.data('marker-id')); - isDraggable = false; + var markerSelected = getMarker($el.data('marker-id')); + + markerSelected.setDraggable(false); $content.find('.view-mode').show(); $content.find('.updated-position').html(''); $content.find('.edit-mode').hide(); $content.find('.help').hide(); - var popup = document.getElementsByClassName('mapboxgl-popup'); - if (popup[0]) popup[0].parentElement.removeChild(popup[0]); + markerSelected.togglePopup(); cachedGeoJson.features[0].geometry.coordinates = [marker._originalPosition.lng, marker._originalPosition.lat]; - map.getSource('data').setData(cachedGeoJson); + resetMarkerPosition($content, markerSelected); }); - - // When the cursor enters a feature in the point layer, prepare for dragging. - map.on('mouseenter', 'points', function () { - if (!isDraggable) { - return; - } - map.getCanvas().style.cursor = 'move'; - isCursorOverPoint = true; - map.dragPan.disable(); - }); - - map.on('mouseleave', 'points', function () { - if (!isDraggable) { - return; - } - map.getCanvas().style.cursor = ''; - isCursorOverPoint = false; - map.dragPan.enable(); - }); - - map.on('click', 'points', function (e) { - markerCollection[e.features[0].properties.recordIndex] = e; - var coordinates = e.features[0].geometry.coordinates.slice(); - - while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) { - coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360; - } - - var popup = document.getElementsByClassName('mapboxgl-popup'); - // Check if there is already a popup on the map and if so, remove it - if (popup[0]) popup[0].parentElement.removeChild(popup[0]); - - popupDialog = new mapboxgl.Popup({ closeOnClick: false }).setLngLat(coordinates).setDOMContent($content.get(0)).addTo(map); - - popupDialog.on('close', function (event) { - if (editable) { - resetMarkerPosition($content); - } - }); - }); - - function mouseDown() { - if (!isCursorOverPoint) return; - - isDragging = true; - - // Set a cursor indicator - map.getCanvas().style.cursor = 'grab'; - - // Mouse events - map.on('mousemove', onMove); - map.once('mouseup', onUp); - - var popup = document.getElementsByClassName('mapboxgl-popup'); - if (popup[0]) popup[0].parentElement.removeChild(popup[0]); - } - - function onMove(e) { - if (!isDragging) return; - var coords = e.lngLat; - - // Set a UI indicator for dragging. - map.getCanvas().style.cursor = 'grabbing'; - - // Update the Point feature in `geojson` coordinates - // and call setData to the source layer `point` on it. - cachedGeoJson.features[0].geometry.coordinates = [coords.lng, coords.lat]; - map.getSource('data').setData(cachedGeoJson); - } - - function onUp(e) { - if (!isDragging) return; - var position = e.lngLat; - - map.getCanvas().style.cursor = ''; - isDragging = false; - - // Unbind mouse events - map.off('mousemove', onMove); - $content.find('.updated-position').html(position.lat + '
' + position.lng); - popupDialog = new mapboxgl.Popup({ closeOnClick: false }).setLngLat(position).setDOMContent($content.get(0)).addTo(map); - - popupDialog.on('close', function (event) { - if (editable) { - resetMarkerPosition($content); - } - }); - } }; - var resetMarkerPosition = function resetMarkerPosition($content) { - var marker = getMarker($content.find('.edit-position').data('marker-id')); + var resetMarkerPosition = function resetMarkerPosition($content, marker) { $content.find('.view-mode').show(); $content.find('.updated-position').html(''); $content.find('.edit-mode').hide(); @@ -49772,12 +50695,12 @@ var markerGLCollection = function markerGLCollection(services) { isDraggable = false; if (marker._originalPosition !== undefined) { cachedGeoJson.features[0].geometry.coordinates = [marker._originalPosition.lng, marker._originalPosition.lat]; - map.getSource('data').setData(cachedGeoJson); + marker.setLngLat(marker._originalPosition); } }; var getMarker = function getMarker(markerId) { - return markerCollection[markerId]; + return markerGl[markerId]; }; return { @@ -49788,7 +50711,7 @@ var markerGLCollection = function markerGLCollection(services) { exports.default = markerGLCollection; /***/ }), -/* 147 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49972,7 +50895,7 @@ exports.default = provider; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 148 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50080,13 +51003,4627 @@ var leafletLocaleFr = { exports.default = leafletLocaleFr; /***/ }), -/* 149 */ +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Typeahead = __webpack_require__(155); +var debounce = __webpack_require__(159); +var extend = __webpack_require__(37); +var EventEmitter = __webpack_require__(93).EventEmitter; +var exceptions = __webpack_require__(160); +var MapboxClient = __webpack_require__(161); +var mbxGeocoder = __webpack_require__(171); +var MapboxEventManager = __webpack_require__(179); +var localization = __webpack_require__(181); +var subtag = __webpack_require__(182); + +/** + * A geocoder component using the [Mapbox Geocoding API](https://docs.mapbox.com/api/search/#geocoding) + * @class MapboxGeocoder + * @param {Object} options + * @param {String} options.accessToken Required. + * @param {String} [options.origin=https://api.mapbox.com] Use to set a custom API origin. + * @param {Object} [options.mapboxgl] A [mapbox-gl](https://github.com/mapbox/mapbox-gl-js) instance to use when creating [Markers](https://docs.mapbox.com/mapbox-gl-js/api/#marker). Required if `options.marker` is `true`. + * @param {Number} [options.zoom=16] On geocoded result what zoom level should the map animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`. + * @param {Boolean|Object} [options.flyTo=true] If `false`, animating the map to a selected result is disabled. If `true`, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition. + * @param {String} [options.placeholder=Search] Override the default placeholder attribute value. + * @param {Object} [options.proximity] a proximity argument: this is + * a geographical point given as an object with `latitude` and `longitude` + * properties. Search results closer to this point will be given + * higher priority. + * @param {Boolean} [options.trackProximity=true] If `true`, the geocoder proximity will automatically update based on the map view. + * @param {Boolean} [options.collapsed=false] If `true`, the geocoder control will collapse until hovered or in focus. + * @param {Boolean} [options.clearAndBlurOnEsc=false] If `true`, the geocoder control will clear it's contents and blur when user presses the escape key. + * @param {Boolean} [options.clearOnBlur=false] If `true`, the geocoder control will clear its value when the input blurs. + * @param {Array} [options.bbox] a bounding box argument: this is + * a bounding box given as an array in the format `[minX, minY, maxX, maxY]`. + * Search results will be limited to the bounding box. + * @param {string} [options.countries] a comma separated list of country codes to + * limit results to specified country or countries. + * @param {string} [options.types] a comma seperated list of types that filter + * results to match those specified. See https://docs.mapbox.com/api/search/#data-types + * for available types. + * If reverseGeocode is enabled, you should specify one type. If you configure more than one type, the first type will be used. + * @param {Number} [options.minLength=2] Minimum number of characters to enter before results are shown. + * @param {Number} [options.limit=5] Maximum number of results to show. + * @param {string} [options.language] Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Defaults to the browser's language settings. + * @param {Function} [options.filter] A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise. + * @param {Function} [options.localGeocoder] A function accepting the query string which performs local geocoding to supplement results from the Mapbox Geocoding API. Expected to return an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format. + * @param {Function} [options.externalGeocoder] A function accepting the query string and current features list which performs geocoding to supplement results from the Mapbox Geocoding API. Expected to return a Promise which resolves to an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format. + * @param {distance|score} [options.reverseMode=distance] - Set the factors that are used to sort nearby results. + * @param {boolean} [options.reverseGeocode=false] If `true`, enable reverse geocoding mode. In reverse geocoding, search input is expected to be coordinates in the form `lat, lon`, with suggestions being the reverse geocodes. + * @param {Boolean} [options.enableEventLogging=true] Allow Mapbox to collect anonymous usage statistics from the plugin. + * @param {Boolean|Object} [options.marker=true] If `true`, a [Marker](https://docs.mapbox.com/mapbox-gl-js/api/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.mapboxgl` also be set. + * @param {Function} [options.render] A function that specifies how the results should be rendered in the dropdown menu. This function should accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string. Any HTML in the returned string will be rendered. + * @param {Function} [options.getItemValue] A function that specifies how the selected result should be rendered in the search bar. This function should accept a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string. HTML tags in the output string will not be rendered. Defaults to `(item) => item.place_name`. + * @param {String} [options.mode=mapbox.places] A string specifying the geocoding [endpoint](https://docs.mapbox.com/api/search/#endpoints) to query. Options are `mapbox.places` and `mapbox.places-permanent`. The `mapbox.places-permanent` mode requires an enterprise license for permanent geocodes. + * @param {Boolean} [options.localGeocoderOnly=false] If `true`, indicates that the `localGeocoder` results should be the only ones returned to the user. If `false`, indicates that the `localGeocoder` results should be combined with those from the Mapbox API with the `localGeocoder` results ranked higher. + * @example + * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken }); + * map.addControl(geocoder); + * @return {MapboxGeocoder} `this` + * + */ + +function MapboxGeocoder(options) { + this._eventEmitter = new EventEmitter(); + this.options = extend({}, this.options, options); + this.inputString = ''; + this.fresh = true; + this.lastSelected = null; +} + +MapboxGeocoder.prototype = { + options: { + zoom: 16, + flyTo: true, + trackProximity: true, + minLength: 2, + reverseGeocode: false, + limit: 5, + origin: 'https://api.mapbox.com', + enableEventLogging: true, + marker: true, + mapboxgl: null, + collapsed: false, + clearAndBlurOnEsc: false, + clearOnBlur: false, + getItemValue: function(item) { + return item.place_name + }, + render: function(item) { + var placeName = item.place_name.split(','); + return '
' + placeName[0]+ '
' + placeName.splice(1, placeName.length).join(',') + '
'; + } + }, + + /** + * Add the geocoder to a container. The container can be either a `mapboxgl.Map`, an `HTMLElement` or a CSS selector string. + * + * If the container is a [`mapboxgl.Map`](https://docs.mapbox.com/mapbox-gl-js/api/map/), this function will behave identically to [`Map.addControl(geocoder)`](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addcontrol). + * If the container is an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement), then the geocoder will be appended as a child of that [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). + * If the container is a [CSS selector string](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), the geocoder will be appended to the element returned from the query. + * + * This function will throw an error if the container is none of the above. + * It will also throw an error if the referenced HTML element cannot be found in the `document.body`. + * + * For example, if the HTML body contains the element `
`, the following script will append the geocoder to `#geocoder-container`: + * + * ```javascript + * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken }); + * geocoder.addTo('#geocoder-container'); + * ``` + * @param {String|HTMLElement|mapboxgl.Map} container A reference to the container to which to add the geocoder + */ + addTo: function(container){ + + function addToExistingContainer (geocoder, container) { + if (!document.body.contains(container)) { + throw new Error("Element provided to #addTo() exists, but is not in the DOM") + } + const el = geocoder.onAdd(); //returns the input elements, which are then added to the requested html container + container.appendChild(el); + } + + // if the container is a map, add the control like normal + if (container._controlContainer){ + // it's a mapbox-gl map, add like normal + container.addControl(this); + } + // if the container is an HTMLElement, then set the parent to be that element + else if (container instanceof HTMLElement) { + addToExistingContainer(this, container); + } + // if the container is a string, treat it as a CSS query + else if (typeof container == 'string'){ + const parent = document.querySelectorAll(container); + if (parent.length === 0){ + throw new Error("Element ", container, "not found.") + } + + if (parent.length > 1){ + throw new Error("Geocoder can only be added to a single html element") + } + + addToExistingContainer(this, parent[0]); + }else{ + throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element") + } + }, + + onAdd: function(map) { + if (map && typeof map != 'string'){ + this._map = map; + } + + this.setLanguage(); + + if (!this.options.localGeocoderOnly){ + this.geocoderService = mbxGeocoder( + MapboxClient({ + accessToken: this.options.accessToken, + origin: this.options.origin + }) + ); + } + + if (this.options.localGeocoderOnly && !this.options.localGeocoder){ + throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode") + } + + this.eventManager = new MapboxEventManager(this.options); + + this._onChange = this._onChange.bind(this); + this._onKeyDown = this._onKeyDown.bind(this); + this._onPaste = this._onPaste.bind(this); + this._onBlur = this._onBlur.bind(this); + this._showButton = this._showButton.bind(this); + this._hideButton = this._hideButton.bind(this); + this._onQueryResult = this._onQueryResult.bind(this); + this.clear = this.clear.bind(this); + this._updateProximity = this._updateProximity.bind(this); + this._collapse = this._collapse.bind(this); + this._unCollapse = this._unCollapse.bind(this); + this._clear = this._clear.bind(this); + this._clearOnBlur = this._clearOnBlur.bind(this); + + var el = (this.container = document.createElement('div')); + el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl'; + + var searchIcon = this.createIcon('search', '') + + this._inputEl = document.createElement('input'); + this._inputEl.type = 'text'; + this._inputEl.className = 'mapboxgl-ctrl-geocoder--input'; + + this.setPlaceholder(); + + if (this.options.collapsed) { + this._collapse(); + this.container.addEventListener('mouseenter', this._unCollapse); + this.container.addEventListener('mouseleave', this._collapse); + this._inputEl.addEventListener('focus', this._unCollapse); + } + + if (this.options.collapsed || this.options.clearOnBlur) { + this._inputEl.addEventListener('blur', this._onBlur); + } + + this._inputEl.addEventListener('keydown', debounce(this._onKeyDown, 200)); + this._inputEl.addEventListener('paste', this._onPaste); + this._inputEl.addEventListener('change', this._onChange); + this.container.addEventListener('mouseenter', this._showButton); + this.container.addEventListener('mouseleave', this._hideButton); + this._inputEl.addEventListener('keyup', function(e){ + this.eventManager.keyevent(e, this); + }.bind(this)); + + var actions = document.createElement('div'); + actions.classList.add('mapboxgl-ctrl-geocoder--pin-right'); + + this._clearEl = document.createElement('button'); + this._clearEl.setAttribute('aria-label', 'Clear'); + this._clearEl.addEventListener('click', this.clear); + this._clearEl.className = 'mapboxgl-ctrl-geocoder--button'; + + var buttonIcon = this.createIcon('close', '') + this._clearEl.appendChild(buttonIcon); + + this._loadingEl = this.createIcon('loading', ''); + + actions.appendChild(this._clearEl); + actions.appendChild(this._loadingEl); + + el.appendChild(searchIcon); + el.appendChild(this._inputEl); + el.appendChild(actions); + + this._typeahead = new Typeahead(this._inputEl, [], { + filter: false, + minLength: this.options.minLength, + limit: this.options.limit + }); + + this.setRenderFunction(this.options.render); + this._typeahead.getItemValue = this.options.getItemValue; + + this.mapMarker = null; + this._handleMarker = this._handleMarker.bind(this); + if (this._map){ + if (this.options.trackProximity ) { + this._updateProximity(); + this._map.on('moveend', this._updateProximity); + } + this._mapboxgl = this.options.mapboxgl; + if (!this._mapboxgl && this.options.marker) { + // eslint-disable-next-line no-console + console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."); + this.options.marker = false; + } + } + return el; + }, + + createIcon: function(name, path) { + var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + icon.setAttribute('class', 'mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-' + name); + icon.setAttribute('viewBox', '0 0 18 18'); + icon.setAttribute('xml:space','preserve'); + icon.setAttribute('width', 18); + icon.setAttribute('height', 18); + // IE does not have innerHTML for SVG nodes + if (!('innerHTML' in icon)) { + var SVGNodeContainer = document.createElement('div'); + SVGNodeContainer.innerHTML = '' + path.valueOf().toString() + ''; + var SVGNode = SVGNodeContainer.firstChild, + SVGPath = SVGNode.firstChild; + icon.appendChild(SVGPath); + } else { + icon.innerHTML = path; + } + return icon; + }, + + onRemove: function() { + this.container.parentNode.removeChild(this.container); + + if (this.options.trackProximity && this._map) { + this._map.off('moveend', this._updateProximity); + } + + this._removeMarker(); + + this._map = null; + + return this; + }, + + _onPaste: function(e){ + var value = (e.clipboardData || window.clipboardData).getData('text'); + if (value.length >= this.options.minLength) { + this._geocode(value); + } + }, + + _onKeyDown: function(e) { + var ESC_KEY_CODE = 27, + TAB_KEY_CODE = 9; + + if (e.keyCode === ESC_KEY_CODE && this.options.clearAndBlurOnEsc) { + this._clear(e); + return this._inputEl.blur(); + } + + // if target has shadowRoot, then get the actual active element inside the shadowRoot + var target = e.target && e.target.shadowRoot + ? e.target.shadowRoot.activeElement + : e.target; + var value = target ? target.value : ''; + + if (!value) { + this.fresh = true; + // the user has removed all the text + if (e.keyCode !== TAB_KEY_CODE) this.clear(e); + return (this._clearEl.style.display = 'none'); + } + + // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN + if ((e.metaKey || [TAB_KEY_CODE, ESC_KEY_CODE, 37, 39, 13, 38, 40].indexOf(e.keyCode) !== -1)) + return; + + if (target.value.length >= this.options.minLength) { + this._geocode(target.value); + } + }, + + _showButton: function() { + if (this._typeahead.selected) this._clearEl.style.display = 'block'; + }, + + _hideButton: function() { + if (this._typeahead.selected) this._clearEl.style.display = 'none'; + }, + + _onBlur: function(e) { + if (this.options.clearOnBlur) { + this._clearOnBlur(e); + } + if (this.options.collapsed) { + this._collapse(); + } + }, + _onChange: function() { + var selected = this._typeahead.selected; + if (selected && JSON.stringify(selected) !== this.lastSelected) { + this._clearEl.style.display = 'none'; + if (this.options.flyTo) { + var flyOptions; + if (selected.properties && exceptions[selected.properties.short_code]) { + // Certain geocoder search results return (and therefore zoom to fit) + // an unexpectedly large bounding box: for example, both Russia and the + // USA span both sides of -180/180, or France includes the island of + // Reunion in the Indian Ocean. An incomplete list of these exceptions + // at ./exceptions.json provides "reasonable" bounding boxes as a + // short-term solution; this may be amended as necessary. + flyOptions = extend({}, this.options.flyTo); + if (this._map){ + this._map.fitBounds(exceptions[selected.properties.short_code].bbox, flyOptions); + } + } else if (selected.bbox) { + var bbox = selected.bbox; + flyOptions = extend({}, this.options.flyTo); + if (this._map){ + this._map.fitBounds([[bbox[0], bbox[1]], [bbox[2], bbox[3]]], flyOptions); + } + } else { + var defaultFlyOptions = { + zoom: this.options.zoom + } + flyOptions = extend({}, defaultFlyOptions, this.options.flyTo); + // ensure that center is not overriden by custom options + flyOptions.center = selected.center; + if (this._map){ + this._map.flyTo(flyOptions); + } + } + } + if (this.options.marker && this._mapboxgl){ + this._handleMarker(selected); + } + + // After selecting a feature, re-focus the textarea and set + // cursor at start. + this._inputEl.focus(); + this._inputEl.scrollLeft = 0; + this._inputEl.setSelectionRange(0, 0); + this.lastSelected = JSON.stringify(selected); + this._eventEmitter.emit('result', { result: selected }); + this.eventManager.select(selected, this); + } + }, + + _geocode: function(searchInput) { + this._loadingEl.style.display = 'block'; + this._eventEmitter.emit('loading', { query: searchInput }); + this.inputString = searchInput; + // Possible config proprerties to pass to client + var keys = [ + 'bbox', + 'limit', + 'proximity', + 'countries', + 'types', + 'language', + 'reverseMode', + 'mode' + ]; + var self = this; + var geocoderError = null; + // Create config object + var config = keys.reduce(function(config, key) { + if (self.options[key]) { + // countries, types, and language need to be passed in as arrays to client + // https://github.com/mapbox/mapbox-sdk-js/blob/master/services/geocoding.js#L38-L47 + ['countries', 'types', 'language'].indexOf(key) > -1 + ? (config[key] = self.options[key].split(/[\s,]+/)) + : (config[key] = self.options[key]); + + if (key === 'proximity' && self.options[key] && typeof self.options[key].longitude === 'number' && typeof self.options[key].latitude === 'number') { + config[key] = [self.options[key].longitude, self.options[key].latitude] + } + } + return config; + }, {}); + + var request; + if (this.options.localGeocoderOnly){ + request = Promise.resolve(); + } + // check if searchInput resembles coordinates, and if it does, + // make the request a reverseGeocode + else if ( + this.options.reverseGeocode && + /(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/.test(searchInput) + ) { + // parse coordinates + var coords = searchInput.split(/[\s(,)?]+/).map(function(c) { + return parseFloat(c, 10); + }).reverse(); + + // client only accepts one type for reverseGeocode, so + // use first config type if one, if not default to poi + config.types ? [config.types[0]] : ["poi"]; + config = extend(config, { query: coords, limit: 1 }); + + // drop proximity which may have been set by trackProximity since it's not supported by the reverseGeocoder + if ('proximity' in config) { + delete config.proximity; + } + + request = this.geocoderService.reverseGeocode(config).send(); + } else { + config = extend(config, { query: searchInput }); + request = this.geocoderService.forwardGeocode(config).send(); + } + + var localGeocoderRes = []; + if (this.options.localGeocoder) { + localGeocoderRes = this.options.localGeocoder(searchInput); + if (!localGeocoderRes) { + localGeocoderRes = []; + } + } + var externalGeocoderRes = []; + + request.catch(function(error){ + geocoderError = error; + }.bind(this)) + .then( + function(response) { + this._loadingEl.style.display = 'none'; + + var res = {}; + + if (!response){ + res = { + type: 'FeatureCollection', + features: [] + } + } else if (response.statusCode == '200') { + res = response.body; + res.request = response.request + res.headers = response.headers + } + + res.config = config; + + if (this.fresh){ + this.eventManager.start(this); + this.fresh = false; + } + + // supplement Mapbox Geocoding API results with locally populated results + res.features = res.features + ? localGeocoderRes.concat(res.features) + : localGeocoderRes; + + if (this.options.externalGeocoder) { + + externalGeocoderRes = this.options.externalGeocoder(searchInput, res.features) || []; + // supplement Mapbox Geocoding API results with features returned by a promise + return externalGeocoderRes.then(function(features) { + res.features = res.features ? features.concat(res.features) : features; + return res; + }, function(){ + // on error, display the original result + return res; + }); + } + return res; + + }.bind(this)).then( + function(res) { + if (geocoderError) { + throw geocoderError; + } + + // apply results filter if provided + if (this.options.filter && res.features.length) { + res.features = res.features.filter(this.options.filter); + } + + if (res.features.length) { + this._clearEl.style.display = 'block'; + this._eventEmitter.emit('results', res); + this._typeahead.update(res.features); + } else { + this._clearEl.style.display = 'none'; + this._typeahead.selected = null; + this._renderNoResults(); + this._eventEmitter.emit('results', res); + } + + }.bind(this) + ).catch( + function(err) { + this._loadingEl.style.display = 'none'; + + // in the event of an error in the Mapbox Geocoding API still display results from the localGeocoder + if ((localGeocoderRes.length && this.options.localGeocoder) || (externalGeocoderRes.length && this.options.externalGeocoder) ) { + this._clearEl.style.display = 'block'; + this._typeahead.update(localGeocoderRes); + } else { + this._clearEl.style.display = 'none'; + this._typeahead.selected = null; + this._renderError(); + } + + this._eventEmitter.emit('results', { features: localGeocoderRes }); + this._eventEmitter.emit('error', { error: err }); + }.bind(this) + ); + + return request; + }, + + /** + * Shared logic for clearing input + * @param {Event} [ev] the event that triggered the clear, if available + * @private + * + */ + _clear: function(ev) { + if (ev) ev.preventDefault(); + this._inputEl.value = ''; + this._typeahead.selected = null; + this._typeahead.clear(); + this._onChange(); + this._clearEl.style.display = 'none'; + this._removeMarker(); + this.lastSelected = null; + this._eventEmitter.emit('clear'); + this.fresh = true; + }, + + /** + * Clear and then focus the input. + * @param {Event} [ev] the event that triggered the clear, if available + * + */ + clear: function(ev) { + this._clear(ev); + this._inputEl.focus(); + }, + + + /** + * Clear the input, without refocusing it. Used to implement clearOnBlur + * constructor option. + * @param {Event} [ev] the blur event + * @private + */ + _clearOnBlur: function(ev) { + var ctx = this; + + /* + * If relatedTarget is not found, assume user targeted the suggestions list. + * In that case, do not clear on blur. There are other edge cases where + * ev.relatedTarget could be null. Clicking on list always results in null + * relatedtarget because of upstream behavior in `suggestions`. + * + * The ideal solution would be to check if ev.relatedTarget is a child of + * the list. See issue #258 for details on why we can't do that yet. + */ + if (ev.relatedTarget) { + ctx._clear(ev); + } + }, + + _onQueryResult: function(response) { + var results = response.body; + if (!results.features.length) return; + var result = results.features[0]; + this._typeahead.selected = result; + this._inputEl.value = result.place_name; + this._onChange(); + }, + + _updateProximity: function() { + // proximity is designed for local scale, if the user is looking at the whole world, + // it doesn't make sense to factor in the arbitrary centre of the map + if (!this._map){ + return; + } + if (this._map.getZoom() > 9) { + var center = this._map.getCenter().wrap(); + this.setProximity({ longitude: center.lng, latitude: center.lat }); + } else { + this.setProximity(null); + } + }, + + _collapse: function() { + // do not collapse if input is in focus + if (!this._inputEl.value && this._inputEl !== document.activeElement) this.container.classList.add('mapboxgl-ctrl-geocoder--collapsed'); + }, + + _unCollapse: function() { + this.container.classList.remove('mapboxgl-ctrl-geocoder--collapsed'); + }, + + /** + * Set & query the input + * @param {string} searchInput location name or other search input + * @returns {MapboxGeocoder} this + */ + query: function(searchInput) { + this._geocode(searchInput).then(this._onQueryResult); + return this; + }, + + _renderError: function(){ + var errorMessage = "
There was an error reaching the server
" + this._renderMessage(errorMessage); + }, + + _renderNoResults: function(){ + var errorMessage = "
No results found
"; + this._renderMessage(errorMessage); + }, + + _renderMessage: function(msg){ + this._typeahead.update([]); + this._typeahead.selected = null; + this._typeahead.clear(); + this._typeahead.renderError(msg); + }, + + /** + * Get the text to use as the search bar placeholder + * + * If placeholder is provided in options, then use options.placeholder + * Otherwise, if language is provided in options, then use the localized string of the first language if available + * Otherwise use the default + * + * @returns {String} the value to use as the search bar placeholder + * @private + */ + _getPlaceholderText: function(){ + if (this.options.placeholder) return this.options.placeholder; + if (this.options.language){ + var firstLanguage = this.options.language.split(",")[0]; + var language = subtag.language(firstLanguage); + var localizedValue = localization.placeholder[language]; + if (localizedValue) return localizedValue; + } + return 'Search'; + }, + + /** + * Set input + * @param {string} searchInput location name or other search input + * @returns {MapboxGeocoder} this + */ + setInput: function(searchInput) { + // Set input value to passed value and clear everything else. + this._inputEl.value = searchInput; + this._typeahead.selected = null; + this._typeahead.clear(); + if (searchInput.length >= this.options.minLength) { + this._geocode(searchInput); + } + return this; + }, + + /** + * Set proximity + * @param {Object} proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties. + * @returns {MapboxGeocoder} this + */ + setProximity: function(proximity) { + this.options.proximity = proximity; + return this; + }, + + /** + * Get proximity + * @returns {Object} The geocoder proximity + */ + getProximity: function() { + return this.options.proximity; + }, + + /** + * Set the render function used in the results dropdown + * @param {Function} fn The function to use as a render function. This function accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and returns a string. + * @returns {MapboxGeocoder} this + */ + setRenderFunction: function(fn){ + if (fn && typeof(fn) == "function"){ + this._typeahead.render = fn; + } + return this; + }, + + /** + * Get the function used to render the results dropdown + * + * @returns {Function} the render function + */ + getRenderFunction: function(){ + return this._typeahead.render; + }, + + /** + * Get the language to use in UI elements and when making search requests + * + * Look first at the explicitly set options otherwise use the browser's language settings + * @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. + * @returns {MapboxGeocoder} this + */ + setLanguage: function(language){ + var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage; + this.options.language = language || this.options.language || browserLocale; + return this; + }, + + /** + * Get the language to use in UI elements and when making search requests + * @returns {String} The language(s) used by the plugin, if any + */ + getLanguage: function(){ + return this.options.language; + }, + + /** + * Get the zoom level the map will move to when there is no bounding box on the selected result + * @returns {Number} the map zoom + */ + getZoom: function(){ + return this.options.zoom; + }, + + /** + * Set the zoom level + * @param {Number} zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`. + * @returns {MapboxGeocoder} this + */ + setZoom: function(zoom){ + this.options.zoom = zoom; + return this; + }, + + /** + * Get the parameters used to fly to the selected response, if any + * @returns {Boolean|Object} The `flyTo` option + */ + getFlyTo: function(){ + return this.options.flyTo; + }, + + /** + * Set the flyTo options + * @param {Boolean|Object} flyTo If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition. + */ + setFlyTo: function(flyTo){ + this.options.flyTo = flyTo; + return this; + }, + + /** + * Get the value of the placeholder string + * @returns {String} The input element's placeholder value + */ + getPlaceholder: function(){ + return this.options.placeholder; + }, + + /** + * Set the value of the input element's placeholder + * @param {String} placeholder the text to use as the input element's placeholder + * @returns {MapboxGeocoder} this + */ + setPlaceholder: function(placeholder){ + this.placeholder = (placeholder) ? placeholder : this._getPlaceholderText(); + this._inputEl.placeholder = this.placeholder; + this._inputEl.setAttribute('aria-label', this.placeholder); + return this + }, + + /** + * Get the bounding box used by the plugin + * @returns {Array} the bounding box, if any + */ + getBbox: function(){ + return this.options.bbox; + }, + + /** + * Set the bounding box to limit search results to + * @param {Array} bbox a bounding box given as an array in the format [minX, minY, maxX, maxY]. + * @returns {MapboxGeocoder} this + */ + setBbox: function(bbox){ + this.options.bbox = bbox; + return this; + }, + + /** + * Get a list of the countries to limit search results to + * @returns {String} a comma separated list of countries to limit to, if any + */ + getCountries: function(){ + return this.options.countries; + }, + + /** + * Set the countries to limit search results to + * @param {String} countries a comma separated list of countries to limit to + * @returns {MapboxGeocoder} this + */ + setCountries: function(countries){ + this.options.countries = countries; + return this; + }, + + /** + * Get a list of the types to limit search results to + * @returns {String} a comma separated list of types to limit to + */ + getTypes: function(){ + return this.options.types; + }, + + /** + * Set the types to limit search results to + * @param {String} countries a comma separated list of types to limit to + * @returns {MapboxGeocoder} this + */ + setTypes: function(types){ + this.options.types = types; + return this; + }, + + /** + * Get the minimum number of characters typed to trigger results used in the plugin + * @returns {Number} The minimum length in characters before a search is triggered + */ + getMinLength: function(){ + return this.options.minLength; + }, + + /** + * Set the minimum number of characters typed to trigger results used by the plugin + * @param {Number} minLength the minimum length in characters + * @returns {MapboxGeocoder} this + */ + setMinLength: function(minLength){ + this.options.minLength = minLength; + if (this._typeahead) this._typeahead.minLength = minLength; + return this; + }, + + /** + * Get the limit value for the number of results to display used by the plugin + * @returns {Number} The limit value for the number of results to display used by the plugin + */ + getLimit: function(){ + return this.options.limit; + }, + + /** + * Set the limit value for the number of results to display used by the plugin + * @param {Number} limit the number of search results to return + * @returns {MapboxGeocoder} + */ + setLimit: function(limit){ + this.options.limit = limit; + if (this._typeahead) this._typeahead.options.limit = limit; + return this; + }, + + /** + * Get the filter function used by the plugin + * @returns {Function} the filter function + */ + getFilter: function(){ + return this.options.filter; + }, + + /** + * Set the filter function used by the plugin. + * @param {Function} filter A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise. + * @returns {MapboxGeocoder} this + */ + setFilter: function(filter){ + this.options.filter = filter; + return this; + }, + + /** + * Set the geocoding endpoint used by the plugin. + * @param {Function} origin A function which accepts an HTTPS URL to specify the endpoint to query results from. + * @returns {MapboxGeocoder} this + */ + setOrigin: function(origin){ + this.options.origin = origin; + this.geocoderService = mbxGeocoder( + MapboxClient({ + accessToken: this.options.accessToken, + origin: this.options.origin + }) + ); + return this; + }, + + /** + * Get the geocoding endpoint the plugin is currently set to + * @returns {Function} the endpoint URL + */ + getOrigin: function(){ + return this.options.origin; + }, + + /** + * Handle the placement of a result marking the selected result + * @private + * @param {Object} selected the selected geojson feature + * @returns {MapboxGeocoder} this + */ + _handleMarker: function(selected){ + // clean up any old marker that might be present + if (!this._map){ + return; + } + this._removeMarker(); + var defaultMarkerOptions = { + color: '#4668F2' + } + var markerOptions = extend({}, defaultMarkerOptions, this.options.marker) + this.mapMarker = new this._mapboxgl.Marker(markerOptions); + if (selected.center) { + this.mapMarker + .setLngLat(selected.center) + .addTo(this._map); + } else if (selected.geometry && selected.geometry.type && selected.geometry.type === 'Point' && selected.geometry.coordinates) { + this.mapMarker + .setLngLat(selected.geometry.coordinates) + .addTo(this._map); + } + return this; + }, + + /** + * Handle the removal of a result marker + * @private + */ + _removeMarker: function(){ + if (this.mapMarker){ + this.mapMarker.remove(); + this.mapMarker = null; + } + }, + + /** + * Subscribe to events that happen within the plugin. + * @param {String} type name of event. Available events and the data passed into their respective event objects are: + * + * - __clear__ `Emitted when the input is cleared` + * - __loading__ `{ query } Emitted when the geocoder is looking up a query` + * - __results__ `{ results } Fired when the geocoder returns a response` + * - __result__ `{ result } Fired when input is set` + * - __error__ `{ error } Error as string` + * @param {Function} fn function that's called when the event is emitted. + * @returns {MapboxGeocoder} this; + */ + on: function(type, fn) { + this._eventEmitter.on(type, fn); + return this; + }, + + /** + * Remove an event + * @returns {MapboxGeocoder} this + * @param {String} type Event name. + * @param {Function} fn Function that should unsubscribe to the event emitted. + */ + off: function(type, fn) { + this._eventEmitter.removeListener(type, fn); + this.eventManager.remove(); + return this; + } +}; + +module.exports = MapboxGeocoder; + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A typeahead component for inputs + * @class Suggestions + * + * @param {HTMLInputElement} el A valid HTML input element + * @param {Array} data An array of data used for results + * @param {Object} options + * @param {Number} [options.limit=5] Max number of results to display in the auto suggest list. + * @param {Number} [options.minLength=2] Number of characters typed into an input to trigger suggestions. + * @param {Boolean} [options.hideOnBlur=true] If `true`, hides the suggestions when focus is lost. + * @return {Suggestions} `this` + * @example + * // in the browser + * var input = document.querySelector('input'); + * var data = [ + * 'Roy Eldridge', + * 'Roy Hargrove', + * 'Rex Stewart' + * ]; + * + * new Suggestions(input, data); + * + * // with options + * var input = document.querySelector('input'); + * var data = [{ + * name: 'Roy Eldridge', + * year: 1911 + * }, { + * name: 'Roy Hargrove', + * year: 1969 + * }, { + * name: 'Rex Stewart', + * year: 1907 + * }]; + * + * var typeahead = new Suggestions(input, data, { + * filter: false, // Disable filtering + * minLength: 3, // Number of characters typed into an input to trigger suggestions. + * limit: 3, // Max number of results to display. + * hideOnBlur: false // Don't hide results when input loses focus + * }); + * + * // As we're passing an object of an arrays as data, override + * // `getItemValue` by specifying the specific property to search on. + * typeahead.getItemValue = function(item) { return item.name }; + * + * input.addEventListener('change', function() { + * console.log(typeahead.selected); // Current selected item. + * }); + * + * // With browserify + * var Suggestions = require('suggestions'); + * + * new Suggestions(input, data); + */ +var Suggestions = __webpack_require__(156); +window.Suggestions = module.exports = Suggestions; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var extend = __webpack_require__(37); +var fuzzy = __webpack_require__(157); +var List = __webpack_require__(158); + +var Suggestions = function(el, data, options) { + options = options || {}; + + this.options = extend({ + minLength: 2, + limit: 5, + filter: true, + hideOnBlur: true + }, options); + + this.el = el; + this.data = data || []; + this.list = new List(this); + + this.query = ''; + this.selected = null; + + this.list.draw(); + + this.el.addEventListener('keyup', function(e) { + this.handleKeyUp(e.keyCode); + }.bind(this), false); + + this.el.addEventListener('keydown', function(e) { + this.handleKeyDown(e); + }.bind(this)); + + this.el.addEventListener('focus', function() { + this.handleFocus(); + }.bind(this)); + + this.el.addEventListener('blur', function() { + this.handleBlur(); + }.bind(this)); + + this.el.addEventListener('paste', function(e) { + this.handlePaste(e); + }.bind(this)); + + // use user-provided render function if given, otherwise just use the default + this.render = (this.options.render) ? this.options.render.bind(this) : this.render.bind(this) + + this.getItemValue = (this.options.getItemValue) ? this.options.getItemValue.bind(this) : this.getItemValue.bind(this); + + return this; +}; + +Suggestions.prototype.handleKeyUp = function(keyCode) { + // 40 - DOWN + // 38 - UP + // 27 - ESC + // 13 - ENTER + // 9 - TAB + + if (keyCode === 40 || + keyCode === 38 || + keyCode === 27 || + keyCode === 13 || + keyCode === 9) return; + + this.handleInputChange(this.el.value); +}; + +Suggestions.prototype.handleKeyDown = function(e) { + switch (e.keyCode) { + case 13: // ENTER + case 9: // TAB + if (!this.list.isEmpty()) { + if (this.list.isVisible()) { + e.preventDefault(); + } + this.value(this.list.items[this.list.active].original); + this.list.hide(); + } + break; + case 27: // ESC + if (!this.list.isEmpty()) this.list.hide(); + break; + case 38: // UP + this.list.previous(); + break; + case 40: // DOWN + this.list.next(); + break; + } +}; + +Suggestions.prototype.handleBlur = function() { + if (!this.list.selectingListItem && this.options.hideOnBlur) { + this.list.hide(); + } +}; + +Suggestions.prototype.handlePaste = function(e) { + if (e.clipboardData) { + this.handleInputChange(e.clipboardData.getData('Text')); + } else { + var self = this; + setTimeout(function () { + self.handleInputChange(e.target.value); + }, 100); + } +}; + +Suggestions.prototype.handleInputChange = function(query) { + this.query = this.normalize(query); + + this.list.clear(); + + if (this.query.length < this.options.minLength) { + this.list.draw(); + return; + } + + this.getCandidates(function(data) { + for (var i = 0; i < data.length; i++) { + this.list.add(data[i]); + if (i === (this.options.limit - 1)) break; + } + this.list.draw(); + }.bind(this)); +}; + +Suggestions.prototype.handleFocus = function() { + if (!this.list.isEmpty()) this.list.show(); + this.list.selectingListItem = false; +}; + +/** + * Update data previously passed + * + * @param {Array} revisedData + */ +Suggestions.prototype.update = function(revisedData) { + this.data = revisedData; + this.handleKeyUp(); +}; + +/** + * Clears data + */ +Suggestions.prototype.clear = function() { + this.data = []; + this.list.clear(); +}; + +/** + * Normalize the results list and input value for matching + * + * @param {String} value + * @return {String} + */ +Suggestions.prototype.normalize = function(value) { + value = value.toLowerCase(); + return value; +}; + +/** + * Evaluates whether an array item qualifies as a match with the current query + * + * @param {String} candidate a possible item from the array passed + * @param {String} query the current query + * @return {Boolean} + */ +Suggestions.prototype.match = function(candidate, query) { + return candidate.indexOf(query) > -1; +}; + +Suggestions.prototype.value = function(value) { + this.selected = value; + this.el.value = this.getItemValue(value); + + if (document.createEvent) { + var e = document.createEvent('HTMLEvents'); + e.initEvent('change', true, false); + this.el.dispatchEvent(e); + } else { + this.el.fireEvent('onchange'); + } +}; + +Suggestions.prototype.getCandidates = function(callback) { + var options = { + pre: '', + post: '', + extract: function(d) { return this.getItemValue(d); }.bind(this) + }; + var results; + if(this.options.filter){ + results = fuzzy.filter(this.query, this.data, options); + + results = results.map(function(item){ + return { + original: item.original, + string: this.render(item.original, item.string) + }; + }.bind(this)) + }else{ + results = this.data.map(function(d) { + var renderedString = this.render(d); + return { + original: d, + string: renderedString + }; + }.bind(this)); + } + callback(results); +}; + +/** + * For a given item in the data array, return what should be used as the candidate string + * + * @param {Object|String} item an item from the data array + * @return {String} item + */ +Suggestions.prototype.getItemValue = function(item) { + return item; +}; + +/** + * For a given item in the data array, return a string of html that should be rendered in the dropdown + * @param {Object|String} item an item from the data array + * @param {String} sourceFormatting a string that has pre-formatted html that should be passed directly through the render function + * @return {String} html + */ +Suggestions.prototype.render = function(item, sourceFormatting) { + if (sourceFormatting){ + // use existing formatting on the source string + return sourceFormatting; + } + var boldString = (item.original) ? this.getItemValue(item.original) : this.getItemValue(item); + var indexString = this.normalize(boldString); + var indexOfQuery = indexString.lastIndexOf(this.query); + while (indexOfQuery > -1) { + var endIndexOfQuery = indexOfQuery + this.query.length; + boldString = boldString.slice(0, indexOfQuery) + '' + boldString.slice(indexOfQuery, endIndexOfQuery) + '' + boldString.slice(endIndexOfQuery); + indexOfQuery = indexString.slice(0, indexOfQuery).lastIndexOf(this.query); + } + return boldString +} + +/** + * Render an custom error message in the suggestions list + * @param {String} msg An html string to render as an error message + */ +Suggestions.prototype.renderError = function(msg){ + this.list.drawError(msg); +} + +module.exports = Suggestions; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + * Fuzzy + * https://github.com/myork/fuzzy + * + * Copyright (c) 2012 Matt York + * Licensed under the MIT license. + */ + +(function() { + +var root = this; + +var fuzzy = {}; + +// Use in node or in browser +if (true) { + module.exports = fuzzy; +} else { + root.fuzzy = fuzzy; +} + +// Return all elements of `array` that have a fuzzy +// match against `pattern`. +fuzzy.simpleFilter = function(pattern, array) { + return array.filter(function(str) { + return fuzzy.test(pattern, str); + }); +}; + +// Does `pattern` fuzzy match `str`? +fuzzy.test = function(pattern, str) { + return fuzzy.match(pattern, str) !== null; +}; + +// If `pattern` matches `str`, wrap each matching character +// in `opts.pre` and `opts.post`. If no match, return null +fuzzy.match = function(pattern, str, opts) { + opts = opts || {}; + var patternIdx = 0 + , result = [] + , len = str.length + , totalScore = 0 + , currScore = 0 + // prefix + , pre = opts.pre || '' + // suffix + , post = opts.post || '' + // String to compare against. This might be a lowercase version of the + // raw string + , compareString = opts.caseSensitive && str || str.toLowerCase() + , ch; + + pattern = opts.caseSensitive && pattern || pattern.toLowerCase(); + + // For each character in the string, either add it to the result + // or wrap in template if it's the next string in the pattern + for(var idx = 0; idx < len; idx++) { + ch = str[idx]; + if(compareString[idx] === pattern[patternIdx]) { + ch = pre + ch + post; + patternIdx += 1; + + // consecutive characters should increase the score more than linearly + currScore += 1 + currScore; + } else { + currScore = 0; + } + totalScore += currScore; + result[result.length] = ch; + } + + // return rendered string if we have a match for every char + if(patternIdx === pattern.length) { + // if the string is an exact match with pattern, totalScore should be maxed + totalScore = (compareString === pattern) ? Infinity : totalScore; + return {rendered: result.join(''), score: totalScore}; + } + + return null; +}; + +// The normal entry point. Filters `arr` for matches against `pattern`. +// It returns an array with matching values of the type: +// +// [{ +// string: 'lah' // The rendered string +// , index: 2 // The index of the element in `arr` +// , original: 'blah' // The original element in `arr` +// }] +// +// `opts` is an optional argument bag. Details: +// +// opts = { +// // string to put before a matching character +// pre: '' +// +// // string to put after matching character +// , post: '' +// +// // Optional function. Input is an entry in the given arr`, +// // output should be the string to test `pattern` against. +// // In this example, if `arr = [{crying: 'koala'}]` we would return +// // 'koala'. +// , extract: function(arg) { return arg.crying; } +// } +fuzzy.filter = function(pattern, arr, opts) { + if(!arr || arr.length === 0) { + return []; + } + if (typeof pattern !== 'string') { + return arr; + } + opts = opts || {}; + return arr + .reduce(function(prev, element, idx, arr) { + var str = element; + if(opts.extract) { + str = opts.extract(element); + } + var rendered = fuzzy.match(pattern, str, opts); + if(rendered != null) { + prev[prev.length] = { + string: rendered.rendered + , score: rendered.score + , index: idx + , original: element + }; + } + return prev; + }, []) + + // Sort by score. Browsers are inconsistent wrt stable/unstable + // sorting, so force stable by using the index in the case of tie. + // See http://ofb.net/~sethml/is-sort-stable.html + .sort(function(a,b) { + var compare = b.score - a.score; + if(compare) return compare; + return a.index - b.index; + }); +}; + + +}()); + + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var List = function(component) { + this.component = component; + this.items = []; + this.active = 0; + this.wrapper = document.createElement('div'); + this.wrapper.className = 'suggestions-wrapper'; + this.element = document.createElement('ul'); + this.element.className = 'suggestions'; + this.wrapper.appendChild(this.element); + + // selectingListItem is set to true in the time between the mousedown and mouseup when clicking an item in the list + // mousedown on a list item will cause the input to blur which normally hides the list, so this flag is used to keep + // the list open until the mouseup + this.selectingListItem = false; + + component.el.parentNode.insertBefore(this.wrapper, component.el.nextSibling); + return this; +}; + +List.prototype.show = function() { + this.element.style.display = 'block'; +}; + +List.prototype.hide = function() { + this.element.style.display = 'none'; +}; + +List.prototype.add = function(item) { + this.items.push(item); +}; + +List.prototype.clear = function() { + this.items = []; + this.active = 0; +}; + +List.prototype.isEmpty = function() { + return !this.items.length; +}; + +List.prototype.isVisible = function() { + return this.element.style.display === 'block'; +}; + +List.prototype.draw = function() { + this.element.innerHTML = ''; + + if (this.items.length === 0) { + this.hide(); + return; + } + + for (var i = 0; i < this.items.length; i++) { + this.drawItem(this.items[i], this.active === i); + } + + this.show(); +}; + +List.prototype.drawItem = function(item, active) { + var li = document.createElement('li'), + a = document.createElement('a'); + + if (active) li.className += ' active'; + + a.innerHTML = item.string; + + li.appendChild(a); + this.element.appendChild(li); + + li.addEventListener('mousedown', function() { + this.selectingListItem = true; + }.bind(this)); + + li.addEventListener('mouseup', function() { + this.handleMouseUp.call(this, item); + }.bind(this)); +}; + +List.prototype.handleMouseUp = function(item) { + this.selectingListItem = false; + this.component.value(item.original); + this.clear(); + this.draw(); +}; + +List.prototype.move = function(index) { + this.active = index; + this.draw(); +}; + +List.prototype.previous = function() { + this.move(this.active === 0 ? this.items.length - 1 : this.active - 1); +}; + +List.prototype.next = function() { + this.move(this.active === this.items.length - 1 ? 0 : this.active + 1); +}; + +List.prototype.drawError = function(msg){ + var li = document.createElement('li'); + + li.innerHTML = msg; + + this.element.appendChild(li); + this.show(); +} + +module.exports = List; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = debounce; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + +module.exports = { + 'fr': { + 'name': 'France', + 'bbox': [[-4.59235, 41.380007], [9.560016, 51.148506]] + }, + 'us': { + 'name': 'United States', + 'bbox': [[-171.791111, 18.91619], [-66.96466, 71.357764]] + }, + 'ru': { + 'name': 'Russia', + 'bbox': [[19.66064, 41.151416], [190.10042, 81.2504]] + }, + 'ca': { + 'name': 'Canada', + 'bbox': [[-140.99778, 41.675105], [-52.648099, 83.23324]] + } +}; + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var client = __webpack_require__(69); + +module.exports = client; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var MapiResponse = __webpack_require__(163); +var MapiError = __webpack_require__(165); +var constants = __webpack_require__(45); +var parseHeaders = __webpack_require__(166); + +// Keys are request IDs, values are XHRs. +var requestsUnderway = {}; + +function browserAbort(request) { + var xhr = requestsUnderway[request.id]; + if (!xhr) return; + xhr.abort(); + delete requestsUnderway[request.id]; +} + +function createResponse(request, xhr) { + return new MapiResponse(request, { + body: xhr.response, + headers: parseHeaders(xhr.getAllResponseHeaders()), + statusCode: xhr.status + }); +} + +function normalizeBrowserProgressEvent(event) { + var total = event.total; + var transferred = event.loaded; + var percent = (100 * transferred) / total; + return { + total: total, + transferred: transferred, + percent: percent + }; +} + +function sendRequestXhr(request, xhr) { + return new Promise(function(resolve, reject) { + xhr.onprogress = function(event) { + request.emitter.emit( + constants.EVENT_PROGRESS_DOWNLOAD, + normalizeBrowserProgressEvent(event) + ); + }; + + var file = request.file; + if (file) { + xhr.upload.onprogress = function(event) { + request.emitter.emit( + constants.EVENT_PROGRESS_UPLOAD, + normalizeBrowserProgressEvent(event) + ); + }; + } + + xhr.onerror = function(error) { + reject(error); + }; + + xhr.onabort = function() { + var mapiError = new MapiError({ + request: request, + type: constants.ERROR_REQUEST_ABORTED + }); + reject(mapiError); + }; + + xhr.onload = function() { + delete requestsUnderway[request.id]; + if (xhr.status < 200 || xhr.status >= 400) { + var mapiError = new MapiError({ + request: request, + body: xhr.response, + statusCode: xhr.status + }); + reject(mapiError); + return; + } + resolve(xhr); + }; + + var body = request.body; + + // matching service needs to send a www-form-urlencoded request + if (typeof body === 'string') { + xhr.send(body); + } else if (body) { + xhr.send(JSON.stringify(body)); + } else if (file) { + xhr.send(file); + } else { + xhr.send(); + } + + requestsUnderway[request.id] = xhr; + }).then(function(xhr) { + return createResponse(request, xhr); + }); +} + +// The accessToken argument gives this function flexibility +// for Mapbox's internal client. +function createRequestXhr(request, accessToken) { + var url = request.url(accessToken); + var xhr = new window.XMLHttpRequest(); + xhr.open(request.method, url); + Object.keys(request.headers).forEach(function(key) { + xhr.setRequestHeader(key, request.headers[key]); + }); + return xhr; +} + +function browserSend(request) { + return Promise.resolve().then(function() { + var xhr = createRequestXhr(request, request.client.accessToken); + return sendRequestXhr(request, xhr); + }); +} + +module.exports = { + browserAbort: browserAbort, + sendRequestXhr: sendRequestXhr, + browserSend: browserSend, + createRequestXhr: createRequestXhr +}; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var parseLinkHeader = __webpack_require__(164); + +/** + * A Mapbox API response. + * + * @class MapiResponse + * @property {Object} body - The response body, parsed as JSON. + * @property {string} rawBody - The raw response body. + * @property {number} statusCode - The response's status code. + * @property {Object} headers - The parsed response headers. + * @property {Object} links - The parsed response links. + * @property {MapiRequest} request - The response's originating `MapiRequest`. + */ + +/** + * @ignore + * @param {MapiRequest} request + * @param {Object} responseData + * @param {Object} responseData.headers + * @param {string} responseData.body + * @param {number} responseData.statusCode + */ +function MapiResponse(request, responseData) { + this.request = request; + this.headers = responseData.headers; + this.rawBody = responseData.body; + this.statusCode = responseData.statusCode; + try { + this.body = JSON.parse(responseData.body || '{}'); + } catch (parseError) { + this.body = responseData.body; + } + this.links = parseLinkHeader(this.headers.link); +} + +/** + * Check if there is a next page that you can fetch. + * + * @returns {boolean} + */ +MapiResponse.prototype.hasNextPage = function hasNextPage() { + return !!this.links.next; +}; + +/** + * Create a request for the next page, if there is one. + * If there is no next page, returns `null`. + * + * @returns {MapiRequest | null} + */ +MapiResponse.prototype.nextPage = function nextPage() { + if (!this.hasNextPage()) return null; + return this.request._extend({ + path: this.links.next.url + }); +}; + +module.exports = MapiResponse; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Like https://github.com/thlorenz/lib/parse-link-header but without any +// additional dependencies. + +function parseParam(param) { + var parts = param.match(/\s*(.+)\s*=\s*"?([^"]+)"?/); + if (!parts) return null; + + return { + key: parts[1], + value: parts[2] + }; +} + +function parseLink(link) { + var parts = link.match(/]*)>(.*)/); + if (!parts) return null; + + var linkUrl = parts[1]; + var linkParams = parts[2].split(';'); + var rel = null; + var parsedLinkParams = linkParams.reduce(function(result, param) { + var parsed = parseParam(param); + if (!parsed) return result; + if (parsed.key === 'rel') { + if (!rel) { + rel = parsed.value; + } + return result; + } + result[parsed.key] = parsed.value; + return result; + }, {}); + if (!rel) return null; + + return { + url: linkUrl, + rel: rel, + params: parsedLinkParams + }; +} + +/** + * Parse a Link header. + * + * @param {string} linkHeader + * @returns {{ + * [string]: { + * url: string, + * params: { [string]: string } + * } + * }} + */ +function parseLinkHeader(linkHeader) { + if (!linkHeader) return {}; + + return linkHeader.split(/,\s*> (-2 * bitCounter & 6) + ); + } + } + return output; + }; + + // `encode` is designed to be fully compatible with `btoa` as described in the + // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa + var encode = function(input) { + input = String(input); + if (/[^\0-\xFF]/.test(input)) { + // Note: no need to special-case astral symbols here, as surrogates are + // matched, and the input is supposed to only contain ASCII anyway. + error( + 'The string to be encoded contains characters outside of the ' + + 'Latin1 range.' + ); + } + var padding = input.length % 3; + var output = ''; + var position = -1; + var a; + var b; + var c; + var d; + var buffer; + // Make sure any padding is handled outside of the loop. + var length = input.length - padding; + + while (++position < length) { + // Read three bytes, i.e. 24 bits. + a = input.charCodeAt(position) << 16; + b = input.charCodeAt(++position) << 8; + c = input.charCodeAt(++position); + buffer = a + b + c; + // Turn the 24 bits into four chunks of 6 bits each, and append the + // matching character for each of them to the output. + output += ( + TABLE.charAt(buffer >> 18 & 0x3F) + + TABLE.charAt(buffer >> 12 & 0x3F) + + TABLE.charAt(buffer >> 6 & 0x3F) + + TABLE.charAt(buffer & 0x3F) + ); + } + + if (padding == 2) { + a = input.charCodeAt(position) << 8; + b = input.charCodeAt(++position); + buffer = a + b; + output += ( + TABLE.charAt(buffer >> 10) + + TABLE.charAt((buffer >> 4) & 0x3F) + + TABLE.charAt((buffer << 2) & 0x3F) + + '=' + ); + } else if (padding == 1) { + buffer = input.charCodeAt(position); + output += ( + TABLE.charAt(buffer >> 2) + + TABLE.charAt((buffer << 4) & 0x3F) + + '==' + ); + } + + return output; + }; + + var base64 = { + 'encode': encode, + 'decode': decode, + 'version': '0.1.0' + }; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return base64; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = base64; + } else { // in Narwhal or RingoJS v0.7.0- + for (var key in base64) { + base64.hasOwnProperty(key) && (freeExports[key] = base64[key]); + } + } + } else { // in Rhino or a web browser + root.base64 = base64; + } + +}(this)); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), __webpack_require__(5))) + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var parseToken = __webpack_require__(71); +var xtend = __webpack_require__(37); +var EventEmitter = __webpack_require__(169); +var urlUtils = __webpack_require__(170); +var constants = __webpack_require__(45); + +var requestId = 1; + +/** + * A Mapbox API request. + * + * Note that creating a `MapiRequest` does *not* send the request automatically. + * Use the request's `send` method to send it off and get a `Promise`. + * + * The `emitter` property is an `EventEmitter` that emits the following events: + * + * - `'response'` - Listeners will be called with a `MapiResponse`. + * - `'error'` - Listeners will be called with a `MapiError`. + * - `'downloadProgress'` - Listeners will be called with `ProgressEvents`. + * - `'uploadProgress'` - Listeners will be called with `ProgressEvents`. + * Upload events are only available when the request includes a file. + * + * @class MapiRequest + * @property {EventEmitter} emitter - An event emitter. See above. + * @property {MapiClient} client - This request's `MapiClient`. + * @property {MapiResponse|null} response - If this request has been sent and received + * a response, the response is available on this property. + * @property {MapiError|Error|null} error - If this request has been sent and + * received an error in response, the error is available on this property. + * @property {boolean} aborted - If the request has been aborted + * (via [`abort`](#abort)), this property will be `true`. + * @property {boolean} sent - If the request has been sent, this property will + * be `true`. You cannot send the same request twice, so if you need to create + * a new request that is the equivalent of an existing one, use + * [`clone`](#clone). + * @property {string} path - The request's path, including colon-prefixed route + * parameters. + * @property {string} origin - The request's origin. + * @property {string} method - The request's HTTP method. + * @property {Object} query - A query object, which will be transformed into + * a URL query string. + * @property {Object} params - A route parameters object, whose values will + * be interpolated the path. + * @property {Object} headers - The request's headers. + * @property {Object|string|null} body - Data to send with the request. + * If the request has a body, it will also be sent with the header + * `'Content-Type: application/json'`. + * @property {Blob|ArrayBuffer|string|ReadStream} file - A file to + * send with the request. The browser client accepts Blobs and ArrayBuffers; + * the Node client accepts strings (filepaths) and ReadStreams. + * @property {string} encoding - The encoding of the response. + * @property {string} sendFileAs - The method to send the `file`. Options are + * `data` (x-www-form-urlencoded) or `form` (multipart/form-data). + */ + +/** + * @ignore + * @param {MapiClient} client + * @param {Object} options + * @param {string} options.method + * @param {string} options.path + * @param {Object} [options.query={}] + * @param {Object} [options.params={}] + * @param {string} [options.origin] + * @param {Object} [options.headers] + * @param {Object} [options.body=null] + * @param {Blob|ArrayBuffer|string|ReadStream} [options.file=null] + * @param {string} [options.encoding=utf8] + */ +function MapiRequest(client, options) { + if (!client) { + throw new Error('MapiRequest requires a client'); + } + if (!options || !options.path || !options.method) { + throw new Error( + 'MapiRequest requires an options object with path and method properties' + ); + } + + var defaultHeaders = {}; + if (options.body) { + defaultHeaders['content-type'] = 'application/json'; + } + + var headersWithDefaults = xtend(defaultHeaders, options.headers); + + // Disallows duplicate header names of mixed case, + // e.g. Content-Type and content-type. + var headers = Object.keys(headersWithDefaults).reduce(function(memo, name) { + memo[name.toLowerCase()] = headersWithDefaults[name]; + return memo; + }, {}); + + this.id = requestId++; + this._options = options; + + this.emitter = new EventEmitter(); + this.client = client; + this.response = null; + this.error = null; + this.sent = false; + this.aborted = false; + this.path = options.path; + this.method = options.method; + this.origin = options.origin || client.origin; + this.query = options.query || {}; + this.params = options.params || {}; + this.body = options.body || null; + this.file = options.file || null; + this.encoding = options.encoding || 'utf8'; + this.sendFileAs = options.sendFileAs || null; + this.headers = headers; +} + +/** + * Get the URL of the request. + * + * @param {string} [accessToken] - By default, the access token of the request's + * client is used. + * @return {string} + */ +MapiRequest.prototype.url = function url(accessToken) { + var url = urlUtils.prependOrigin(this.path, this.origin); + url = urlUtils.appendQueryObject(url, this.query); + var routeParams = this.params; + var actualAccessToken = + accessToken == null ? this.client.accessToken : accessToken; + if (actualAccessToken) { + url = urlUtils.appendQueryParam(url, 'access_token', actualAccessToken); + var accessTokenOwnerId = parseToken(actualAccessToken).user; + routeParams = xtend({ ownerId: accessTokenOwnerId }, routeParams); + } + url = urlUtils.interpolateRouteParams(url, routeParams); + return url; +}; + +/** + * Send the request. Returns a Promise that resolves with a `MapiResponse`. + * You probably want to use `response.body`. + * + * `send` only retrieves the first page of paginated results. You can get + * the next page by using the `MapiResponse`'s [`nextPage`](#nextpage) + * function, or iterate through all pages using [`eachPage`](#eachpage) + * instead of `send`. + * + * @returns {Promise} + */ +MapiRequest.prototype.send = function send() { + var self = this; + + if (self.sent) { + throw new Error( + 'This request has already been sent. Check the response and error properties. Create a new request with clone().' + ); + } + self.sent = true; + + return self.client.sendRequest(self).then( + function(response) { + self.response = response; + self.emitter.emit(constants.EVENT_RESPONSE, response); + return response; + }, + function(error) { + self.error = error; + self.emitter.emit(constants.EVENT_ERROR, error); + throw error; + } + ); +}; + +/** + * Abort the request. + * + * Any pending `Promise` returned by [`send`](#send) will be rejected with + * an error with `type: 'RequestAbortedError'`. If you've created a request + * that might be aborted, you need to catch and handle such errors. + * + * This method will also abort any requests created while fetching subsequent + * pages via [`eachPage`](#eachpage). + * + * If the request has not been sent or has already been aborted, nothing + * will happen. + */ +MapiRequest.prototype.abort = function abort() { + if (this._nextPageRequest) { + this._nextPageRequest.abort(); + delete this._nextPageRequest; + } + + if (this.response || this.error || this.aborted) return; + + this.aborted = true; + this.client.abortRequest(this); +}; + +/** + * Invoke a callback for each page of a paginated API response. + * + * The callback should have the following signature: + * + * ```js + * ( + * error: MapiError, + * response: MapiResponse, + * next: () => void + * ) => void + * ``` + * + * **The next page will not be fetched until you've invoked the + * `next` callback**, indicating that you're ready for it. + * + * @param {Function} callback + */ +MapiRequest.prototype.eachPage = function eachPage(callback) { + var self = this; + + function handleResponse(response) { + function getNextPage() { + delete self._nextPageRequest; + var nextPageRequest = response.nextPage(); + if (nextPageRequest) { + self._nextPageRequest = nextPageRequest; + getPage(nextPageRequest); + } + } + callback(null, response, getNextPage); + } + + function handleError(error) { + callback(error, null, function() {}); + } + + function getPage(request) { + request.send().then(handleResponse, handleError); + } + getPage(this); +}; + +/** + * Clone this request. + * + * Each request can only be sent *once*. So if you'd like to send the + * same request again, clone it and send away. + * + * @returns {MapiRequest} - A new `MapiRequest` configured just like this one. + */ +MapiRequest.prototype.clone = function clone() { + return this._extend(); +}; + +/** + * @ignore + */ +MapiRequest.prototype._extend = function _extend(options) { + var extendedOptions = xtend(this._options, options); + return new MapiRequest(this.client, extendedOptions); +}; + +module.exports = MapiRequest; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Encode each item of an array individually. The comma +// delimiters should not themselves be encoded. +function encodeArray(arrayValue) { + return arrayValue.map(encodeURIComponent).join(','); +} + +function encodeValue(value) { + if (Array.isArray(value)) { + return encodeArray(value); + } + return encodeURIComponent(String(value)); +} + +/** + * Append a query parameter to a URL. + * + * @param {string} url + * @param {string} key + * @param {string|number|boolean|Array<*>>} [value] - Provide an array + * if the value is a list and commas between values need to be + * preserved, unencoded. + * @returns {string} - Modified URL. + */ +function appendQueryParam(url, key, value) { + if (value === false || value === null) { + return url; + } + var punctuation = /\?/.test(url) ? '&' : '?'; + var query = encodeURIComponent(key); + if (value !== undefined && value !== '' && value !== true) { + query += '=' + encodeValue(value); + } + return '' + url + punctuation + query; +} + +/** + * Derive a query string from an object and append it + * to a URL. + * + * @param {string} url + * @param {Object} [queryObject] - Values should be primitives. + * @returns {string} - Modified URL. + */ +function appendQueryObject(url, queryObject) { + if (!queryObject) { + return url; + } + + var result = url; + Object.keys(queryObject).forEach(function(key) { + var value = queryObject[key]; + if (value === undefined) { + return; + } + if (Array.isArray(value)) { + value = value + .filter(function(v) { + return v !== null && v !== undefined; + }) + .join(','); + } + result = appendQueryParam(result, key, value); + }); + return result; +} + +/** + * Prepend an origin to a URL. If the URL already has an + * origin, do nothing. + * + * @param {string} url + * @param {string} origin + * @returns {string} - Modified URL. + */ +function prependOrigin(url, origin) { + if (!origin) { + return url; + } + + if (url.slice(0, 4) === 'http') { + return url; + } + + var delimiter = url[0] === '/' ? '' : '/'; + return '' + origin.replace(/\/$/, '') + delimiter + url; +} + +/** + * Interpolate values into a route with express-style, + * colon-prefixed route parameters. + * + * @param {string} route + * @param {Object} [params] - Values should be primitives + * or arrays of primitives. Provide an array if the value + * is a list and commas between values need to be + * preserved, unencoded. + * @returns {string} - Modified URL. + */ +function interpolateRouteParams(route, params) { + if (!params) { + return route; + } + return route.replace(/\/:([a-zA-Z0-9]+)/g, function(_, paramId) { + var value = params[paramId]; + if (value === undefined) { + throw new Error('Unspecified route parameter ' + paramId); + } + var preppedValue = encodeValue(value); + return '/' + preppedValue; + }); +} + +module.exports = { + appendQueryObject: appendQueryObject, + appendQueryParam: appendQueryParam, + prependOrigin: prependOrigin, + interpolateRouteParams: interpolateRouteParams +}; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var xtend = __webpack_require__(37); +var v = __webpack_require__(172); +var pick = __webpack_require__(175); +var stringifyBooleans = __webpack_require__(176); +var createServiceFactory = __webpack_require__(178); + +/** + * Geocoding API service. + * + * Learn more about this service and its responses in + * [the HTTP service documentation](https://docs.mapbox.com/api/search/#geocoding). + */ +var Geocoding = {}; + +var featureTypes = [ + 'country', + 'region', + 'postcode', + 'district', + 'place', + 'locality', + 'neighborhood', + 'address', + 'poi', + 'poi.landmark' +]; + +/** + * Search for a place. + * + * See the [public documentation](https://docs.mapbox.com/api/search/#forward-geocoding). + * + * @param {Object} config + * @param {string} config.query - A place name. + * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode="mapbox.places"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding. + * @param {Array} [config.countries] - Limits results to the specified countries. + * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + * @param {Coordinates} [config.proximity] - Bias local results based on a provided location. + * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types. + * @param {boolean} [config.autocomplete=true] - Return autocomplete results or not. + * @param {BoundingBox} [config.bbox] - Limit results to a bounding box. + * @param {number} [config.limit=5] - Limit the number of results returned. + * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting. + * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory + * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script. + * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features. + * @return {MapiRequest} + * + * @example + * geocodingClient.forwardGeocode({ + * query: 'Paris, France', + * limit: 2 + * }) + * .send() + * .then(response => { + * const match = response.body; + * }); + * + * @example + * // geocoding with proximity + * geocodingClient.forwardGeocode({ + * query: 'Paris, France', + * proximity: [-95.4431142, 33.6875431] + * }) + * .send() + * .then(response => { + * const match = response.body; + * }); + * + * // geocoding with countries + * geocodingClient.forwardGeocode({ + * query: 'Paris, France', + * countries: ['fr'] + * }) + * .send() + * .then(response => { + * const match = response.body; + * }); + * + * // geocoding with bounding box + * geocodingClient.forwardGeocode({ + * query: 'Paris, France', + * bbox: [2.14, 48.72, 2.55, 48.96] + * }) + * .send() + * .then(response => { + * const match = response.body; + * }); + */ +Geocoding.forwardGeocode = function(config) { + v.assertShape({ + query: v.required(v.string), + mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'), + countries: v.arrayOf(v.string), + proximity: v.coordinates, + types: v.arrayOf(v.oneOf(featureTypes)), + autocomplete: v.boolean, + bbox: v.arrayOf(v.number), + limit: v.number, + language: v.arrayOf(v.string), + routing: v.boolean + })(config); + + config.mode = config.mode || 'mapbox.places'; + + var query = stringifyBooleans( + xtend( + { country: config.countries }, + pick(config, [ + 'proximity', + 'types', + 'autocomplete', + 'bbox', + 'limit', + 'language', + 'routing' + ]) + ) + ); + + return this.client.createRequest({ + method: 'GET', + path: '/geocoding/v5/:mode/:query.json', + params: pick(config, ['mode', 'query']), + query: query + }); +}; + +/** + * Search for places near coordinates. + * + * See the [public documentation](https://docs.mapbox.com/api/search/#reverse-geocoding). + * + * @param {Object} config + * @param {Coordinates} config.query - Coordinates at which features will be searched. + * @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode="mapbox.places"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding. + * @param {Array} [config.countries] - Limits results to the specified countries. + * Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + * @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types. + * @param {BoundingBox} [config.bbox] - Limit results to a bounding box. + * @param {number} [config.limit=1] - Limit the number of results returned. If using this option, you must provide a single item for `types`. + * @param {Array} [config.language] - Specify the language to use for response text and, for forward geocoding, query result weighting. + * Options are [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) comprised of a mandatory + * [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and optionally one or more IETF subtags for country or script. + * @param {'distance'|'score'} [config.reverseMode='distance'] - Set the factors that are used to sort nearby results. + * @param {boolean} [config.routing=false] - Specify whether to request additional metadata about the recommended navigation destination. Only applicable for address features. + * @return {MapiRequest} + * + * @example + * geocodingClient.reverseGeocode({ + * query: [-95.4431142, 33.6875431] + * }) + * .send() + * .then(response => { + * // GeoJSON document with geocoding matches + * const match = response.body; + * }); + */ +Geocoding.reverseGeocode = function(config) { + v.assertShape({ + query: v.required(v.coordinates), + mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'), + countries: v.arrayOf(v.string), + types: v.arrayOf(v.oneOf(featureTypes)), + bbox: v.arrayOf(v.number), + limit: v.number, + language: v.arrayOf(v.string), + reverseMode: v.oneOf('distance', 'score'), + routing: v.boolean + })(config); + + config.mode = config.mode || 'mapbox.places'; + + var query = stringifyBooleans( + xtend( + { country: config.countries }, + pick(config, [ + 'country', + 'types', + 'bbox', + 'limit', + 'language', + 'reverseMode', + 'routing' + ]) + ) + ); + + return this.client.createRequest({ + method: 'GET', + path: '/geocoding/v5/:mode/:query.json', + params: pick(config, ['mode', 'query']), + query: query + }); +}; + +module.exports = createServiceFactory(Geocoding); + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var xtend = __webpack_require__(37); +var v = __webpack_require__(173); + +function file(value) { + // If we're in a browser so Blob is available, the file must be that. + // In Node, however, it could be a filepath or a pipeable (Readable) stream. + if (typeof window !== 'undefined') { + if (value instanceof global.Blob || value instanceof global.ArrayBuffer) { + return; + } + return 'Blob or ArrayBuffer'; + } + if (typeof value === 'string' || value.pipe !== undefined) { + return; + } + return 'Filename or Readable stream'; +} + +function assertShape(validatorObj, apiName) { + return v.assert(v.strictShape(validatorObj), apiName); +} + +function date(value) { + var msg = 'date'; + if (typeof value === 'boolean') { + return msg; + } + try { + var date = new Date(value); + if (date.getTime && isNaN(date.getTime())) { + return msg; + } + } catch (e) { + return msg; + } +} + +function coordinates(value) { + return v.tuple(v.number, v.number)(value); +} + +module.exports = xtend(v, { + file: file, + date: date, + coordinates: coordinates, + assertShape: assertShape +}); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Validators are functions which assert certain type. + * They can return a string which can then be used + * to display a helpful error message. + * They can also return a function for a custom error message. + */ +var isPlainObject = __webpack_require__(174); +var xtend = __webpack_require__(37); + +var DEFAULT_ERROR_PATH = 'value'; +var NEWLINE_INDENT = '\n '; + +var v = {}; + +/** + * Runners + * + * Take root validators and run assertion + */ +v.assert = function(rootValidator, options) { + options = options || {}; + return function(value) { + var message = validate(rootValidator, value); + // all good + if (!message) { + return; + } + + var errorMessage = processMessage(message, options); + + if (options.apiName) { + errorMessage = options.apiName + ': ' + errorMessage; + } + + throw new Error(errorMessage); + }; +}; + +/** + * Higher Order Validators + * + * validators which take other validators as input + * and output a new validator + */ +v.shape = function shape(validatorObj) { + var validators = objectEntries(validatorObj); + return function shapeValidator(value) { + var validationResult = validate(v.plainObject, value); + + if (validationResult) { + return validationResult; + } + + var key, validator; + var errorMessages = []; + + for (var i = 0; i < validators.length; i++) { + key = validators[i].key; + validator = validators[i].value; + validationResult = validate(validator, value[key]); + + if (validationResult) { + // return [key].concat(validationResult); + errorMessages.push([key].concat(validationResult)); + } + } + + if (errorMessages.length < 2) { + return errorMessages[0]; + } + + // enumerate all the error messages + return function(options) { + errorMessages = errorMessages.map(function(message) { + var key = message[0]; + var renderedMessage = processMessage(message, options) + .split('\n') + .join(NEWLINE_INDENT); // indents any inner nesting + return '- ' + key + ': ' + renderedMessage; + }); + + var objectId = options.path.join('.'); + var ofPhrase = objectId === DEFAULT_ERROR_PATH ? '' : ' of ' + objectId; + + return ( + 'The following properties' + + ofPhrase + + ' have invalid values:' + + NEWLINE_INDENT + + errorMessages.join(NEWLINE_INDENT) + ); + }; + }; +}; + +v.strictShape = function strictShape(validatorObj) { + var shapeValidator = v.shape(validatorObj); + return function strictShapeValidator(value) { + var shapeResult = shapeValidator(value); + if (shapeResult) { + return shapeResult; + } + + var invalidKeys = Object.keys(value).reduce(function(memo, valueKey) { + if (validatorObj[valueKey] === undefined) { + memo.push(valueKey); + } + return memo; + }, []); + + if (invalidKeys.length !== 0) { + return function() { + return 'The following keys are invalid: ' + invalidKeys.join(', '); + }; + } + }; +}; + +v.arrayOf = function arrayOf(validator) { + return createArrayValidator(validator); +}; + +v.tuple = function tuple() { + var validators = Array.isArray(arguments[0]) + ? arguments[0] + : Array.prototype.slice.call(arguments); + return createArrayValidator(validators); +}; + +// Currently array validation fails when the first invalid item is found. +function createArrayValidator(validators) { + var validatingTuple = Array.isArray(validators); + var getValidator = function(index) { + if (validatingTuple) { + return validators[index]; + } + return validators; + }; + + return function arrayValidator(value) { + var validationResult = validate(v.plainArray, value); + if (validationResult) { + return validationResult; + } + + if (validatingTuple && value.length !== validators.length) { + return 'an array with ' + validators.length + ' items'; + } + + for (var i = 0; i < value.length; i++) { + validationResult = validate(getValidator(i), value[i]); + if (validationResult) { + return [i].concat(validationResult); + } + } + }; +} + +v.required = function required(validator) { + function requiredValidator(value) { + if (value == null) { + return function(options) { + return formatErrorMessage( + options, + isArrayCulprit(options.path) + ? 'cannot be undefined/null.' + : 'is required.' + ); + }; + } + return validator.apply(this, arguments); + } + requiredValidator.__required = true; + + return requiredValidator; +}; + +v.oneOfType = function oneOfType() { + var validators = Array.isArray(arguments[0]) + ? arguments[0] + : Array.prototype.slice.call(arguments); + return function oneOfTypeValidator(value) { + var messages = validators + .map(function(validator) { + return validate(validator, value); + }) + .filter(Boolean); + + // If we don't have as many messages as no. of validators, + // then at least one validator was ok with the value. + if (messages.length !== validators.length) { + return; + } + + // check primitive type + if ( + messages.every(function(message) { + return message.length === 1 && typeof message[0] === 'string'; + }) + ) { + return orList( + messages.map(function(m) { + return m[0]; + }) + ); + } + + // Complex oneOfTypes like + // `v.oneOftypes(v.shape({name: v.string})`, `v.shape({name: v.number}))` + // are complex ¯\_(ツ)_/¯. For the current scope only returning the longest message. + return messages.reduce(function(max, arr) { + return arr.length > max.length ? arr : max; + }); + }; +}; + +/** + * Meta Validators + * which take options as argument (not validators) + * and return a new primitive validator + */ +v.equal = function equal(compareWith) { + return function equalValidator(value) { + if (value !== compareWith) { + return JSON.stringify(compareWith); + } + }; +}; + +v.oneOf = function oneOf() { + var options = Array.isArray(arguments[0]) + ? arguments[0] + : Array.prototype.slice.call(arguments); + var validators = options.map(function(value) { + return v.equal(value); + }); + + return v.oneOfType.apply(this, validators); +}; + +v.range = function range(compareWith) { + var min = compareWith[0]; + var max = compareWith[1]; + return function rangeValidator(value) { + var validationResult = validate(v.number, value); + + if (validationResult || value < min || value > max) { + return 'number between ' + min + ' & ' + max + ' (inclusive)'; + } + }; +}; + +/** + * Primitive validators + * + * simple validators which return a string or undefined + */ +v.any = function any() { + return; +}; + +v.boolean = function boolean(value) { + if (typeof value !== 'boolean') { + return 'boolean'; + } +}; + +v.number = function number(value) { + if (typeof value !== 'number') { + return 'number'; + } +}; + +v.plainArray = function plainArray(value) { + if (!Array.isArray(value)) { + return 'array'; + } +}; + +v.plainObject = function plainObject(value) { + if (!isPlainObject(value)) { + return 'object'; + } +}; + +v.string = function string(value) { + if (typeof value !== 'string') { + return 'string'; + } +}; + +v.func = function func(value) { + if (typeof value !== 'function') { + return 'function'; + } +}; + +function validate(validator, value) { + // assertions are optional by default unless wrapped in v.require + if (value == null && !validator.hasOwnProperty('__required')) { + return; + } + + var result = validator(value); + + if (result) { + return Array.isArray(result) ? result : [result]; + } +} + +function processMessage(message, options) { + // message array follows the convention + // [...path, result] + // path is an array of object keys / array indices + // result is output of the validator + var len = message.length; + + var result = message[len - 1]; + var path = message.slice(0, len - 1); + + if (path.length === 0) { + path = [DEFAULT_ERROR_PATH]; + } + options = xtend(options, { path: path }); + + return typeof result === 'function' + ? result(options) // allows customization of result + : formatErrorMessage(options, prettifyResult(result)); +} + +function orList(list) { + if (list.length < 2) { + return list[0]; + } + if (list.length === 2) { + return list.join(' or '); + } + return list.slice(0, -1).join(', ') + ', or ' + list.slice(-1); +} + +function prettifyResult(result) { + return 'must be ' + addArticle(result) + '.'; +} + +function addArticle(nounPhrase) { + if (/^an? /.test(nounPhrase)) { + return nounPhrase; + } + if (/^[aeiou]/i.test(nounPhrase)) { + return 'an ' + nounPhrase; + } + if (/^[a-z]/i.test(nounPhrase)) { + return 'a ' + nounPhrase; + } + return nounPhrase; +} + +function formatErrorMessage(options, prettyResult) { + var arrayCulprit = isArrayCulprit(options.path); + var output = options.path.join('.') + ' ' + prettyResult; + var prepend = arrayCulprit ? 'Item at position ' : ''; + + return prepend + output; +} + +function isArrayCulprit(path) { + return typeof path[path.length - 1] == 'number' || typeof path[0] == 'number'; +} + +function objectEntries(obj) { + return Object.keys(obj || {}).map(function(key) { + return { key: key, value: obj[key] }; + }); +} + +v.validate = validate; +v.processMessage = processMessage; + +module.exports = v; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toString = Object.prototype.toString; + +module.exports = function (x) { + var prototype; + return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); +}; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Create a new object by picking properties off an existing object. + * The second param can be overloaded as a callback for + * more fine grained picking of properties. + * @param {Object} source + * @param {Array|function(string, Object):boolean} keys + * @returns {Object} + */ +function pick(source, keys) { + var filter = function(key, val) { + return keys.indexOf(key) !== -1 && val !== undefined; + }; + + if (typeof keys === 'function') { + filter = keys; + } + + return Object.keys(source) + .filter(function(key) { + return filter(key, source[key]); + }) + .reduce(function(result, key) { + result[key] = source[key]; + return result; + }, {}); +} + +module.exports = pick; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var objectMap = __webpack_require__(177); + +/** + * Stringify all the boolean values in an object, so true becomes "true". + * + * @param {Object} obj + * @returns {Object} + */ +function stringifyBoolean(obj) { + return objectMap(obj, function(_, value) { + return typeof value === 'boolean' ? JSON.stringify(value) : value; + }); +} + +module.exports = stringifyBoolean; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function objectMap(obj, cb) { + return Object.keys(obj).reduce(function(result, key) { + result[key] = cb(key, obj[key]); + return result; + }, {}); +} + +module.exports = objectMap; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var MapiClient = __webpack_require__(70); +// This will create the environment-appropriate client. +var createClient = __webpack_require__(69); + +function createServiceFactory(ServicePrototype) { + return function(clientOrConfig) { + var client; + if (MapiClient.prototype.isPrototypeOf(clientOrConfig)) { + client = clientOrConfig; + } else { + client = createClient(clientOrConfig); + } + var service = Object.create(ServicePrototype); + service.client = client; + return service; + }; +} + +module.exports = createServiceFactory; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var nanoid = __webpack_require__(180) + +/** + * Construct a new mapbox event client to send interaction events to the mapbox event service + * @param {Object} options options with which to create the service + * @param {String} options.accessToken the mapbox access token to make requests + * @param {Number} [options.flushInterval=1000] the number of ms after which to flush the event queue + * @param {Number} [options.maxQueueSize=100] the number of events to queue before flushing + * @private + */ +function MapboxEventManager(options) { + this.origin = options.origin || 'https://api.mapbox.com'; + this.endpoint = 'events/v2'; + this.access_token = options.accessToken; + this.version = '0.2.0' + this.sessionID = this.generateSessionID(); + this.userAgent = this.getUserAgent(); + + this.options = options; + this.send = this.send.bind(this); + + + // parse global options to be sent with each request + this.countries = (options.countries) ? options.countries.split(",") : null; + this.types = (options.types) ? options.types.split(",") : null; + this.bbox = (options.bbox) ? options.bbox : null; + this.language = (options.language) ? options.language.split(",") : null; + this.limit = (options.limit) ? +options.limit : null; + this.locale = navigator.language || null; + this.enableEventLogging = this.shouldEnableLogging(options); + this.eventQueue = new Array(); + this.flushInterval = options.flushInterval || 1000; + this.maxQueueSize = options.maxQueueSize || 100; + this.timer = (this.flushInterval) ? setTimeout(this.flush.bind(this), this.flushInterval) : null; + // keep some state to deduplicate requests if necessary + this.lastSentInput = ""; + this.lastSentIndex = 0; +} + +MapboxEventManager.prototype = { + /** + * Send a search.select event to the mapbox events service + * This event marks the array index of the item selected by the user out of the array of possible options + * @private + * @param {Object} selected the geojson feature selected by the user + * @param {Object} geocoder a mapbox-gl-geocoder instance + * @returns {Promise} + */ + select: function(selected, geocoder){ + var resultIndex = this.getSelectedIndex(selected, geocoder); + var payload = this.getEventPayload('search.select', geocoder); + payload.resultIndex = resultIndex; + payload.resultPlaceName = selected.place_name; + payload.resultId = selected.id; + if ((resultIndex === this.lastSentIndex && payload.queryString === this.lastSentInput) || resultIndex == -1) { + // don't log duplicate events if the user re-selected the same feature on the same search + return; + } + this.lastSentIndex = resultIndex; + this.lastSentInput = payload.queryString; + if (!payload.queryString) return; // will be rejected + return this.push(payload) + }, + + /** + * Send a search-start event to the mapbox events service + * This turnstile event marks when a user starts a new search + * @private + * @param {Object} geocoder a mapbox-gl-geocoder instance + * @returns {Promise} + */ + start: function(geocoder){ + var payload = this.getEventPayload('search.start', geocoder); + if (!payload.queryString) return; // will be rejected + return this.push(payload); + }, + + /** + * Send a search-keyevent event to the mapbox events service + * This event records each keypress in sequence + * @private + * @param {Object} keyEvent the keydown event to log + * @param {Object} geocoder a mapbox-gl-geocoder instance + * + */ + keyevent: function(keyEvent, geocoder){ + + //pass invalid event + if (!keyEvent.key) return; + // don't send events for keys that don't change the input + // TAB, ESC, LEFT, RIGHT, ENTER, UP, DOWN + if (keyEvent.metaKey || [9, 27, 37, 39, 13, 38, 40].indexOf(keyEvent.keyCode) !== -1) return; + var payload = this.getEventPayload('search.keystroke', geocoder); + payload.lastAction = keyEvent.key; + if (!payload.queryString) return; // will be rejected + return this.push(payload); + }, + + /** + * Send an event to the events service + * + * The event is skipped if the instance is not enabled to send logging events + * + * @private + * @param {Object} payload the http POST body of the event + * @param {Function} [callback] a callback function to invoke when the send has completed + * @returns {Promise} + */ + send: function (payload, callback) { + if (!this.enableEventLogging) { + if (callback) return callback(); + return; + } + var options = this.getRequestOptions(payload); + this.request(options, function(err){ + if (err) return this.handleError(err, callback); + if (callback) { + return callback(); + } + }.bind(this)) + }, + /** + * Get http request options + * @private + * @param {*} payload + */ + getRequestOptions: function(payload){ + if (!Array.isArray(payload)) payload = [payload]; + var options = { + // events must be sent with POST + method: "POST", + host: this.origin, + path: this.endpoint + "?access_token=" + this.access_token, + headers: { + 'Content-Type': 'application/json' + }, + body:JSON.stringify(payload) //events are arrays + } + return options + }, + + /** + * Get the event payload to send to the events service + * Most payload properties are shared across all events + * @private + * @param {String} event the name of the event to send to the events service. Valid options are 'search.start', 'search.select', 'search.feedback'. + * @param {Object} geocoder a mapbox-gl-geocoder instance + * @returns {Object} an event payload + */ + getEventPayload: function (event, geocoder) { + var proximity; + if (!geocoder.options.proximity) proximity = null; + else proximity = [geocoder.options.proximity.longitude, geocoder.options.proximity.latitude]; + + var zoom = (geocoder._map) ? geocoder._map.getZoom() : undefined; + var payload = { + event: event, + created: +new Date(), + sessionIdentifier: this.sessionID, + country: this.countries, + userAgent: this.userAgent, + language: this.language, + bbox: this.bbox, + types: this.types, + endpoint: 'mapbox.places', + // fuzzyMatch: search.fuzzy, //todo --> add to plugin + proximity: proximity, + limit: geocoder.options.limit, + // routing: search.routing, //todo --> add to plugin + mapZoom: zoom, + keyboardLocale: this.locale + } + + // get the text in the search bar + if (event === "search.select"){ + payload.queryString = geocoder.inputString; + }else if (event != "search.select" && geocoder._inputEl){ + payload.queryString = geocoder._inputEl.value; + }else{ + payload.queryString = geocoder.inputString; + } + return payload; + }, + + /** + * Wraps the request function for easier testing + * Make an http request and invoke a callback + * @private + * @param {Object} opts options describing the http request to be made + * @param {Function} callback the callback to invoke when the http request is completed + */ + request: function (opts, callback) { + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 ) { + if (this.status == 204){ + //success + return callback(null); + }else { + return callback(this.statusText); + } + } + }; + + xhttp.open(opts.method, opts.host + '/' + opts.path, true); + for (var header in opts.headers){ + var headerValue = opts.headers[header]; + xhttp.setRequestHeader(header, headerValue) + } + xhttp.send(opts.body); + }, + + /** + * Handle an error that occurred while making a request + * @param {Object} err an error instance to log + * @private + */ + handleError: function (err, callback) { + if (callback) return callback(err); + }, + + /** + * Generate a session ID to be returned with all of the searches made by this geocoder instance + * ID is random and cannot be tracked across sessions + * @private + */ + generateSessionID: function () { + return nanoid(); + }, + + /** + * Get a user agent string to send with the request to the events service + * @private + */ + getUserAgent: function () { + return 'mapbox-gl-geocoder.' + this.version + "." + navigator.userAgent; + }, + + /** + * Get the 0-based numeric index of the item that the user selected out of the list of options + * @private + * @param {Object} selected the geojson feature selected by the user + * @param {Object} geocoder a Mapbox-GL-Geocoder instance + * @returns {Number} the index of the selected result + */ + getSelectedIndex: function(selected, geocoder){ + if (!geocoder._typeahead) return; + var results = geocoder._typeahead.data; + var selectedID = selected.id; + var resultIDs = results.map(function (feature) { + return feature.id; + }); + var selectedIdx = resultIDs.indexOf(selectedID); + return selectedIdx; + }, + + /** + * Check whether events should be logged + * Clients using a localGeocoder or an origin other than mapbox should not have events logged + * @private + */ + shouldEnableLogging: function(options){ + if (options.enableEventLogging === false) return false; + if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false; + // hard to make sense of events when a local instance is suplementing results from origin + if (options.localGeocoder) return false; + // hard to make sense of events when a custom filter is in use + if (options.filter) return false; + return true; + }, + + /** + * Flush out the event queue by sending events to the events service + * @private + */ + flush: function(){ + if (this.eventQueue.length > 0){ + this.send(this.eventQueue); + this.eventQueue = new Array(); + } + // //reset the timer + if (this.timer) clearTimeout(this.timer); + if (this.flushInterval) this.timer = setTimeout(this.flush.bind(this), this.flushInterval) + }, + + /** + * Push event into the pending queue + * @param {Object} evt the event to send to the events service + * @param {Boolean} forceFlush indicates that the event queue should be flushed after adding this event regardless of size of the queue + * @private + */ + push: function(evt, forceFlush){ + this.eventQueue.push(evt); + if (this.eventQueue.length >= this.maxQueueSize || forceFlush){ + this.flush(); + } + }, + + /** + * Flush any remaining events from the queue before it is removed + * @private + */ + remove: function(){ + this.flush(); + } +} + + + +module.exports = MapboxEventManager; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +// This file replaces `index.js` in bundlers like webpack or Rollup, +// according to `browser` config in `package.json`. + +if (false) { + // All bundlers will remove this block in production bundle + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + throw new Error( + 'React Native does not have a built-in secure random generator. ' + + 'If you don’t need unpredictable IDs, you can use `nanoid/non-secure`. ' + + 'For secure ID install `expo-random` locally and use `nanoid/async`.' + ) + } + if (typeof self === 'undefined' || (!self.crypto && !self.msCrypto)) { + throw new Error( + 'Your browser does not have secure random generator. ' + + 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.' + ) + } +} + +var crypto = self.crypto || self.msCrypto + +// This alphabet uses a-z A-Z 0-9 _- symbols. +// Symbols are generated for smaller size. +// -_zyxwvutsrqponmlkjihgfedcba9876543210ZYXWVUTSRQPONMLKJIHGFEDCBA +var url = '-_' +// Loop from 36 to 0 (from z to a and 9 to 0 in Base36). +var i = 36 +while (i--) { + // 36 is radix. Number.prototype.toString(36) returns number + // in Base36 representation. Base36 is like hex, but it uses 0–9 and a-z. + url += i.toString(36) +} +// Loop from 36 to 10 (from Z to A in Base36). +i = 36 +while (i-- - 10) { + url += i.toString(36).toUpperCase() +} + +module.exports = function (size) { + var id = '' + var bytes = crypto.getRandomValues(new Uint8Array(size || 21)) + i = size || 21 + + // Compact alternative for `for (var i = 0; i < size; i++)` + while (i--) { + // We can’t use bytes bigger than the alphabet. 63 is 00111111 bitmask. + // This mask reduces random byte 0-255 to 0-63 values. + // There is no need in `|| ''` and `* 1.6` hacks in here, + // because bitmask trim bytes exact to alphabet size. + id += url[bytes[i] & 63] + } + return id +} + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Localized values for the placeholder string + * + * @private + */ +var placeholder = { + // list drawn from https://docs.mapbox.com/api/search/#language-coverage + 'de': 'Suche', // german + 'it': 'Ricerca', //italian + 'en': 'Search', // english + 'nl': 'Zoeken', //dutch + 'fr': 'Chercher', //french + 'ca': 'Cerca', //catalan + 'he': 'לחפש', //hebrew + 'ja': 'サーチ', //japanese + 'lv': 'Meklēt', //latvian + 'pt': 'Procurar', //portuguese + 'sr': 'Претрага', //serbian + 'zh': '搜索', //chinese-simplified + 'cs': 'Vyhledávání', //czech + 'hu': 'Keresés', //hungarian + 'ka': 'ძიება', // georgian + 'nb': 'Søke', //norwegian + 'sk': 'Vyhľadávanie', //slovak + 'th': 'ค้นหา', //thai + 'fi': 'Hae',//finnish + 'is': 'Leita',//icelandic + 'ko': '수색',//korean + 'pl': 'Szukaj', //polish + 'sl': 'Iskanje', //slovenian + 'fa': 'جستجو' //persian(aka farsi) +} + +module.exports = {placeholder: placeholder}; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports) { + +!function(root, name, make) { + if (typeof module != 'undefined' && module.exports) module.exports = make() + else root[name] = make() +}(this, 'subtag', function() { + + var empty = '' + var pattern = /^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/ + + function match(tag) { + return tag.match(pattern) || [] + } + + function split(tag) { + return match(tag).filter(function(v, i) { return v && i }) + } + + function api(tag) { + tag = match(tag) + return { + language: tag[1] || empty, + extlang: tag[2] || empty, + script: tag[3] || empty, + region: tag[4] || empty + } + } + + function expose(target, key, value) { + Object.defineProperty(target, key, { + value: value, + enumerable: true + }) + } + + function part(position, pattern, type) { + function method(tag) { + return match(tag)[position] || empty + } + expose(method, 'pattern', pattern) + expose(api, type, method) + } + + part(1, /^[a-zA-Z]{2,3}$/, 'language') + part(2, /^[a-zA-Z]{3}$/, 'extlang') + part(3, /^[a-zA-Z]{4}$/, 'script') + part(4, /^[a-zA-Z]{2}$|^[0-9]{3}$/, 'region') + + expose(api, 'split', split) + + return api +}); + + +/***/ }), +/* 183 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a + diff --git a/templates/web/prod/WorkZone/ExposeList.html.twig b/templates/web/prod/WorkZone/ExposeList.html.twig new file mode 100644 index 0000000000..de6067dbdb --- /dev/null +++ b/templates/web/prod/WorkZone/ExposeList.html.twig @@ -0,0 +1,19 @@ +{% for publication in publications %} +
+
+
+ {% if publication.cover %} + + {% endif %} +
+ + {% set path = publication.slug ?? publication.id %} + {{ publication.title }} + +
+
+
+
+{% endfor %} + diff --git a/templates/web/prod/WorkZone/ExposeNew.html.twig b/templates/web/prod/WorkZone/ExposeNew.html.twig new file mode 100644 index 0000000000..5907c9b92c --- /dev/null +++ b/templates/web/prod/WorkZone/ExposeNew.html.twig @@ -0,0 +1,308 @@ +{% macro add_publication(app) %} + + + +{% endmacro %} diff --git a/templates/web/prod/WorkZone/ExposeOauthLogin.html.twig b/templates/web/prod/WorkZone/ExposeOauthLogin.html.twig new file mode 100644 index 0000000000..594e62b8d4 --- /dev/null +++ b/templates/web/prod/WorkZone/ExposeOauthLogin.html.twig @@ -0,0 +1,37 @@ +

Auth connexion

+
+
+ +
+ + +
+
+ + +
+
+ +
+
+
+ + diff --git a/templates/web/prod/WorkZone/ExposePublicationAssets.html.twig b/templates/web/prod/WorkZone/ExposePublicationAssets.html.twig new file mode 100644 index 0000000000..0aabe80117 --- /dev/null +++ b/templates/web/prod/WorkZone/ExposePublicationAssets.html.twig @@ -0,0 +1,62 @@ +{% if page == 1 %} +
+ + + {% if pubAssets[0].publication.children|length == 0 %} + + {% else %} + Parent publication + {% endif %} +
+ +
+
+ + + +
+ {{ totalItems }} assets +
+ +{% endif %} + +{% for pubAsset in pubAssets %} +
+
+
+
+ +
+ +
+ + +
+ + +
+
+
+{% endfor %} + +{% if page == 1 %} +
+ +
+ + +
+
+{% endif %} diff --git a/templates/web/prod/WorkZone/Macros.html.twig b/templates/web/prod/WorkZone/Macros.html.twig index 33ba8d66f4..b00cf8b6ea 100644 --- a/templates/web/prod/WorkZone/Macros.html.twig +++ b/templates/web/prod/WorkZone/Macros.html.twig @@ -464,3 +464,44 @@ {% endfor %} {% endmacro %} + +{% macro make_expose_bloc(app, WorkZone) %} +
+
+ {% set expose_list= app['conf'].get(['phraseanet-service', 'expose-service', 'exposes']) %} + + +
+
+ + {{ 'prod:: workzone:expose: Add publication' | trans }} + + + + + + +
+ +
+
+
+
+
+ + + {% import 'prod/WorkZone/ExposeNew.html.twig' as ExposeNew %} + {{ ExposeNew.add_publication(app) }} + +{% endmacro %} diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 8c45efc30b..e4f07ab543 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -182,10 +182,34 @@ {% block tabs_panel %}
{% include 'prod/tab_headers.html.twig' %} -
+ {% import 'prod/WorkZone/Macros.html.twig' as WorkZoneMacros %} - {{WorkZoneMacros.make_bloc(app, WorkZone)}} -
+ {% set expose_activate = app['conf'].get(['phraseanet-service', 'expose-service', 'activated']) %} + {% if expose_activate == 'true' %} + {% block tab_headers_wrapper %} +
+ +
+ {% endblock %} + {% else %} +
+ {{WorkZoneMacros.make_bloc(app, WorkZone)}} +
+ {% endif %} + {% if GV_thesaurus %}
@@ -1023,6 +1047,8 @@ + +