diff --git a/.github/ISSUE_TEMPLATE/--first-timers-issue-template.md b/.github/ISSUE_TEMPLATE/--first-timers-issue-template.md index b884466ce..4f2e0045c 100644 --- a/.github/ISSUE_TEMPLATE/--first-timers-issue-template.md +++ b/.github/ISSUE_TEMPLATE/--first-timers-issue-template.md @@ -1,3 +1,18 @@ +--- +name: "\U00002728 First Timers Only issue" +about: Open a First Timers Only issue for someone +title: '' +labels: fto-candidate +assignees: '' + +--- + +### 💡Format this Issue Into a First Timers Issue + +This has been marked as a good candidate for becoming a [first-timers-only issue](https://code.publiclab.org/#r=all) like these, meaning that it's **simple, self-contained**, and with some extra formatting✍️, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider **reformatting it as a first-timers-only issue**, and then ping @publiclab/reviewers to get it labeled🏷. Or, if this is not your first time, **try to solve it yourself**🧑‍💻! + +--- + Hi, this is a [first-timers-only issue](https://code.publiclab.org/#r=all). This means we've worked to make it more legible to folks who either **haven't contributed to our codebase before, or even folks who haven't contributed to open source before**. If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from underrepresented groups in free and open-source software! diff --git a/.github/first-timers-issue-template.md b/.github/first-timers-issue-template.md index b884466ce..a3d3eca02 100644 --- a/.github/first-timers-issue-template.md +++ b/.github/first-timers-issue-template.md @@ -50,6 +50,6 @@ Leave a comment below! ### Is someone else already working on this? -We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. **If someone seem stuck, offer them some help!** Otherwise, [take a look at some other issues you can help with](https://publiclab.github.io/community-toolbox/#r=all). Thanks! +We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. **If someone seems stuck, offer them some help!** Otherwise, [take a look at some other issues you can help with](https://publiclab.github.io/community-toolbox/#r=all). Thanks! (This issue was created by [First-Timers-Bot](https://github.com/hoodiehq/first-timers-bot).) diff --git a/README.md b/README.md index 56f356fc4..472a8b403 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ npm i leaflet-distortableimage Compatible with Leaflet 1.0.0 and greater + ### MapKnitter Lite + +Check out an early prototype of the [Mapknitter Lite project](https://publiclab.github.io/Leaflet.DistortableImage/examples/archive) + ## Demo Check out this [simple demo](https://publiclab.github.io/Leaflet.DistortableImage/examples/index.html). @@ -165,7 +169,7 @@ Values available to pass to `mode` are: * **freeRotate**: Combines the rotate and scale modes into one. * **lock**: Locks the image in place. Disables any user gestures, toolbar actions, or hotkeys that are not associated with mode. Exception: `L.ExportAction` will still be enabled. -In the below example, the image will be initialiazed with "freeRotate" handles: +In the below example, the image will be initialized with "freeRotate" handles: ```js img = L.distortableImageOverlay('example.jpg', { diff --git a/dist/leaflet.distortableimage.js b/dist/leaflet.distortableimage.js index 84da547da..74f79597c 100644 --- a/dist/leaflet.distortableimage.js +++ b/dist/leaflet.distortableimage.js @@ -1,2884 +1,8292 @@ -!(function () { - var t = { - 808: function () { - (L.DistortableCollection = L.FeatureGroup.extend({ - options: { - editable: !0, - exportOpts: { - exportStartUrl: "//export.mapknitter.org/export", - statusUrl: "//export.mapknitter.org", - exportUrl: "http://export.mapknitter.org/", - }, - }, - initialize: function (t) { - L.setOptions(this, t), - L.FeatureGroup.prototype.initialize.call(this, t), - L.Utils.initTranslation.call(this), - (this.editable = this.options.editable); - }, - onAdd: function (t) { - L.FeatureGroup.prototype.onAdd.call(this, t), - (this._map = t), - this.editable && this.editing.enable(), - this.on("layeradd", this._addEvents, this), - this.on("layerremove", this._removeEvents, this); - }, - onRemove: function () { - this.editing && this.editing.disable(), - this.off("layeradd", this._addEvents, this), - this.off("layerremove", this._removeEvents, this); - }, - _addEvents: function (t) { - var e = t.layer; - L.DomEvent.on( - e, - { dragstart: this._dragStartMultiple, drag: this._dragMultiple }, - this - ), - L.DomEvent.on( - e.getElement(), - { - mousedown: this._deselectOthers, - contextmenu: this._longPressMultiSelect, - }, - this - ); - }, - _removeEvents: function (t) { - var e = t.layer; - L.DomEvent.off( - e, - { dragstart: this._dragStartMultiple, drag: this._dragMultiple }, - this - ), - L.DomEvent.off( - e.getElement(), - { - mousedown: this._deselectOthers, - contextmenu: this._longPressMultiSelect, - }, - this - ); - }, - _longPressMultiSelect: function (t) { - var e = this; - this.editable && - (t.preventDefault(), - this.eachLayer(function (i) { - var o = i.editing; - i.getElement() === t.target && - o.enabled() && - (L.DomUtil.toggleClass(i.getElement(), "collected"), - e.anyCollected() - ? (i.deselect(), e.editing._addToolbar()) - : e.editing._removeToolbar()); - })); - }, - isCollected: function (t) { - return L.DomUtil.hasClass(t.getElement(), "collected"); - }, - anyCollected: function () { - return this.getLayers().some(this.isCollected.bind(this)); - }, - _toggleCollected: function (t, e) { - t.shiftKey && - e.editing.enabled() && - L.DomUtil.toggleClass(t.target, "collected"), - this.anyCollected() ? e.deselect() : this.editing._removeToolbar(); - }, - _deselectOthers: function (t) { - var e = this; - this.editable && - (this.eachLayer(function (i) { - i.getElement() !== t.target - ? i.deselect() - : e._toggleCollected(t, i); - }), - t && L.DomEvent.stopPropagation(t)); - }, - _dragStartMultiple: function (t) { - var e, - i = t.target, - o = this._map; - this.isCollected(i) && - this.eachLayer(function (t) { - for (t._dragStartPoints = {}, t.deselect(), e = 0; e < 4; e++) { - var i = t.getCorner(e); - t._dragStartPoints[e] = o.latLngToLayerPoint(i); - } - }); - }, - _dragMultiple: function (t) { - var e = t.target, - i = this._map; - if (this.isCollected(e)) { - var o = i.latLngToLayerPoint(e.getCorner(0)), - n = e._dragStartPoints[0].subtract(o); - this._updateCollectionFromPoints(n, e); - } - }, - _toRemove: function () { - var t = this; - return this.getLayers().filter(function (e) { - var i = e.editing._mode; - return t.isCollected(e) && "lock" !== i; - }); - }, - _toMove: function (t) { - var e = this; - return this.getLayers().filter(function (i) { - var o = i.editing._mode; - return i !== t && e.isCollected(i) && "lock" !== o; - }); - }, - _updateCollectionFromPoints: function (t, e) { - var i, - o = this._toMove(e), - n = new L.Transformation(1, -t.x, 1, -t.y); - o.forEach(function (t) { - var e = {}; - for (i = 0; i < 4; i++) e[i] = n.transform(t._dragStartPoints[i]); - t.setCornersFromPoints(e); - }); - }, - _getAvgCmPerPixel: function (t) { - return ( - t.reduce(function (t, e) { - return t + e.cm_per_pixel; - }, 0) / t.length - ); - }, - generateExportJson: function () { - var t = { images: [] }; - return ( - this.eachLayer(function (e) { - if (this.isCollected(e)) { - var i = e._image.src.split("/"), - o = i[i.length - 1], - n = e.getCorners(), - a = [ - { lat: n[0].lat, lon: n[0].lng }, - { lat: n[1].lat, lon: n[1].lng }, - { lat: n[3].lat, lon: n[3].lng }, - { lat: n[2].lat, lon: n[2].lng }, - ]; - t.images.push({ - id: this.getLayerId(e), - src: e._image.src, - width: e._image.width, - height: e._image.height, - image_file_name: o, - nodes: a, - cm_per_pixel: L.ImageUtil.getCmPerPixel(e), - }); - } - }, this), - (t.images = t.images.reverse()), - (t.avg_cm_per_pixel = this._getAvgCmPerPixel(t.images)), - t - ); - }, - })), - (L.distortableCollection = function (t, e) { - return new L.DistortableCollection(t, e); +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/ansi-html-community/index.js": +/*!***************************************************!*\ + !*** ./node_modules/ansi-html-community/index.js ***! + \***************************************************/ +/***/ (function(module) { + +"use strict"; + + +module.exports = ansiHTML + +// Reference to https://github.com/sindresorhus/ansi-regex +var _regANSI = /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/ + +var _defColors = { + reset: ['fff', '000'], // [FOREGROUD_COLOR, BACKGROUND_COLOR] + black: '000', + red: 'ff0000', + green: '209805', + yellow: 'e8bf03', + blue: '0000ff', + magenta: 'ff00ff', + cyan: '00ffee', + lightgrey: 'f0f0f0', + darkgrey: '888' +} +var _styles = { + 30: 'black', + 31: 'red', + 32: 'green', + 33: 'yellow', + 34: 'blue', + 35: 'magenta', + 36: 'cyan', + 37: 'lightgrey' +} +var _openTags = { + '1': 'font-weight:bold', // bold + '2': 'opacity:0.5', // dim + '3': '', // italic + '4': '', // underscore + '8': 'display:none', // hidden + '9': '' // delete +} +var _closeTags = { + '23': '', // reset italic + '24': '', // reset underscore + '29': '' // reset delete +} + +;[0, 21, 22, 27, 28, 39, 49].forEach(function (n) { + _closeTags[n] = '' +}) + +/** + * Converts text with ANSI color codes to HTML markup. + * @param {String} text + * @returns {*} + */ +function ansiHTML (text) { + // Returns the text if the string has no ANSI escape code. + if (!_regANSI.test(text)) { + return text + } + + // Cache opened sequence. + var ansiCodes = [] + // Replace with markup. + var ret = text.replace(/\033\[(\d+)m/g, function (match, seq) { + var ot = _openTags[seq] + if (ot) { + // If current sequence has been opened, close it. + if (!!~ansiCodes.indexOf(seq)) { // eslint-disable-line no-extra-boolean-cast + ansiCodes.pop() + return '' + } + // Open tag. + ansiCodes.push(seq) + return ot[0] === '<' ? ot : '' + } + + var ct = _closeTags[seq] + if (ct) { + // Pop sequence + ansiCodes.pop() + return ct + } + return '' + }) + + // Make sure tags are closed. + var l = ansiCodes.length + ;(l > 0) && (ret += Array(l + 1).join('')) + + return ret +} + +/** + * Customize colors. + * @param {Object} colors reference to _defColors + */ +ansiHTML.setColors = function (colors) { + if (typeof colors !== 'object') { + throw new Error('`colors` parameter must be an Object.') + } + + var _finalColors = {} + for (var key in _defColors) { + var hex = colors.hasOwnProperty(key) ? colors[key] : null + if (!hex) { + _finalColors[key] = _defColors[key] + continue + } + if ('reset' === key) { + if (typeof hex === 'string') { + hex = [hex] + } + if (!Array.isArray(hex) || hex.length === 0 || hex.some(function (h) { + return typeof h !== 'string' + })) { + throw new Error('The value of `' + key + '` property must be an Array and each item could only be a hex string, e.g.: FF0000') + } + var defHexColor = _defColors[key] + if (!hex[0]) { + hex[0] = defHexColor[0] + } + if (hex.length === 1 || !hex[1]) { + hex = [hex[0]] + hex.push(defHexColor[1]) + } + + hex = hex.slice(0, 2) + } else if (typeof hex !== 'string') { + throw new Error('The value of `' + key + '` property must be a hex string, e.g.: FF0000') + } + _finalColors[key] = hex + } + _setTags(_finalColors) +} + +/** + * Reset colors. + */ +ansiHTML.reset = function () { + _setTags(_defColors) +} + +/** + * Expose tags, including open and close. + * @type {Object} + */ +ansiHTML.tags = {} + +if (Object.defineProperty) { + Object.defineProperty(ansiHTML.tags, 'open', { + get: function () { return _openTags } + }) + Object.defineProperty(ansiHTML.tags, 'close', { + get: function () { return _closeTags } + }) +} else { + ansiHTML.tags.open = _openTags + ansiHTML.tags.close = _closeTags +} + +function _setTags (colors) { + // reset all + _openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1] + // inverse + _openTags['7'] = 'color:#' + colors.reset[1] + ';background:#' + colors.reset[0] + // dark grey + _openTags['90'] = 'color:#' + colors.darkgrey + + for (var code in _styles) { + var color = _styles[code] + var oriColor = colors[color] || '000' + _openTags[code] = 'color:#' + oriColor + code = parseInt(code) + _openTags[(code + 10).toString()] = 'background:#' + oriColor + } +} + +ansiHTML.reset() + + +/***/ }), + +/***/ "./src/DistortableCollection.js": +/*!**************************************!*\ + !*** ./src/DistortableCollection.js ***! + \**************************************/ +/***/ (function() { + +L.DistortableCollection = L.FeatureGroup.extend({ + options: { + editable: true, + exportOpts: { + exportStartUrl: '//export.mapknitter.org/export', + statusUrl: '//export.mapknitter.org', + exportUrl: 'http://export.mapknitter.org/' + } + }, + initialize: function initialize(options) { + L.setOptions(this, options); + L.FeatureGroup.prototype.initialize.call(this, options); + L.Utils.initTranslation.call(this); + this.editable = this.options.editable; + }, + onAdd: function onAdd(map) { + L.FeatureGroup.prototype.onAdd.call(this, map); + this._map = map; + + if (this.editable) { + this.editing.enable(); + } + /** + * although we have a DistortableCollection.Edit class that handles collection events to keep our code managable, + * events that need to be added on individual images are kept here to do so through `layeradd`. + */ + + + this.on('layeradd', this._addEvents, this); + this.on('layerremove', this._removeEvents, this); + }, + onRemove: function onRemove() { + if (this.editing) { + this.editing.disable(); + } + + this.off('layeradd', this._addEvents, this); + this.off('layerremove', this._removeEvents, this); + }, + _addEvents: function _addEvents(e) { + var layer = e.layer; + L.DomEvent.on(layer, { + dragstart: this._dragStartMultiple, + drag: this._dragMultiple + }, this); + L.DomEvent.on(layer.getElement(), { + mousedown: this._deselectOthers, + + /* Enable longpress for multi select for touch devices. */ + contextmenu: this._longPressMultiSelect + }, this); + }, + _removeEvents: function _removeEvents(e) { + var layer = e.layer; + L.DomEvent.off(layer, { + dragstart: this._dragStartMultiple, + drag: this._dragMultiple + }, this); + L.DomEvent.off(layer.getElement(), { + mousedown: this._deselectOthers, + contextmenu: this._longPressMultiSelect + }, this); + }, + _longPressMultiSelect: function _longPressMultiSelect(e) { + var _this = this; + + if (!this.editable) { + return; + } + + e.preventDefault(); + this.eachLayer(function (layer) { + var edit = layer.editing; + + if (layer.getElement() === e.target && edit.enabled()) { + L.DomUtil.toggleClass(layer.getElement(), 'collected'); + + if (_this.anyCollected()) { + layer.deselect(); + + _this.editing._addToolbar(); + } else { + _this.editing._removeToolbar(); + } + } + }); + }, + isCollected: function isCollected(overlay) { + return L.DomUtil.hasClass(overlay.getElement(), 'collected'); + }, + anyCollected: function anyCollected() { + var layerArr = this.getLayers(); + return layerArr.some(this.isCollected.bind(this)); + }, + _toggleCollected: function _toggleCollected(e, layer) { + if (e.shiftKey) { + /* conditional prevents disabled images from flickering multi-select mode */ + if (layer.editing.enabled()) { + L.DomUtil.toggleClass(e.target, 'collected'); + } + } + + if (this.anyCollected()) { + layer.deselect(); + } else { + this.editing._removeToolbar(); + } + }, + _deselectOthers: function _deselectOthers(e) { + var _this2 = this; + + if (!this.editable) { + return; + } + + this.eachLayer(function (layer) { + if (layer.getElement() !== e.target) { + layer.deselect(); + } else { + _this2._toggleCollected(e, layer); + } + }); + + if (e) { + L.DomEvent.stopPropagation(e); + } + }, + _dragStartMultiple: function _dragStartMultiple(e) { + var overlay = e.target; + var map = this._map; + var i; + + if (!this.isCollected(overlay)) { + return; + } + + this.eachLayer(function (layer) { + layer._dragStartPoints = {}; + layer.deselect(); + + for (i = 0; i < 4; i++) { + var c = layer.getCorner(i); + layer._dragStartPoints[i] = map.latLngToLayerPoint(c); + } + }); + }, + _dragMultiple: function _dragMultiple(e) { + var overlay = e.target; + var map = this._map; + + if (!this.isCollected(overlay)) { + return; + } + + var topLeft = map.latLngToLayerPoint(overlay.getCorner(0)); + + var delta = overlay._dragStartPoints[0].subtract(topLeft); + + this._updateCollectionFromPoints(delta, overlay); + }, + _toRemove: function _toRemove() { + var _this3 = this; + + var layerArr = this.getLayers(); + return layerArr.filter(function (layer) { + var mode = layer.editing._mode; + return _this3.isCollected(layer) && mode !== 'lock'; + }); + }, + _toMove: function _toMove(overlay) { + var _this4 = this; + + var layerArr = this.getLayers(); + return layerArr.filter(function (layer) { + var mode = layer.editing._mode; + return layer !== overlay && _this4.isCollected(layer) && mode !== 'lock'; + }); + }, + _updateCollectionFromPoints: function _updateCollectionFromPoints(delta, overlay) { + var layersToMove = this._toMove(overlay); + + var p = new L.Transformation(1, -delta.x, 1, -delta.y); + var i; + layersToMove.forEach(function (layer) { + var movedPoints = {}; + + for (i = 0; i < 4; i++) { + movedPoints[i] = p.transform(layer._dragStartPoints[i]); + } + + layer.setCornersFromPoints(movedPoints); + }); + }, + _getAvgCmPerPixel: function _getAvgCmPerPixel(imgs) { + var reduce = imgs.reduce(function (sum, img) { + return sum + img.cm_per_pixel; + }, 0); + return reduce / imgs.length; + }, + generateExportJson: function generateExportJson() { + var json = {}; + json.images = []; + this.eachLayer(function (layer) { + if (this.isCollected(layer)) { + var sections = layer._image.src.split('/'); + + var filename = sections[sections.length - 1]; + var zc = layer.getCorners(); + var corners = [{ + lat: zc[0].lat, + lon: zc[0].lng + }, { + lat: zc[1].lat, + lon: zc[1].lng + }, { + lat: zc[3].lat, + lon: zc[3].lng + }, { + lat: zc[2].lat, + lon: zc[2].lng + }]; + json.images.push({ + id: this.getLayerId(layer), + src: layer._image.src, + width: layer._image.width, + height: layer._image.height, + image_file_name: filename, + nodes: corners, + cm_per_pixel: L.ImageUtil.getCmPerPixel(layer) }); - }, - 477: function () { - (L.DistortableImageOverlay = L.ImageOverlay.extend({ - options: { - height: 200, - crossOrigin: !0, - edgeMinWidth: 50, - editable: !0, - mode: "distort", - selected: !1, - }, - initialize: function (t, e) { - L.setOptions(this, e), - L.Utils.initTranslation.call(this), - (this.edgeMinWidth = this.options.edgeMinWidth), - (this.editable = this.options.editable), - (this._selected = this.options.selected), - (this._url = t), - (this.rotation = {}); - }, - onAdd: function (t) { - var e = this; - (this._map = t), - this.getElement() || this._initImage(), - t.on("viewreset", this._reset, this), - this.options.corners && - ((this._corners = this.options.corners), - t.options.zoomAnimation && - L.Browser.any3d && - t.on("zoomanim", this._animateZoom, this)), - L.DomEvent.on(this.getElement(), "load", function () { - if ( - (e.getPane().appendChild(e.getElement()), - e._initImageDimensions(), - e.options.rotation) - ) { - var i = e.options.rotation.deg ? "deg" : "rad"; - e.setAngle(e.options.rotation[i], i); - } else (e.rotation = { deg: 0, rad: 0 }), e._reset(); - e._corners || - (t.options.zoomAnimation && - L.Browser.any3d && - t.on("zoomanim", e._animateZoom, e)); - var o = e._eventParents; - o - ? ((e.eP = o[Object.keys(o)[0]]), - e.eP.editable && e.editing.enable()) - : (e.editable && e.editing.enable(), (e.eP = null)); - }), - L.DomEvent.on(this.getElement(), "click", this.select, this), - L.DomEvent.on( - t, - { - singleclickon: this._singleClickListeners, - singleclickoff: this._resetClickListeners, - singleclick: this._singleClick, - }, - this - ), - t.doubleClickZoom.enabled() || - t.doubleClickLabels.enabled() || - L.DomEvent.on(t, "click", this.deselect, this), - this.fire("add"); - }, - onRemove: function (t) { - L.DomEvent.off(this.getElement(), "click", this.select, this), - L.DomEvent.off( - t, - { - singleclickon: this._singleClickListeners, - singleclickoff: this._resetClickListeners, - singleclick: this._singleClick, - }, - this - ), - L.DomEvent.off(t, "click", this.deselect, this), - this.editing && this.editing.disable(), - this.fire("remove"), - L.ImageOverlay.prototype.onRemove.call(this, t); - }, - _initImageDimensions: function () { - var t = this._map, - e = L.DomUtil.getStyle(this.getElement(), "width"), - i = L.DomUtil.getStyle(this.getElement(), "height"), - o = parseInt(e) / parseInt(i), - n = this.options.height, - a = parseInt(o * n), - s = t.project(t.getCenter()), - r = L.point(a, n).divideBy(2); - this.options.corners - ? (this._corners = this.options.corners) - : (this._corners = [ - t.unproject(s.subtract(r)), - t.unproject(s.add(L.point(r.x, -r.y))), - t.unproject(s.add(L.point(-r.x, r.y))), - t.unproject(s.add(r)), - ]), - (this._initialDimensions = { - center: s, - offset: r, - zoom: t.getZoom(), - }), - this.setBounds(L.latLngBounds(this.getCorners())); - }, - _singleClick: function (t) { - "singleclick" === t.type && this.deselect(); - }, - _singleClickListeners: function () { - var t = this._map; - L.DomEvent.off(t, "click", this.deselect, this), - L.DomEvent.on(t, "singleclick", this.deselect, this); - }, - _resetClickListeners: function () { - var t = this._map; - L.DomEvent.on(t, "click", this.deselect, this), - L.DomEvent.off(t, "singleclick", this.deselect, this); - }, - isSelected: function () { - return this._selected; - }, - deselect: function () { - var t = this.editing; - if (t.enabled()) - return ( - t._removeToolbar(), - t._hideMarkers(), - (this._selected = !1), - this.fire("deselect"), - this - ); - }, - select: function (t) { - var e = this.editing, - i = this.eP; - if (e.enabled()) { - if ( - (t && L.DomEvent.stopPropagation(t), - this._programmaticGrouping(), - (this._selected = !0), - e._addToolbar(), - e._showMarkers(), - this.fire("select"), - !i || !i.anyCollected()) - ) - return this; - this.deselect(); - } - }, - _programmaticGrouping: function () { - this._map.eachLayer(function (t) { - t instanceof L.DistortableImageOverlay && t.deselect(); - }); - }, - setCorner: function (t, e) { - var i = this.editing; - return ( - (this._corners[t] = e), - this.setBounds(L.latLngBounds(this.getCorners())), - this.fire("update"), - i.toolbar && - i.toolbar instanceof L.DistortableImage.PopupBar && - i._updateToolbarPos(), - (this.edited = !0), - this - ); - }, - _cornerExceedsMapLats: function (t, e, i) { - return ( - i.options.crs != L.CRS.Simple && - (0 === t - ? ((o = i.project(e).y < 2), (n = i.project(e).y >= 255)) - : ((o = i.project(e).y / t < 2), - (n = i.project(e).y / Math.pow(2, t) >= 255)), - o || n) - ); - var o, n; - }, - setCorners: function (t) { - var e = this._map, - i = e.getZoom(), - o = this.editing, - n = 0; - for (var a in t) - if (this._cornerExceedsMapLats(i, t[a], e)) - return ( - this.setBounds(L.latLngBounds(this.getCorners())), - void this.fire("update") - ); - for (a in t) (this._corners[n] = t[a]), (n += 1); - return ( - this.setBounds(L.latLngBounds(this.getCorners())), - this.fire("update"), - o.toolbar && - o.toolbar instanceof L.DistortableImage.PopupBar && - o._updateToolbarPos(), - (this.edited = !0), - this - ); - }, - setCornersFromPoints: function (t) { - var e = this._map, - i = e.getZoom(), - o = this.editing, - n = 0; - for (var a in t) { - var s = e.layerPointToLatLng(t[a]); - if (this._cornerExceedsMapLats(i, s, e)) - return ( - this.setBounds(L.latLngBounds(this.getCorners())), - void this.fire("update") - ); - } - for (a in t) - (this._corners[n] = e.layerPointToLatLng(t[a])), (n += 1); - return ( - this.setBounds(L.latLngBounds(this.getCorners())), - this.fire("update"), - o.toolbar && - o.toolbar instanceof L.DistortableImage.PopupBar && - o._updateToolbarPos(), - (this.edited = !0), - this - ); - }, - scaleBy: function (t) { - var e, - i, - o = this._map, - n = o.project(this.getCenter()), - a = {}; - if (0 !== t) { - for (e = 0; e < 4; e++) - (i = o - .project(this.getCorner(e)) - .subtract(n) - .multiplyBy(t) - .add(n)), - (a[e] = o.unproject(i)); - return this.setCorners(a), this; + } + }, this); + json.images = json.images.reverse(); + json.avg_cm_per_pixel = this._getAvgCmPerPixel(json.images); + return json; + } +}); + +L.distortableCollection = function (id, options) { + return new L.DistortableCollection(id, options); +}; + +/***/ }), + +/***/ "./src/DistortableImageOverlay.js": +/*!****************************************!*\ + !*** ./src/DistortableImageOverlay.js ***! + \****************************************/ +/***/ (function() { + +L.DistortableImageOverlay = L.ImageOverlay.extend({ + options: { + height: 200, + crossOrigin: true, + // todo: find ideal number to prevent distortions during RotateScale, and make it dynamic (remove hardcoding) + edgeMinWidth: 50, + editable: true, + mode: 'distort', + selected: false + }, + initialize: function initialize(url, options) { + L.setOptions(this, options); + L.Utils.initTranslation.call(this); + this.edgeMinWidth = this.options.edgeMinWidth; + this.editable = this.options.editable; + this._selected = this.options.selected; + this._url = url; + this.rotation = {}; + }, + onAdd: function onAdd(map) { + var _this = this; + + this._map = map; + + if (!this.getElement()) { + this._initImage(); + } + + map.on('viewreset', this._reset, this); + + if (this.options.corners) { + this._corners = this.options.corners; + + if (map.options.zoomAnimation && L.Browser.any3d) { + map.on('zoomanim', this._animateZoom, this); + } + } // Have to wait for the image to load because need to access its w/h + + + L.DomEvent.on(this.getElement(), 'load', function () { + _this.getPane().appendChild(_this.getElement()); + + _this._initImageDimensions(); + + if (_this.options.rotation) { + var units = _this.options.rotation.deg ? 'deg' : 'rad'; + + _this.setAngle(_this.options.rotation[units], units); + } else { + _this.rotation = { + deg: 0, + rad: 0 + }; + + _this._reset(); + } + /* Initialize default corners if not already set */ + + + if (!_this._corners) { + if (map.options.zoomAnimation && L.Browser.any3d) { + map.on('zoomanim', _this._animateZoom, _this); + } + } + /** if there is a featureGroup, only its editable option matters */ + + + var eventParents = _this._eventParents; + + if (eventParents) { + _this.eP = eventParents[Object.keys(eventParents)[0]]; + + if (_this.eP.editable) { + _this.editing.enable(); + } + } else { + if (_this.editable) { + _this.editing.enable(); + } + + _this.eP = null; + } + }); + L.DomEvent.on(this.getElement(), 'click', this.select, this); + L.DomEvent.on(map, { + singleclickon: this._singleClickListeners, + singleclickoff: this._resetClickListeners, + singleclick: this._singleClick + }, this); + /** + * custom events fired from DoubleClickLabels.js. Used to differentiate + * single / dblclick to not deselect images on map dblclick. + */ + + if (!(map.doubleClickZoom.enabled() || map.doubleClickLabels.enabled())) { + L.DomEvent.on(map, 'click', this.deselect, this); + } + + this.fire('add'); + }, + onRemove: function onRemove(map) { + L.DomEvent.off(this.getElement(), 'click', this.select, this); + L.DomEvent.off(map, { + singleclickon: this._singleClickListeners, + singleclickoff: this._resetClickListeners, + singleclick: this._singleClick + }, this); + L.DomEvent.off(map, 'click', this.deselect, this); + + if (this.editing) { + this.editing.disable(); + } + + this.fire('remove'); + L.ImageOverlay.prototype.onRemove.call(this, map); + }, + _initImageDimensions: function _initImageDimensions() { + var map = this._map; + var originalImageWidth = L.DomUtil.getStyle(this.getElement(), 'width'); + var originalImageHeight = L.DomUtil.getStyle(this.getElement(), 'height'); + var aspectRatio = parseInt(originalImageWidth) / parseInt(originalImageHeight); + var imageHeight = this.options.height; + var imageWidth = parseInt(aspectRatio * imageHeight); + var center = map.project(map.getCenter()); + var offset = L.point(imageWidth, imageHeight).divideBy(2); + + if (this.options.corners) { + this._corners = this.options.corners; + } else { + this._corners = [map.unproject(center.subtract(offset)), map.unproject(center.add(L.point(offset.x, -offset.y))), map.unproject(center.add(L.point(-offset.x, offset.y))), map.unproject(center.add(offset))]; + } + + this._initialDimensions = { + 'center': center, + 'offset': offset, + 'zoom': map.getZoom() + }; + this.setBounds(L.latLngBounds(this.getCorners())); + }, + _singleClick: function _singleClick(e) { + if (e.type === 'singleclick') { + this.deselect(); + } else { + return; + } + }, + _singleClickListeners: function _singleClickListeners() { + var map = this._map; + L.DomEvent.off(map, 'click', this.deselect, this); + L.DomEvent.on(map, 'singleclick', this.deselect, this); + }, + _resetClickListeners: function _resetClickListeners() { + var map = this._map; + L.DomEvent.on(map, 'click', this.deselect, this); + L.DomEvent.off(map, 'singleclick', this.deselect, this); + }, + isSelected: function isSelected() { + return this._selected; + }, + deselect: function deselect() { + var edit = this.editing; + + if (!edit.enabled()) { + return; + } + + edit._removeToolbar(); + + edit._hideMarkers(); + + this._selected = false; + this.fire('deselect'); + return this; + }, + select: function select(e) { + var edit = this.editing; + var eP = this.eP; + + if (!edit.enabled()) { + return; + } + + if (e) { + L.DomEvent.stopPropagation(e); + } // this ensures deselection of all other images, allowing us to keep collection group optional + + + this._programmaticGrouping(); + + this._selected = true; + + edit._addToolbar(); + + edit._showMarkers(); + + this.fire('select'); // we run the selection logic 1st anyway because the collection group's _addToolbar method depends on it + + if (eP && eP.anyCollected()) { + this.deselect(); + return; + } + + return this; + }, + _programmaticGrouping: function _programmaticGrouping() { + this._map.eachLayer(function (layer) { + if (layer instanceof L.DistortableImageOverlay) { + layer.deselect(); + } + }); + }, + setCorner: function setCorner(corner, latlng) { + var edit = this.editing; + this._corners[corner] = latlng; + this.setBounds(L.latLngBounds(this.getCorners())); + this.fire('update'); + + if (edit.toolbar && edit.toolbar instanceof L.DistortableImage.PopupBar) { + edit._updateToolbarPos(); + } + + this.edited = true; + return this; + }, + _cornerExceedsMapLats: function _cornerExceedsMapLats(zoom, corner, map) { + if (map.options.crs.Simple == L.CRS.Simple) { + return false; + } else { + var exceedsTop; + var exceedsBottom; + + if (zoom === 0) { + exceedsTop = map.project(corner).y < 2; + exceedsBottom = map.project(corner).y >= 255; + } else { + exceedsTop = map.project(corner).y / zoom < 2; + exceedsBottom = map.project(corner).y / Math.pow(2, zoom) >= 255; + } + + return exceedsTop || exceedsBottom; + } + }, + setCorners: function setCorners(latlngObj) { + var map = this._map; + var zoom = map.getZoom(); + var edit = this.editing; + var i = 0; // this is to fix https://github.com/publiclab/Leaflet.DistortableImage/issues/402 + + for (var k in latlngObj) { + if (this._cornerExceedsMapLats(zoom, latlngObj[k], map)) { + // calling reset / update w/ the same corners bc it prevents a marker flicker for rotate + this.setBounds(L.latLngBounds(this.getCorners())); + this.fire('update'); + return; + } + } + + for (var _k in latlngObj) { + this._corners[i] = latlngObj[_k]; + i += 1; + } + + this.setBounds(L.latLngBounds(this.getCorners())); + this.fire('update'); + + if (edit.toolbar && edit.toolbar instanceof L.DistortableImage.PopupBar) { + edit._updateToolbarPos(); + } + + this.edited = true; + return this; + }, + setCornersFromPoints: function setCornersFromPoints(pointsObj) { + var map = this._map; + var zoom = map.getZoom(); + var edit = this.editing; + var i = 0; + + for (var k in pointsObj) { + var corner = map.layerPointToLatLng(pointsObj[k]); + + if (this._cornerExceedsMapLats(zoom, corner, map)) { + // calling reset / update w/ the same corners bc it prevents a marker flicker for rotate + this.setBounds(L.latLngBounds(this.getCorners())); + this.fire('update'); + return; + } + } + + for (var _k2 in pointsObj) { + this._corners[i] = map.layerPointToLatLng(pointsObj[_k2]); + i += 1; + } + + this.setBounds(L.latLngBounds(this.getCorners())); + this.fire('update'); + + if (edit.toolbar && edit.toolbar instanceof L.DistortableImage.PopupBar) { + edit._updateToolbarPos(); + } + + this.edited = true; + return this; + }, + scaleBy: function scaleBy(scale) { + var map = this._map; + var center = map.project(this.getCenter()); + var i; + var p; + var scaledCorners = {}; + + if (scale === 0) { + return; + } + + for (i = 0; i < 4; i++) { + p = map.project(this.getCorner(i)).subtract(center).multiplyBy(scale).add(center); + scaledCorners[i] = map.unproject(p); + } + + this.setCorners(scaledCorners); + return this; + }, + getAngle: function getAngle() { + var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'deg'; + var matrix = this.getElement().style[L.DomUtil.TRANSFORM].split('matrix3d')[1].slice(1, -1).split(','); + var row0x = matrix[0]; + var row0y = matrix[1]; + var row1x = matrix[4]; + var row1y = matrix[5]; + var determinant = row0x * row1y - row0y * row1x; + var angle = L.TrigUtil.calcAngle(row0x, row0y, 'rad'); + + if (determinant < 0) { + angle += angle < 0 ? Math.PI : -Math.PI; + } + + if (angle < 0) { + angle = 2 * Math.PI + angle; + } + + return unit === 'deg' ? Math.round(L.TrigUtil.radiansToDegrees(angle)) : L.Util.formatNum(angle, 2); + }, + setAngle: function setAngle(angle) { + var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'deg'; + var currentAngle = this.getAngle(unit); + var angleToRotateBy = angle - currentAngle; + this.rotateBy(angleToRotateBy, unit); + return this; + }, + rotateBy: function rotateBy(angle) { + var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'deg'; + var map = this._map; + var center = map.project(this.getCenter()); + var corners = {}; + var i; + var p; + var q; + + if (unit === 'deg') { + angle = L.TrigUtil.degreesToRadians(angle); + } + + for (i = 0; i < 4; i++) { + p = map.project(this.getCorner(i)).subtract(center); + q = L.point(Math.cos(angle) * p.x - Math.sin(angle) * p.y, Math.sin(angle) * p.x + Math.cos(angle) * p.y); + corners[i] = map.unproject(q.add(center)); + } + + this.setCorners(corners); + return this; + }, + dragBy: function dragBy(formerPoint, newPoint) { + var map = this._map; + var i; + var p; + var transCorners = {}; + var delta = map.project(formerPoint).subtract(map.project(newPoint)); + + for (i = 0; i < 4; i++) { + p = map.project(this.getCorner(i)).subtract(delta); + transCorners[i] = map.unproject(p); + } + + this.setCorners(transCorners); + }, + restore: function restore() { + var map = this._map; + var center = this._initialDimensions.center; + var offset = this._initialDimensions.offset; + var zoom = this._initialDimensions.zoom; + var corners = [center.subtract(offset), center.add(L.point(offset.x, -offset.y)), center.add(L.point(-offset.x, offset.y)), center.add(offset)]; + + for (var i = 0; i < 4; i++) { + if (!map.unproject(corners[i], zoom).equals(this.getCorner(i))) { + this.setCorner(i, map.unproject(corners[i], zoom)); + } + } + + this.edited = false; + this.fire('restore'); + return this; + }, + + /* Copied from Leaflet v0.7 https://github.com/Leaflet/Leaflet/blob/66282f14bcb180ec87d9818d9f3c9f75afd01b30/src/dom/DomUtil.js#L189-L199 */ + + /* since L.DomUtil.getTranslateString() is deprecated in Leaflet v1.0 */ + _getTranslateString: function _getTranslateString(point) { + // on WebKit browsers (Chrome/Safari/iOS Safari/Android) + // using translate3d instead of translate + // makes animation smoother as it ensures HW accel is used. + // Firefox 13 doesn't care + // (same speed either way), Opera 12 doesn't support translate3d + var is3d = L.Browser.webkit3d; + var open = 'translate' + (is3d ? '3d' : '') + '('; + var close = (is3d ? ',0' : '') + ')'; + return open + point.x + 'px,' + point.y + 'px' + close; + }, + _reset: function _reset() { + var map = this._map; + var image = this.getElement(); + var latLngToLayerPoint = L.bind(map.latLngToLayerPoint, map); + + var transformMatrix = this._calculateProjectiveTransform(latLngToLayerPoint); + + var topLeft = latLngToLayerPoint(this.getCorner(0)); + var warp = L.DomUtil.getMatrixString(transformMatrix); + + var translation = this._getTranslateString(topLeft); + /* See L.DomUtil.setPosition. Mainly for the purposes of L.Draggable. */ + + + image._leaflet_pos = topLeft; + image.style[L.DomUtil.TRANSFORM] = [translation, warp].join(' '); + /* Set origin to the upper-left corner rather than + * the center of the image, which is the default. + */ + + image.style[L.DomUtil.TRANSFORM + '-origin'] = '0 0 0'; + this.rotation.deg = this.getAngle(); + this.rotation.rad = this.getAngle('rad'); + }, + + /* + * Calculates the transform string that will be + * correct *at the end* of zooming. + * Leaflet then generates a CSS3 animation between the current transform and + * future transform which makes the transition appear smooth. + */ + _animateZoom: function _animateZoom(event) { + var map = this._map; + var image = this.getElement(); + + var latLngToNewLayerPoint = function latLngToNewLayerPoint(latlng) { + return map._latLngToNewLayerPoint(latlng, event.zoom, event.center); + }; + + var transformMatrix = this._calculateProjectiveTransform(latLngToNewLayerPoint); + + var topLeft = latLngToNewLayerPoint(this.getCorner(0)); + var warp = L.DomUtil.getMatrixString(transformMatrix); + + var translation = this._getTranslateString(topLeft); + /* See L.DomUtil.setPosition. Mainly for the purposes of L.Draggable. */ + + + image._leaflet_pos = topLeft; + image.style[L.DomUtil.TRANSFORM] = [translation, warp].join(' '); + }, + getCorners: function getCorners() { + return this._corners; + }, + getCorner: function getCorner(i) { + return this._corners[i]; + }, + // image (vertex) centroid calculation + getCenter: function getCenter() { + var map = this._map; + var reduce = this.getCorners().reduce(function (agg, corner) { + return agg.add(map.project(corner)); + }, L.point(0, 0)); + return map.unproject(reduce.divideBy(4)); + }, + _calculateProjectiveTransform: function _calculateProjectiveTransform(latLngToCartesian) { + /* Setting reasonable but made-up image defaults + * allow us to place images on the map before + * they've finished downloading. */ + var offset = latLngToCartesian(this.getCorner(0)); + var w = this.getElement().offsetWidth || 500; + var h = this.getElement().offsetHeight || 375; + var c = []; + var j; + /* Convert corners to container points (i.e. cartesian coordinates). */ + + for (j = 0; j < 4; j++) { + c.push(latLngToCartesian(this.getCorner(j))._subtract(offset)); + } + /* + * This matrix describes the action of + * the CSS transform on each corner of the image. + * It maps from the coordinate system centered + * at the upper left corner of the image + * to the region bounded by the latlngs in this._corners. + * For example: + * 0, 0, c[0].x, c[0].y + * says that the upper-left corner of the image + * maps to the first latlng in this._corners. + */ + + + return L.MatrixUtil.general2DProjection(0, 0, c[0].x, c[0].y, w, 0, c[1].x, c[1].y, 0, h, c[2].x, c[2].y, w, h, c[3].x, c[3].y); + } +}); + +L.distortableImageOverlay = function (id, options) { + return new L.DistortableImageOverlay(id, options); +}; + +L.Map.addInitHook(function () { + if (!L.DomUtil.hasClass(this.getContainer(), 'ldi')) { + L.DomUtil.addClass(this.getContainer(), 'ldi'); + } +}); + +/***/ }), + +/***/ "./src/components/DistortableImage.Keymapper.js": +/*!******************************************************!*\ + !*** ./src/components/DistortableImage.Keymapper.js ***! + \******************************************************/ +/***/ (function() { + +var _this = this; + +L.DomUtil = L.DomUtil || {}; +L.DistortableImage = L.DistortableImage || {}; +L.distortableImage = L.DistortableImage; +L.DistortableImage.Keymapper = L.Handler.extend({ + options: { + position: 'topright' + }, + initialize: function initialize(map, options) { + this._map = map; + L.setOptions(this, options); + }, + addHooks: function addHooks() { + if (!this._keymapper) { + this._container = this._buildContainer(); + this._scrollWrapper = this._wrap(); + this._toggler = this._createButton(); + + this._setMapper(this._container, this._scrollWrapper, this._toggler); + + L.DomEvent.on(this._toggler, 'click', this._toggleKeymapper, this); + L.DomEvent.disableClickPropagation(this._container); + L.DomEvent.disableScrollPropagation(this._container); + } + }, + removeHooks: function removeHooks() { + if (this._keymapper) { + L.DomEvent.off(this._toggler, 'click', this._toggleKeymapper, this); + L.DomUtil.remove(this._toggler); + L.DomUtil.remove(this._scrollWrapper); + L.DomUtil.remove(this._container); + this._keymapper = false; + } + }, + _buildContainer: function _buildContainer() { + var container = L.DomUtil.create('div', 'ldi-keymapper-hide'); + container.setAttribute('id', 'ldi-keymapper'); + var divider = L.DomUtil.create('br', 'divider'); + container.appendChild(divider); + return container; + }, + _createButton: function _createButton() { + var toggler = L.DomUtil.create('a', ''); + toggler.innerHTML = L.IconUtil.create('keyboard_open'); + toggler.setAttribute('id', 'toggle-keymapper'); + toggler.setAttribute('href', '#'); + toggler.setAttribute('title', 'Show keymap'); // Will force screen readers like VoiceOver to read this as "Show keymap - button" + + toggler.setAttribute('role', 'button'); + toggler.setAttribute('aria-label', 'Show keymap'); + return toggler; + }, + _wrap: function _wrap() { + var wrap = L.DomUtil.create('div', ''); + wrap.setAttribute('id', 'keymapper-wrapper'); + wrap.style.display = 'none'; + return wrap; + }, + _setMapper: function _setMapper(container, wrap, button) { + this._keymapper = L.control({ + position: this.options.position + }); + + this._keymapper.onAdd = function () { + container.appendChild(wrap); + wrap.insertAdjacentHTML('beforeend', '' + '
' + + /* eslint-disable */ + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Rotate Mode
R
RotateScale Mode
r
Scale Mode
s
Distort Mode
d
Drag Mode
D
Lock (Mode) / Unlock Image
l\xa0u
Stack up / down
q\xa0a
Add / Remove Image Border
b
Toggle Opacity
o
Deselect All
esc
Delete Image(s)
delete\xa0backspace
Export Image(s)
e
'); + /* eslint-enable */ + + container.appendChild(button); + return container; + }; + + this._keymapper.addTo(this._map); + }, + _toggleKeymapper: function _toggleKeymapper(e) { + e.preventDefault(); + this._container.className = this._container.className === 'ldi-keymapper leaflet-control' ? 'ldi-keymapper-hide leaflet-control' : 'ldi-keymapper leaflet-control'; + this._scrollWrapper.style.display = this._scrollWrapper.style.display === 'none' ? 'block' : 'none'; + this._toggler.innerHTML = this._toggler.innerHTML === 'close' ? L.IconUtil.create('keyboard_open') : 'close'; + L.IconUtil.toggleTitle(this._toggler, 'Show keymap', 'Hide keymap'); + L.DomUtil.toggleClass(this._toggler, 'close-icon'); + }, + _injectIconSet: function _injectIconSet() { + if (document.querySelector('#keymapper-iconset')) { + return; + } + + var el = L.DomUtil.create('div', ''); + el.id = 'keymapper-iconset'; + el.setAttribute('hidden', 'hidden'); + this._iconset = new L.KeymapperIconSet().render(); + el.innerHTML = this._iconset; + document.querySelector('.leaflet-control-container').appendChild(el); + } +}); +L.DistortableImage.Keymapper.addInitHook(function () { + L.DistortableImage.Keymapper.prototype._n = L.DistortableImage.Keymapper.prototype._n ? L.DistortableImage.Keymapper.prototype._n + 1 : 1; // dont enable keymapper for mobile + + if (L.DistortableImage.Keymapper.prototype._n === 1 && !L.Browser.mobile) { + _this.enable(); + + _this._injectIconSet(); + } +}); + +L.distortableImage.keymapper = function (map, options) { + return new L.DistortableImage.Keymapper(map, options); +}; + +/***/ }), + +/***/ "./src/edit/DistortableCollection.Edit.js": +/*!************************************************!*\ + !*** ./src/edit/DistortableCollection.Edit.js ***! + \************************************************/ +/***/ (function() { + +L.DistortableImage = L.DistortableImage || {}; // this class holds the keybindings and toolbar API for an image collection instance + +L.DistortableCollection.Edit = L.Handler.extend({ + options: { + keymap: L.distortableImage.group_action_map + }, + initialize: function initialize(group, options) { + this._group = group; + this._exportOpts = group.options.exportOpts; + L.setOptions(this, options); + L.distortableImage.group_action_map.Escape = '_decollectAll'; + }, + addHooks: function addHooks() { + var group = this._group; + var map = group._map; + this.editActions = this.options.actions; + this.runExporter = L.bind(L.Utils.getNestedVal(this, '_exportOpts', 'exporter') || this.startExport, this); + L.DomEvent.on(document, 'keydown', this._onKeyDown, this); + + if (!(map.doubleClickZoom.enabled() || map.doubleClickLabels.enabled())) { + L.DomEvent.on(map, 'click', this._decollectAll, this); + } + + L.DomEvent.on(map, { + singleclickon: this._singleClickListeners, + singleclickoff: this._resetClickListeners, + singleclick: this._singleClick, + boxcollectend: this._addCollections + }, this); + this._group.editable = true; + + this._group.eachLayer(function (layer) { + return layer.editing.enable(); + }); + }, + removeHooks: function removeHooks() { + var group = this._group; + var map = group._map; + L.DomEvent.off(document, 'keydown', this._onKeyDown, this); + + if (!(map.doubleClickZoom.enabled() || map.doubleClickLabels.enabled())) { + L.DomEvent.off(map, 'click', this._decollectAll, this); + } + + L.DomEvent.off(map, { + singleclickon: this._singleClickListeners, + singleclickoff: this._resetClickListeners, + singleclick: this._singleClick, + boxcollectend: this._addCollections + }, this); + + this._decollectAll(); + + this._group.editable = false; + + this._group.eachLayer(function (layer) { + return layer.editing.disable(); + }); + }, + enable: function enable() { + this._enabled = true; + this.addHooks(); + return this; + }, + disable: function disable() { + this._enabled = false; + this.removeHooks(); + return this; + }, + _onKeyDown: function _onKeyDown(e) { + var keymap = this.options.keymap; + var handlerName = keymap[e.key]; + + if (!this[handlerName]) { + return; + } + + if (this._group.anyCollected()) { + this[handlerName].call(this); + } + }, + _singleClick: function _singleClick(e) { + if (e.type === 'singleclick') { + this._decollectAll(e); + } else { + return; + } + }, + _singleClickListeners: function _singleClickListeners() { + var map = this._group._map; + L.DomEvent.off(map, 'click', this._decollectAll, this); + L.DomEvent.on(map, 'singleclick', this._decollectAll, this); + }, + _resetClickListeners: function _resetClickListeners() { + var map = this._group._map; + L.DomEvent.on(map, 'click', this._decollectAll, this); + L.DomEvent.off(map, 'singleclick', this._decollectAll, this); + }, + _decollectAll: function _decollectAll(e) { + var oe; + + if (e) { + oe = e.originalEvent; + } + /** + * prevents image deselection following the 'boxcollectend' event - note 'shift' must not be released until dragging is complete + * also prevents deselection following a click on a disabled img by differentiating it from the map + */ + + + if (oe && (oe.shiftKey || oe.target instanceof HTMLImageElement)) { + return; + } + + this._group.eachLayer(function (layer) { + L.DomUtil.removeClass(layer.getElement(), 'collected'); + layer.deselect(); + }); + + this._removeToolbar(); + + if (e) { + L.DomEvent.stopPropagation(e); + } + }, + _unlockGroup: function _unlockGroup() { + var _this = this; + + if (!this.hasTool(L.UnlockAction)) { + return; + } + + this._group.eachLayer(function (layer) { + if (_this._group.isCollected(layer)) { + var edit = layer.editing; + + edit._unlock(); // unlock updates the layer's handles; deselect to ensure they're hidden + + + layer.deselect(); + } + }); + }, + _lockGroup: function _lockGroup() { + var _this2 = this; + + if (!this.hasTool(L.LockAction)) { + return; + } + + this._group.eachLayer(function (layer) { + if (_this2._group.isCollected(layer)) { + var edit = layer.editing; + + edit._lock(); // map.addLayer also deselects the image, so we reselect here + + + L.DomUtil.addClass(layer.getElement(), 'collected'); + } + }); + }, + _addCollections: function _addCollections(e) { + var _this3 = this; + + var box = e.boxCollectBounds; + var map = this._group._map; + + this._group.eachLayer(function (layer) { + var edit = layer.editing; + + if (layer.isSelected()) { + layer.deselect(); + } + + var zoom = map.getZoom(); + var center = map.getCenter(); + var imgBounds = L.latLngBounds(layer.getCorner(2), layer.getCorner(1)); + imgBounds = map._latLngBoundsToNewLayerBounds(imgBounds, zoom, center); + + if (box.intersects(imgBounds) && edit.enabled()) { + if (!_this3.toolbar) { + _this3._addToolbar(); + } + + L.DomUtil.addClass(layer.getElement(), 'collected'); + } + }); + }, + _removeGroup: function _removeGroup(e) { + var _this4 = this; + + if (!this.hasTool(L.DeleteAction)) { + return; + } + + var layersToRemove = this._group._toRemove(); + + var n = layersToRemove.length; + + if (n === 0) { + return; + } + + var choice = L.DomUtil.confirmDeletes(n); + + if (choice) { + layersToRemove.forEach(function (layer) { + _this4._group.removeLayer(layer); + }); + + if (!this._group.anyCollected()) { + this._removeToolbar(); + } + } + + if (e) { + L.DomEvent.stopPropagation(e); + } + }, + cancelExport: function cancelExport() { + if (!this.customCollection) { + this._exportOpts.collection = undefined; + } + + clearInterval(this.updateInterval); + }, + _addToolbar: function _addToolbar() { + var group = this._group; + var map = group._map; + + if (group.options.suppressToolbar || this.toolbar) { + return; + } + + this.toolbar = L.distortableImage.controlBar({ + actions: this.editActions, + position: 'topleft' + }).addTo(map, group); + }, + _removeToolbar: function _removeToolbar() { + var map = this._group._map; + + if (this.toolbar) { + map.removeLayer(this.toolbar); + this.toolbar = false; + } else { + return false; + } + }, + hasTool: function hasTool(value) { + return this.editActions.some(function (action) { + return action === value; + }); + }, + addTool: function addTool(value) { + if (value.baseClass === 'leaflet-toolbar-icon' && !this.hasTool(value)) { + this._removeToolbar(); + + this.editActions.push(value); + + this._addToolbar(); + } + + return this; + }, + removeTool: function removeTool(value) { + var _this5 = this; + + this.editActions.some(function (item, idx) { + if (_this5.editActions[idx] === value) { + _this5._removeToolbar(); + + _this5.editActions.splice(idx, 1); + + _this5._addToolbar(); + + return true; + } else { + return false; + } + }); + return this; + }, + startExport: function startExport() { + var _this6 = this; + + if (!this.hasTool(L.ExportAction)) { + return; + } + + return new Promise(function (resolve) { + var opts = _this6._exportOpts; + opts.resolve = resolve; // allow resolving promise in user-defined functions, to stop spinner on completion + + var statusUrl; + _this6.updateInterval = null; // this may be overridden to update the UI to show export progress or completion + + var _defaultUpdater = function _defaultUpdater(data) { + data = JSON.parse(data); // optimization: fetch status directly from google storage: + + if (data.status_url) { + if (statusUrl !== data.status_url && data.status_url.match('.json')) { + // if (data.status_url && data.status_url.substr(0,1) === "/") { + // opts.statusUrl = opts.statusUrl + data.status_url; + // } else { + statusUrl = data.status_url; // } } - }, - getAngle: function () { - var t = - arguments.length > 0 && void 0 !== arguments[0] - ? arguments[0] - : "deg", - e = this.getElement() - .style[L.DomUtil.TRANSFORM].split("matrix3d")[1] - .slice(1, -1) - .split(","), - i = e[0], - o = e[1], - n = e[4], - a = e[5], - s = i * a - o * n, - r = L.TrigUtil.calcAngle(i, o, "rad"); - return ( - s < 0 && (r += r < 0 ? Math.PI : -Math.PI), - r < 0 && (r = 2 * Math.PI + r), - "deg" === t - ? Math.round(L.TrigUtil.radiansToDegrees(r)) - : L.Util.formatNum(r, 2) - ); - }, - setAngle: function (t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : "deg", - i = this.getAngle(e), - o = t - i; - return this.rotateBy(o, e), this; - }, - rotateBy: function (t) { - var e, - i, - o, - n = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : "deg", - a = this._map, - s = a.project(this.getCenter()), - r = {}; - for ( - "deg" === n && (t = L.TrigUtil.degreesToRadians(t)), e = 0; - e < 4; - e++ - ) - (i = a.project(this.getCorner(e)).subtract(s)), - (o = L.point( - Math.cos(t) * i.x - Math.sin(t) * i.y, - Math.sin(t) * i.x + Math.cos(t) * i.y - )), - (r[e] = a.unproject(o.add(s))); - return this.setCorners(r), this; - }, - dragBy: function (t, e) { - var i, - o, - n = this._map, - a = {}, - s = n.project(t).subtract(n.project(e)); - for (i = 0; i < 4; i++) - (o = n.project(this.getCorner(i)).subtract(s)), - (a[i] = n.unproject(o)); - this.setCorners(a); - }, - restore: function () { - for ( - var t = this._map, - e = this._initialDimensions.center, - i = this._initialDimensions.offset, - o = this._initialDimensions.zoom, - n = [ - e.subtract(i), - e.add(L.point(i.x, -i.y)), - e.add(L.point(-i.x, i.y)), - e.add(i), - ], - a = 0; - a < 4; - a++ - ) - t.unproject(n[a], o).equals(this.getCorner(a)) || - this.setCorner(a, t.unproject(n[a], o)); - return (this.edited = !1), this.fire("restore"), this; - }, - _getTranslateString: function (t) { - var e = L.Browser.webkit3d, - i = (e ? ",0" : "") + ")"; - return ( - "translate" + (e ? "3d" : "") + "(" + t.x + "px," + t.y + "px" + i - ); - }, - _reset: function () { - var t = this._map, - e = this.getElement(), - i = L.bind(t.latLngToLayerPoint, t), - o = this._calculateProjectiveTransform(i), - n = i(this.getCorner(0)), - a = L.DomUtil.getMatrixString(o), - s = this._getTranslateString(n); - (e._leaflet_pos = n), - (e.style[L.DomUtil.TRANSFORM] = [s, a].join(" ")), - (e.style[L.DomUtil.TRANSFORM + "-origin"] = "0 0 0"), - (this.rotation.deg = this.getAngle()), - (this.rotation.rad = this.getAngle("rad")); - }, - _animateZoom: function (t) { - var e = this._map, - i = this.getElement(), - o = function (i) { - return e._latLngToNewLayerPoint(i, t.zoom, t.center); - }, - n = this._calculateProjectiveTransform(o), - a = o(this.getCorner(0)), - s = L.DomUtil.getMatrixString(n), - r = this._getTranslateString(a); - (i._leaflet_pos = a), - (i.style[L.DomUtil.TRANSFORM] = [r, s].join(" ")); - }, - getCorners: function () { - return this._corners; - }, - getCorner: function (t) { - return this._corners[t]; - }, - getCenter: function () { - var t = this._map, - e = this.getCorners().reduce(function (e, i) { - return e.add(t.project(i)); - }, L.point(0, 0)); - return t.unproject(e.divideBy(4)); - }, - _calculateProjectiveTransform: function (t) { - var e, - i = t(this.getCorner(0)), - o = this.getElement().offsetWidth || 500, - n = this.getElement().offsetHeight || 375, - a = []; - for (e = 0; e < 4; e++) a.push(t(this.getCorner(e))._subtract(i)); - return L.MatrixUtil.general2DProjection( - 0, - 0, - a[0].x, - a[0].y, - o, - 0, - a[1].x, - a[1].y, - 0, - n, - a[2].x, - a[2].y, - o, - n, - a[3].x, - a[3].y - ); - }, - })), - (L.distortableImageOverlay = function (t, e) { - return new L.DistortableImageOverlay(t, e); - }), - L.Map.addInitHook(function () { - L.DomUtil.hasClass(this.getContainer(), "ldi") || - L.DomUtil.addClass(this.getContainer(), "ldi"); - }); - }, - 782: function () { - var t = this; - (L.DomUtil = L.DomUtil || {}), - (L.DistortableImage = L.DistortableImage || {}), - (L.distortableImage = L.DistortableImage), - (L.DistortableImage.Keymapper = L.Handler.extend({ - options: { position: "topright" }, - initialize: function (t, e) { - (this._map = t), L.setOptions(this, e); - }, - addHooks: function () { - this._keymapper || - ((this._container = this._buildContainer()), - (this._scrollWrapper = this._wrap()), - (this._toggler = this._createButton()), - this._setMapper( - this._container, - this._scrollWrapper, - this._toggler - ), - L.DomEvent.on( - this._toggler, - "click", - this._toggleKeymapper, - this - ), - L.DomEvent.disableClickPropagation(this._container), - L.DomEvent.disableScrollPropagation(this._container)); - }, - removeHooks: function () { - this._keymapper && - (L.DomEvent.off( - this._toggler, - "click", - this._toggleKeymapper, - this - ), - L.DomUtil.remove(this._toggler), - L.DomUtil.remove(this._scrollWrapper), - L.DomUtil.remove(this._container), - (this._keymapper = !1)); - }, - _buildContainer: function () { - var t = L.DomUtil.create("div", "ldi-keymapper-hide"); - t.setAttribute("id", "ldi-keymapper"); - var e = L.DomUtil.create("br", "divider"); - return t.appendChild(e), t; - }, - _createButton: function () { - var t = L.DomUtil.create("a", ""); - return ( - (t.innerHTML = L.IconUtil.create("keyboard_open")), - t.setAttribute("id", "toggle-keymapper"), - t.setAttribute("href", "#"), - t.setAttribute("title", "Show keymap"), - t.setAttribute("role", "button"), - t.setAttribute("aria-label", "Show keymap"), - t - ); - }, - _wrap: function () { - var t = L.DomUtil.create("div", ""); - return ( - t.setAttribute("id", "keymapper-wrapper"), - (t.style.display = "none"), - t - ); - }, - _setMapper: function (t, e, i) { - (this._keymapper = L.control({ position: this.options.position })), - (this._keymapper.onAdd = function () { - return ( - t.appendChild(e), - e.insertAdjacentHTML( - "beforeend", - '
Rotate Mode
R
RotateScale Mode
r
Scale Mode
s
Distort Mode
d
Drag Mode
D
Lock (Mode) / Unlock Image
l u
Stack up / down
q a
Add / Remove Image Border
b
Toggle Opacity
o
Deselect All
esc
Delete Image(s)
delete backspace
Export Image(s)
e
' - ), - t.appendChild(i), - t - ); - }), - this._keymapper.addTo(this._map); - }, - _toggleKeymapper: function (t) { - t.preventDefault(), - (this._container.className = - "ldi-keymapper leaflet-control" === this._container.className - ? "ldi-keymapper-hide leaflet-control" - : "ldi-keymapper leaflet-control"), - (this._scrollWrapper.style.display = - "none" === this._scrollWrapper.style.display - ? "block" - : "none"), - (this._toggler.innerHTML = - "close" === this._toggler.innerHTML - ? L.IconUtil.create("keyboard_open") - : "close"), - L.IconUtil.toggleTitle( - this._toggler, - "Show keymap", - "Hide keymap" - ), - L.DomUtil.toggleClass(this._toggler, "close-icon"); - }, - _injectIconSet: function () { - if (!document.querySelector("#keymapper-iconset")) { - var t = L.DomUtil.create("div", ""); - (t.id = "keymapper-iconset"), - t.setAttribute("hidden", "hidden"), - (this._iconset = new L.KeymapperIconSet().render()), - (t.innerHTML = this._iconset), - document - .querySelector(".leaflet-control-container") - .appendChild(t); + + if (data.status === 'complete') { + clearInterval(_this6.updateInterval); + + if (!_this6.customCollection) { + _this6._exportOpts.collection = undefined; } - }, - })), - L.DistortableImage.Keymapper.addInitHook(function () { - (L.DistortableImage.Keymapper.prototype._n = L.DistortableImage - .Keymapper.prototype._n - ? L.DistortableImage.Keymapper.prototype._n + 1 - : 1), - 1 !== L.DistortableImage.Keymapper.prototype._n || - L.Browser.mobile || - (t.enable(), t._injectIconSet()); - }), - (L.distortableImage.keymapper = function (t, e) { - return new L.DistortableImage.Keymapper(t, e); - }); - }, - 428: function () { - (L.DistortableImage = L.DistortableImage || {}), - (L.DistortableCollection.Edit = L.Handler.extend({ - options: { keymap: L.distortableImage.group_action_map }, - initialize: function (t, e) { - (this._group = t), - (this._exportOpts = t.options.exportOpts), - L.setOptions(this, e), - (L.distortableImage.group_action_map.Escape = "_decollectAll"); - }, - addHooks: function () { - var t = this._group._map; - (this.editActions = this.options.actions), - (this.runExporter = L.bind( - L.Utils.getNestedVal(this, "_exportOpts", "exporter") || - this.startExport, - this - )), - L.DomEvent.on(document, "keydown", this._onKeyDown, this), - t.doubleClickZoom.enabled() || - t.doubleClickLabels.enabled() || - L.DomEvent.on(t, "click", this._decollectAll, this), - L.DomEvent.on( - t, - { - singleclickon: this._singleClickListeners, - singleclickoff: this._resetClickListeners, - singleclick: this._singleClick, - boxcollectend: this._addCollections, - }, - this - ), - (this._group.editable = !0), - this._group.eachLayer(function (t) { - return t.editing.enable(); - }); - }, - removeHooks: function () { - var t = this._group._map; - L.DomEvent.off(document, "keydown", this._onKeyDown, this), - t.doubleClickZoom.enabled() || - t.doubleClickLabels.enabled() || - L.DomEvent.off(t, "click", this._decollectAll, this), - L.DomEvent.off( - t, - { - singleclickon: this._singleClickListeners, - singleclickoff: this._resetClickListeners, - singleclick: this._singleClick, - boxcollectend: this._addCollections, - }, - this - ), - this._decollectAll(), - (this._group.editable = !1), - this._group.eachLayer(function (t) { - return t.editing.disable(); - }); - }, - enable: function () { - return (this._enabled = !0), this.addHooks(), this; - }, - disable: function () { - return (this._enabled = !1), this.removeHooks(), this; - }, - _onKeyDown: function (t) { - var e = this.options.keymap[t.key]; - this[e] && this._group.anyCollected() && this[e].call(this); - }, - _singleClick: function (t) { - "singleclick" === t.type && this._decollectAll(t); - }, - _singleClickListeners: function () { - var t = this._group._map; - L.DomEvent.off(t, "click", this._decollectAll, this), - L.DomEvent.on(t, "singleclick", this._decollectAll, this); - }, - _resetClickListeners: function () { - var t = this._group._map; - L.DomEvent.on(t, "click", this._decollectAll, this), - L.DomEvent.off(t, "singleclick", this._decollectAll, this); - }, - _decollectAll: function (t) { - var e; - t && (e = t.originalEvent), - (e && (e.shiftKey || e.target instanceof HTMLImageElement)) || - (this._group.eachLayer(function (t) { - L.DomUtil.removeClass(t.getElement(), "collected"), - t.deselect(); - }), - this._removeToolbar(), - t && L.DomEvent.stopPropagation(t)); - }, - _unlockGroup: function () { - var t = this; - this.hasTool(L.UnlockAction) && - this._group.eachLayer(function (e) { - t._group.isCollected(e) && (e.editing._unlock(), e.deselect()); - }); - }, - _lockGroup: function () { - var t = this; - this.hasTool(L.LockAction) && - this._group.eachLayer(function (e) { - t._group.isCollected(e) && - (e.editing._lock(), - L.DomUtil.addClass(e.getElement(), "collected")); - }); - }, - _addCollections: function (t) { - var e = this, - i = t.boxCollectBounds, - o = this._group._map; - this._group.eachLayer(function (t) { - var n = t.editing; - t.isSelected() && t.deselect(); - var a = o.getZoom(), - s = o.getCenter(), - r = L.latLngBounds(t.getCorner(2), t.getCorner(1)); - (r = o._latLngBoundsToNewLayerBounds(r, a, s)), - i.intersects(r) && - n.enabled() && - (e.toolbar || e._addToolbar(), - L.DomUtil.addClass(t.getElement(), "collected")); - }); - }, - _removeGroup: function (t) { - var e = this; - if (this.hasTool(L.DeleteAction)) { - var i = this._group._toRemove(), - o = i.length; - 0 !== o && - (L.DomUtil.confirmDeletes(o) && - (i.forEach(function (t) { - e._group.removeLayer(t); - }), - this._group.anyCollected() || this._removeToolbar()), - t && L.DomEvent.stopPropagation(t)); - } - }, - cancelExport: function () { - this.customCollection || (this._exportOpts.collection = void 0), - clearInterval(this.updateInterval); - }, - _addToolbar: function () { - var t = this._group, - e = t._map; - t.options.suppressToolbar || - this.toolbar || - (this.toolbar = L.distortableImage - .controlBar({ actions: this.editActions, position: "topleft" }) - .addTo(e, t)); - }, - _removeToolbar: function () { - var t = this._group._map; - if (!this.toolbar) return !1; - t.removeLayer(this.toolbar), (this.toolbar = !1); - }, - hasTool: function (t) { - return this.editActions.some(function (e) { - return e === t; - }); - }, - addTool: function (t) { - return ( - "leaflet-toolbar-icon" !== t.baseClass || - this.hasTool(t) || - (this._removeToolbar(), - this.editActions.push(t), - this._addToolbar()), - this - ); - }, - removeTool: function (t) { - var e = this; - return ( - this.editActions.some(function (i, o) { - return ( - e.editActions[o] === t && - (e._removeToolbar(), - e.editActions.splice(o, 1), - e._addToolbar(), - !0) - ); - }), - this - ); - }, - startExport: function () { - var t = this; - if (this.hasTool(L.ExportAction)) - return new Promise(function (e) { - var i, - o = t._exportOpts; - (o.resolve = e), - (t.updateInterval = null), - (t.customCollection = !!o.collection), - t.customCollection || - (o.collection = t._group.generateExportJson().images), - (o.frequency = o.frequency || 3e3), - (o.scale = o.scale || 100), - (o.updater = - o.updater || - function (n) { - (n = JSON.parse(n)).status_url && - (i !== n.status_url && - n.status_url.match(".json") && - (i = n.status_url), - "complete" === n.status && - (clearInterval(t.updateInterval), - t.customCollection || - (t._exportOpts.collection = void 0), - e(), - null !== n.jpg && - alert("Export succeeded. " + o.exportUrl + n.jpg)), - console.log(n)); - }), - (o.handleStatusRes = - o.handleStatusRes || - function (e) { - (i = o.statusUrl + e), - (t.updateInterval = setInterval(function () { - var t = new Request( - "".concat(i, "?").concat(Date.now()), - { method: "GET" } - ); - fetch(t) - .then(function (t) { - if (t.ok) return t.text(); - }) - .then(o.updater); - }, o.frequency)); - }), - (o.fetchStatusUrl = - o.fetchStatusUrl || - function (t) { - var e = new FormData(); - e.append("collection", JSON.stringify(t.collection)), - e.append("scale", t.scale), - e.append("upload", !0); - var i = { method: "POST", body: e }, - o = new Request(t.exportStartUrl, i); - fetch(o) - .then(function (t) { - if (t.ok) return t.text(); - }) - .then(t.handleStatusRes); - }), - o.fetchStatusUrl(o); - }); - }, - })), - (L.distortableCollection.edit = function (t, e) { - return new L.DistortableCollection.Edit(t, e); - }); - }, - 397: function () { - (L.DistortableImage = L.DistortableImage || {}), - (L.DistortableImage.Edit = L.Handler.extend({ - options: { - opacity: 0.7, - outline: "1px solid red", - keymap: L.distortableImage.action_map, - }, - initialize: function (t, e) { - (this._overlay = t), - (this._toggledImage = !1), - (this._mode = t.options.mode), - (this._transparent = !1), - (this._outlined = !1), - L.setOptions(this, e), - (L.distortableImage.action_map.Escape = "_deselect"); - }, - addHooks: function () { - var t = this._overlay; - (this.editActions = this.options.actions), - t.bringToFront(), - this._initModes(), - this._initHandles(), - this._appendHandlesandDragable(), - t.isSelected() && - !t.options.suppressToolbar && - this._addToolbar(), - (this.parentGroup = !!t.eP && t.eP), - L.DomEvent.on(t.getElement(), { dblclick: this.nextMode }, this), - L.DomEvent.on(window, "keydown", this._onKeyDown, this); - }, - removeHooks: function () { - var t = this._overlay, - e = this.parentGroup; - for (var i in (this._disableDragging(), - this.toolbar && this._removeToolbar(), - this._handles)) - L.DomUtil.remove(i); - L.DomUtil.hasClass(t.getElement(), "collected") && - L.DomUtil.removeClass(t.getElement(), "collected"), - e && - !e.anyCollected() && - e.editing.toolbar && - e.editing._removeToolbar(), - L.DomEvent.off(t.getElement(), { dblclick: this.nextMode }, this), - L.DomEvent.off(window, "keydown", this._onKeyDown, this); - }, - disable: function () { - return this._enabled - ? (this._overlay.deselect(), - (this._enabled = !1), - this.removeHooks(), - this) - : this; - }, - _initModes: function () { - for (var t in ((this._modes = {}), L.DistortableImage.Edit.MODES)) { - var e = L.DistortableImage.Edit.MODES[t]; - -1 !== this.editActions.indexOf(e) && (this._modes[t] = e); - } - this._modes[this._mode] || - (this._mode = Object.keys(this._modes)[0]); - }, - _initHandles: function () { - var t, - e = this._overlay; - for (this._dragHandles = L.layerGroup(), t = 0; t < 4; t++) - this._dragHandles.addLayer(L.dragHandle(e, t)); - for (this._scaleHandles = L.layerGroup(), t = 0; t < 4; t++) - this._scaleHandles.addLayer(L.scaleHandle(e, t)); - for (this._distortHandles = L.layerGroup(), t = 0; t < 4; t++) - this._distortHandles.addLayer(L.distortHandle(e, t)); - for (this._rotateHandles = L.layerGroup(), t = 0; t < 4; t++) - this._rotateHandles.addLayer(L.rotateHandle(e, t)); - for (this._freeRotateHandles = L.layerGroup(), t = 0; t < 4; t++) - this._freeRotateHandles.addLayer(L.freeRotateHandle(e, t)); - for (this._lockHandles = L.layerGroup(), t = 0; t < 4; t++) - this._lockHandles.addLayer(L.lockHandle(e, t, { draggable: !1 })); - this._handles = { - drag: this._dragHandles, - scale: this._scaleHandles, - distort: this._distortHandles, - rotate: this._rotateHandles, - freeRotate: this._freeRotateHandles, - lock: this._lockHandles, - }; - }, - _appendHandlesandDragable: function () { - var t = this._overlay; - this._mode - ? (this._updateHandle(), - !t.isSelected() && - this.currentHandle && - this.currentHandle.eachLayer(function (t) { - t.setOpacity(0), t.dragging && t.dragging.disable(); - }), - this.isMode("lock") || this._enableDragging()) - : this._enableDragging(); - }, - _onKeyDown: function (t) { - var e = this.options.keymap[t.key], - i = this._overlay, - o = this.parentGroup; - (o && o.anyCollected()) || - void 0 === this[e] || - i.options.suppressToolbar || - (i.isSelected() && this.toolbar && this[e].call(this)); - }, - replaceTool: function (t, e) { - var i = this; - return ( - "leaflet-toolbar-icon" !== e.baseClass || - this.hasTool(e) || - this.editActions.some(function (o, n) { - if (o === t) { - for (var a in (i._removeToolbar(), - (i.editActions[n] = e), - i._addToolbar(), - L.DistortableImage.Edit.MODES)) - L.DistortableImage.Edit.MODES[a] === t - ? (delete i._modes[a], i._nextOrNone(a)) - : L.DistortableImage.Edit.MODES[a] === e && - (i._modes[a] = e); - return !0; - } - }), - this - ); - }, - addTool: function (t) { - if ("leaflet-toolbar-icon" === t.baseClass && !this.hasTool(t)) { - for (var e in (this._removeToolbar(), - this.editActions.push(t), - this._addToolbar(), - L.DistortableImage.Edit.MODES)) - L.DistortableImage.Edit.MODES[e] === t && (this._modes[e] = t); - this._overlay.isSelected() || this._removeToolbar(); - } - return this; - }, - hasTool: function (t) { - return this.editActions.some(function (e) { - return e === t; - }); - }, - removeTool: function (t) { - var e = this; - return ( - this.editActions.some(function (i, o) { - if (i === t) { - for (var n in (e._removeToolbar(), - e.editActions.splice(o, 1), - e._addToolbar(), - L.DistortableImage.Edit.MODES)) - L.DistortableImage.Edit.MODES[n] === t && - (delete e._modes[n], e._nextOrNone(n)); - return !0; - } - }), - this._overlay.isSelected() || this._removeToolbar(), - this - ); - }, - _nextOrNone: function (t) { - this.isMode(t) && - (Object.keys(this.getModes()).length >= 1 - ? this.nextMode() - : ("lock" === t && this._enableDragging(), - (this._mode = ""), - this._updateHandle())); - }, - _removeToolbar: function () { - var t = this._overlay._map; - this.toolbar && (t.removeLayer(this.toolbar), (this.toolbar = !1)); - }, - _enableDragging: function () { - var t = this, - e = this._overlay, - i = e._map; - (this.dragging = new L.Draggable(e.getElement())), - this.dragging.enable(), - this.dragging.on("dragstart", function () { - e.fire("dragstart"), t._removeToolbar(); - }), - (this.dragging._updatePosition = function () { - var t, - o, - n = e.getCorner(0), - a = this._newPos.subtract(i.latLngToLayerPoint(n)), - s = {}; - for (this.fire("predrag"), o = 0; o < 4; o++) - (t = i.latLngToLayerPoint(e.getCorner(o))), - (s[o] = i.layerPointToLatLng(t.add(a))); - e.setCorners(s), e.fire("drag"), this.fire("drag"); - }), - this.dragging.on("dragend", function () { - e.fire("dragend"); - }); - }, - _disableDragging: function () { - this.dragging && (this.dragging.disable(), delete this.dragging); - }, - _dragMode: function () { - this.setMode("drag"); - }, - _scaleMode: function () { - this.setMode("scale"); - }, - _distortMode: function () { - this.setMode("distort"); - }, - _rotateMode: function () { - this.setMode("rotate"); - }, - _freeRotateMode: function () { - this.setMode("freeRotate"); - }, - _toggleLockMode: function () { - this.isMode("lock") ? this._unlock() : this._lock(); - }, - _toggleOpacity: function () { - var t, - e = this._overlay.getElement(); - this.hasTool(L.OpacityAction) && - ((this._transparent = !this._transparent), - (t = this._transparent ? this.options.opacity : 1), - L.DomUtil.setOpacity(e, t), - e.setAttribute("opacity", t), - this._refresh()); - }, - _toggleBorder: function () { - var t, - e = this._overlay.getElement(); - this.hasTool(L.BorderAction) && - ((this._outlined = !this._outlined), - (t = this._outlined ? this.options.outline : "none"), - (e.style.outline = t), - this._refresh()); - }, - _toggleOrder: function () { - this._toggledImage ? this._stackUp() : this._stackDown(); - }, - _removeOverlay: function () { - var t = this._overlay, - e = this.parentGroup; - !this.isMode("lock") && - this.hasTool(L.DeleteAction) && - L.DomUtil.confirmDelete() && - (this._removeToolbar(), - e ? e.removeLayer(t) : t._map.removeLayer(t)); - }, - _getExport: function () { - var t = this._overlay, - e = t._map, - i = t.getElement(); - if (this.hasTool(L.ExportAction)) { - var o = new Image(); - (o.id = o.id || "tempId12345"), - document.body.appendChild(o), - (o.onload = function () { - var i = o.height, - n = o.width, - a = e.latLngToLayerPoint(t.getCorner(0)), - s = e.latLngToLayerPoint(t.getCorner(1)), - r = e.latLngToLayerPoint(t.getCorner(2)), - l = e.latLngToLayerPoint(t.getCorner(3)); - (o.onload = function () { - L.DomUtil.remove(o); - }), - window && - window.hasOwnProperty("warpWebGl") && - warpWebGl( - o.id, - [0, 0, n, 0, n, i, 0, i], - [a.x, a.y, s.x, s.y, l.x, l.y, r.x, r.y], - !0 - ); - }), - (o.src = t.options.fullResolutionSrc || i.src); + + resolve(); + + if (data.jpg !== null) { + alert('Export succeeded. ' + opts.exportUrl + data.jpg); } - }, - _stackUp: function () { - this._toggledImage && - this.hasTool(L.StackAction) && - ((this._toggledImage = !1), - this._overlay.bringToFront(), - this._refresh()); - }, - _stackDown: function () { - !this._toggledImage && - this.hasTool(L.StackAction) && - ((this._toggledImage = !0), - this._overlay.bringToBack(), - this._refresh()); - }, - _unlock: function () { - var t = this._overlay, - e = t._map, - i = this.parentGroup; - this.isMode("lock") && - (((!i || i.isCollected(t)) && i) || this.hasTool(L.LockAction)) && - (this.currentHandle && e.removeLayer(this.currentHandle), - "lock" !== t.options.mode && this.hasMode(t.options.mode) - ? (this._mode = t.options.mode) - : ((this._mode = ""), (this.currentHandle = "")), - this._updateHandle(), - this._enableDragging(), - this._refresh()); - }, - _lock: function () { - var t = this._overlay, - e = t._map, - i = this.parentGroup; - this.isMode("lock") || - ((((!i || i.isCollected(t)) && i) || - this.hasTool(L.LockAction)) && - (this.currentHandle && e.removeLayer(this.currentHandle), - (this._mode = "lock"), - this._updateHandle(), - this._disableDragging(), - this._refresh())); - }, - _deselect: function () { - this._overlay.deselect(); - }, - _showMarkers: function (t) { - var e = this.parentGroup; - this.currentHandle && - ((!this.isMode("lock") && e && e.anyCollected()) || - this.currentHandle.eachLayer(function (t) { - t.setOpacity(1), - t.dragging && t.dragging.enable(), - L.DomUtil.addClass(t.getElement(), "leaflet-interactive"); - })); - }, - _hideMarkers: function () { - var t = this._overlay, - e = this.parentGroup; - this._handles || this._initHandles(), - this.currentHandle && - ((this.isMode("lock") && e && e.isCollected(t)) || - this.currentHandle.eachLayer(function (t) { - t.setOpacity(0), - t.dragging && t.dragging.disable(), - L.DomUtil.removeClass( - t.getElement(), - "leaflet-interactive" - ); - })); - }, - _updateHandle: function () { - var t = this._overlay._map, - e = this.getMode(); - this.currentHandle && t.removeLayer(this.currentHandle), - (this.currentHandle = "" === e ? "" : this._handles[e]), - "" !== this.currentHandle && t.addLayer(this.currentHandle); - }, - _addToolbar: function () { - var t = this._overlay, - e = this.parentGroup, - i = t._map, - o = t.getCorners(), - n = -1 / 0; - if (e && e.anyCollected()) e.editing._addToolbar(); - else if (!t.options.suppressToolbar && !this.toolbar) { - for (var a = 0; a < o.length; a++) o[a].lat > n && (n = o[a].lat); - var s = t.getCenter(); - (s.lat = n), - (this.toolbar = L.distortableImage - .popupBar(s, { actions: this.editActions }) - .addTo(i, t)), - t.fire("toolbar:created"); - } - }, - _refresh: function () { - this.toolbar && this._removeToolbar(), this._addToolbar(); - }, - _updateToolbarPos: function () { - var t = this._overlay, - e = t.getCorners(), - i = this.toolbar, - o = -1 / 0; - if (i && i instanceof L.DistortableImage.PopupBar) { - for (var n = 0; n < e.length; n++) e[n].lat > o && (o = e[n].lat); - var a = t.getCenter(); - (a.lat = o), - t.options.suppressToolbar || this.toolbar.setLatLng(a); - } - }, - hasMode: function (t) { - return !!this._modes[t]; - }, - getMode: function () { - if (this.enabled()) return this._mode; - }, - getModes: function () { - return this._modes; - }, - isMode: function (t) { - return !!this.enabled() && this._mode === t; - }, - setMode: function (t) { - var e = this._overlay, - i = this.parentGroup; - if (this.getMode() !== t && this.hasMode(t) && this.enabled()) - return ( - this.toolbar && this.toolbar.clickTool(t), - this.isMode("lock") && !this.dragging && this._enableDragging(), - (this._mode = t), - this.isMode("lock") && this._disableDragging(), - this._updateHandle(), - this._refresh(), - i && i.isCollected(e) && e.deselect(), - this - ); - }, - nextMode: function (t) { - var e = this.getMode(), - i = this.parentGroup, - o = Object.keys(this.getModes()), - n = o.indexOf(e), - a = o[(n + 1) % o.length]; - if (t) { - if (i && i.anyCollected()) return; - L.DomEvent.stop(t); - } - return this.setMode(a); - }, - })), - (L.distortableImage.edit = function (t, e) { - return new L.DistortableImage.Edit(t, e); - }); - }, - 426: function () { - L.BorderAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n, - a = e.editing, - s = a._mode; - a._outlined - ? ((o = "border_outer"), (n = e.options.translation.removeBorder)) - : ((o = "border_clear"), (n = e.options.translation.addBorder)), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: o, - tooltip: n, - className: "lock" === s ? "disabled" : "", - }), - (L.DistortableImage.action_map.b = - "lock" === s ? "" : "_toggleBorder"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing; - L.IconUtil.toggleXlink(this._link, "border_clear", "border_outer"), - L.IconUtil.toggleTitle(this._link, "Remove Border", "Add Border"), - t._toggleBorder(); - }, - }); - }, - 114: function () { - L.DeleteAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n = e.editing; - n instanceof L.DistortableImage.Edit - ? ((o = e.options.translation.deleteImage), - (L.DistortableImage.action_map.Backspace = - "lock" === n._mode ? "" : "_removeOverlay")) - : ((o = e.options.translation.deleteImages), - (L.DistortableImage.group_action_map.Backspace = - "lock" === n._mode ? "" : "_removeGroup")), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "delete_forever", - tooltip: o, - className: "lock" === n._mode ? "disabled" : "", - }), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing; - t instanceof L.DistortableImage.Edit - ? t._removeOverlay() - : t._removeGroup(); - }, - }); - }, - 231: function () { - L.DistortAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "distort", - tooltip: e.options.translation.distortImage, - className: "distort", - }), - (L.DistortableImage.action_map.d = "_distortMode"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._distortMode(); - }, - }); - }, - 541: function () { - L.DragAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "drag", - tooltip: e.options.translation.dragImage, - className: "drag", - }), - (L.DistortableImage.action_map.D = "_dragMode"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._dragMode(); - }, - }); - }, - 280: function () { - (L.DistortableImage = L.DistortableImage || {}), - (L.distortableImage = L.DistortableImage), - (L.DistortableImage.action_map = {}), - (L.EditAction = L.Toolbar2.Action.extend({ - options: { - toolbarIcon: { svg: !1, html: "", className: "", tooltip: "" }, - }, - initialize: function (t, e, i) { - (this._overlay = e), - (this._map = t), - L.setOptions(this, i), - L.Toolbar2.Action.prototype.initialize.call(this, i), - this._injectIconSet(); - }, - _createIcon: function (t, e, i) { - var o = this, - n = this.options.toolbarIcon, - a = n.className, - s = this._overlay.editing; - (this.toolbar = t), - (this._icon = L.DomUtil.create("li", "", e)), - (this._link = L.DomUtil.create("a", "", this._icon)), - n.svg - ? (this._link.innerHTML = L.IconUtil.create(n.html)) - : (this._link.innerHTML = n.html), - this._link.setAttribute("href", "#"), - this._link.setAttribute("title", n.tooltip), - this._link.setAttribute("role", "button"), - L.DomUtil.addClass(this._link, this.constructor.baseClass), - a && - (L.DomUtil.addClass(this._link, a), - "disabled" === a && L.DomUtil.addClass(this._icon, a), - a === s._mode - ? L.DomUtil.addClass(this._link, "selected-mode") - : L.DomUtil.removeClass(this._link, "selected-mode")), - L.DomEvent.on(this._link, "click", this.enable, this), - L.DomEvent.on(this._overlay, "update", function () { - var t = o._link.innerHTML.match(/xlink:href="#restore"/); - t && 1 === t.length && o._enableAction(); - }), - this._addSubToolbar(t, this._icon, i); - }, - _injectIconSet: function () { - if (!document.querySelector("#iconset")) { - var t = document.createElement("div"); - (t.id = "iconset"), - t.setAttribute("hidden", "hidden"), - (t.innerHTML = new L.ToolbarIconSet().render()), - document.querySelector(".leaflet-marker-pane").appendChild(t); + } // TODO: update to clearInterval when status == "failed" if we update that in this file: + // https://github.com/publiclab/mapknitter-exporter/blob/main/lib/mapknitterExporter.rb + + + console.log(data); + } + }; // receives the URL of status.json, and starts running the updater to repeatedly fetch from status.json; + // this may be overridden to integrate with any UI + + + var _defaultHandleStatusRes = function _defaultHandleStatusRes(data) { + statusUrl = opts.statusUrl + data; // repeatedly fetch the status.json + + _this6.updateInterval = setInterval(function () { + var reqOpts = { + method: 'GET' + }; + var req = new Request("".concat(statusUrl, "?").concat(Date.now()), reqOpts); + fetch(req).then(function (res) { + if (res.ok) { + return res.text(); } - }, - _enableAction: function () { - L.DomUtil.removeClass(this._link.parentElement, "disabled"), - L.DomUtil.removeClass(this._link, "disabled"); - }, - _disableAction: function () { - L.DomUtil.addClass(this._link.parentElement, "disabled"), - L.DomUtil.addClass(this._link, "disabled"); - }, - })), - (L.editAction = function (t, e, i) { - return new L.EditAction(t, e, i); - }); - }, - 149: function () { - L.ExportAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n = e.editing; - (this.isExporting = !1), - (this.mouseLeaveSkip = !0), - (this.isHooksExecuted = !1), - n instanceof L.DistortableImage.Edit - ? ((L.DistortableImage.action_map.e = "_getExport"), - (o = e.options.translation.exportImage)) - : ((L.DistortableImage.group_action_map.e = "runExporter"), - (o = e.options.translation.exportImages)), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "get_app", - tooltip: o, - }), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing; - if (t instanceof L.DistortableImage.Edit) t._getExport(); - else if (!this.isHooksExecuted) { - this.isHooksExecuted = !0; - var e = this._link.parentElement; - (this.mouseEnterHandler = this.handleMouseEnter.bind(this)), - (this.mouseLeaveHandler = this.handleMouseLeave.bind(this)), - L.DomEvent.on( - e, - "click", - function () { - if (this.isExporting) { - if (this.mouseLeaveSkip) return; - this.resetState(), - this.detachMouseEventListeners(e), - t.cancelExport(); - } else - (this.isExporting = !0), - this.renderExportIcon(), - setTimeout( - this.attachMouseEventListeners.bind(this, e), - 100 - ), - t.runExporter().then( - function () { - this.resetState(), this.detachMouseEventListeners(e); - }.bind(this) - ); - }, - this - ); + }).then(opts.updater); + }, opts.frequency); + }; // initiate the export + + + var _defaultFetchStatusUrl = function _defaultFetchStatusUrl(mergedOpts) { + var form = new FormData(); + form.append('collection', JSON.stringify(mergedOpts.collection)); + form.append('scale', mergedOpts.scale); + form.append('upload', true); + var reqOpts = { + method: 'POST', + body: form + }; + var req = new Request(mergedOpts.exportStartUrl, reqOpts); + fetch(req).then(function (res) { + if (res.ok) { + return res.text(); } - }, - resetState: function () { - this.renderDownloadIcon(), - (this.isExporting = !1), - (this.mouseLeaveSkip = !0); - }, - attachMouseEventListeners: function (t) { - t.addEventListener("mouseenter", this.mouseEnterHandler), - t.addEventListener("mouseleave", this.mouseLeaveHandler); - }, - detachMouseEventListeners: function (t) { - t.removeEventListener("mouseenter", this.mouseEnterHandler), - t.removeEventListener("mouseleave", this.mouseLeaveHandler); - }, - handleMouseEnter: function () { - this.renderCancelIcon(); - }, - handleMouseLeave: function () { - this.mouseLeaveSkip - ? (this.mouseLeaveSkip = !1) - : this.renderExportIcon(); - }, - renderDownloadIcon: function () { - L.IconUtil.toggleXlink(this._link, "get_app", "spinner"), - L.IconUtil.toggleTitle(this._link, "Export Images", "Loading..."), - L.DomUtil.removeClass(this._link.firstChild, "loader"); - }, - renderExportIcon: function () { - L.IconUtil.toggleXlink(this._link, "spinner"), - L.IconUtil.toggleTitle(this._link, "Export Images", "Loading..."), - L.IconUtil.addClassToSvg(this._link, "loader"); - }, - renderCancelIcon: function () { - L.IconUtil.toggleXlink(this._link, "cancel"), - L.IconUtil.toggleTitle(this._link, "Cancel Export", "Loading..."), - L.DomUtil.removeClass(this._link.firstChild, "loader"); - }, - }); - }, - 74: function () { - L.FreeRotateAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "crop_rotate", - tooltip: e.options.translation.freeRotateImage, - className: "freeRotate", - }), - (L.DistortableImage.action_map.f = "_freeRotateMode"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._freeRotateMode(); - }, - }); - }, - 691: function () { - L.GeolocateAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o = e.editing; - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "explore", - tooltip: e.options.translation.geolocateImage, - className: "lock" === o._mode ? "disabled" : "", - }), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.getElement(); - EXIF.getData(t, L.EXIF(t)); - }, - }); - }, - 105: function () { - L.LockAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n, - a = e.editing; - a instanceof L.DistortableImage.Edit - ? ((L.DistortableImage.action_map.u = "_unlock"), - (L.DistortableImage.action_map.l = "_lock"), - (n = e.options.translation.lockMode), - (o = a.isMode("lock") ? "lock" : "unlock")) - : ((L.DistortableImage.group_action_map.l = "_lockGroup"), - (n = e.options.translation.lockImages), - (o = "lock")), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: o, - tooltip: n, - className: "lock", - }), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing; - t instanceof L.DistortableImage.Edit - ? t._toggleLockMode() - : t._lockGroup(); - }, - }); - }, - 944: function () { - L.OpacityAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n, - a = e.editing, - s = a._mode; - a._transparent - ? ((o = "opacity_empty"), - (n = e.options.translation.makeImageOpaque)) - : ((o = "opacity"), - (n = e.options.translation.makeImageTransparent)), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: o, - tooltip: n, - className: "lock" === s ? "disabled" : "", - }), - (L.DistortableImage.action_map.o = - "lock" === s ? "" : "_toggleOpacity"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing, - e = this._link; - L.IconUtil.toggleXlink(e, "opacity", "opacity_empty"), - L.IconUtil.toggleTitle( - e, - "Make Image Transparent", - "Make Image Opaque" - ), - t._toggleOpacity(); - }, - }); - }, - 954: function () { - L.RestoreAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o = L.Utils.getNestedVal(e, "editing", "_mode"), - n = e.edited; - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "restore", - tooltip: e.options.translation.restoreImage, - className: n && "lock" !== o ? "" : "disabled", - }), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay; - L.DomEvent.on( - t, - { edit: this._enableAction, restore: this._disableAction }, - this - ), - t.restore(); - }, - }); - }, - 178: function () { - L.RotateAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "rotate", - tooltip: e.options.translation.rotateImage, - className: "rotate", - }), - (L.DistortableImage.action_map.r = "_rotateMode"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._rotateMode(); - }, - }); - }, - 547: function () { - L.ScaleAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "scale", - tooltip: e.options.translation.scaleImage, - className: "scale", - }), - (L.DistortableImage.action_map.s = "_scaleMode"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._scaleMode(); - }, - }); - }, - 886: function () { - L.StackAction = L.EditAction.extend({ - initialize: function (t, e, i) { - var o, - n, - a = e.editing; - a._toggledImage - ? ((o = "flip_to_back"), (n = e.options.translation.stackToFront)) - : ((o = "flip_to_front"), (n = e.options.translation.stackToBack)), - ((i = i || {}).toolbarIcon = { - svg: !0, - html: o, - tooltip: n, - className: "lock" === a._mode ? "disabled" : "", - }), - (L.DistortableImage.action_map.q = - "lock" === a._mode ? "" : "_stackUp"), - (L.DistortableImage.action_map.a = - "lock" === a._mode ? "" : "_stackDown"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - var t = this._overlay.editing; - L.IconUtil.toggleXlink(this._link, "flip_to_front", "flip_to_back"), - L.IconUtil.toggleTitle( - this._link, - "Stack to Front", - "Stack to Back" - ), - t._toggleOrder(); - }, - }); - }, - 129: function () { - L.UnlockAction = L.EditAction.extend({ - initialize: function (t, e, i) { - ((i = i || {}).toolbarIcon = { - svg: !0, - html: "unlock", - tooltip: e.options.translation.unlockImages, - }), - (L.DistortableImage.group_action_map.u = "_unlockGroup"), - L.EditAction.prototype.initialize.call(this, t, e, i); - }, - addHooks: function () { - this._overlay.editing._unlockGroup(); - }, - }); - }, - 743: function () { - L.EXIF = function (t) { - if (0 !== Object.keys(EXIF.getAllTags(t)).length) { - console.log(EXIF.getAllTags(t)); - var e = EXIF.getAllTags(t); - void 0 !== e.GPSLatitude && - void 0 !== e.GPSLongitude && - (e.GPSLatitude[0], - e.GPSLatitude[1], - e.GPSLatitude[2], - e.GPSLongitude[0], - e.GPSLongitude[1], - e.GPSLongitude[2], - e.GPSLatitudeRef, - e.GPSLongitudeRef), - "T" === e.GPSImgDirectionRef || "M" === e.GPSImgDirectionRef - ? (Math.PI, - e.GPSImgDirection.numerator, - e.GPSImgDirection.denominator) - : console.log("No compass data found"), - console.log("Orientation:", e.Orientation), - (6 === e.Orientation || - 8 === e.Orientation || - 3 === e.Orientation) && - Math.PI, - void 0 !== e.GPSAltitude && - void 0 !== e.GPSAltitudeRef && - void 0 !== e.GPSAltitude && - void 0 !== e.GPSAltitudeRef && - (e.GPSAltitude.numerator, - e.GPSAltitude.denominator, - e.GPSAltitudeRef); - } else alert("EXIF initialized. Press again to view data in console."); - }; - }, - 92: function () { - (L.DistortHandle = L.EditHandle.extend({ - options: { - TYPE: "distort", - icon: L.icon({ - iconUrl: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAChSURBVO3BIU4DURgGwNkvL2B6AkQTLBqP4QCoSm7DDXoBLBZHDbfgICAIZjEV3YTn9uVHdMZZtcnCfI13bIzxg0emg6Nm6QVbYz3jylEsXRrvwommb49X67jFkz80fR9Mb1YxTzqiWBSLYlEsikWxKBbFolgUi2JRLIpFsSgWxaJY03fHHOu40dH07bAzWCx9Ge/TiWbpHgdsjPGNB2f/yS+7xRCyiiZPJQAAAABJRU5ErkJggg==", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - _onHandleDrag: function () { - this._handled.setCorner(this._corner, this.getLatLng()); - }, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - })), - (L.distortHandle = function (t, e, i) { - return new L.DistortHandle(t, e, i); - }); - }, - 194: function () { - (L.DragHandle = L.EditHandle.extend({ - options: { - TYPE: "drag", - icon: L.icon({ - iconUrl: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsVJREFUeNrMVztLXEEUvnNVFAVBAhY2aRKbTZEHJNpYabuNjSgYg/GxdsmPSJkUAa/ZdVEX8mgWYVutbHxAHkVskjQBuUUgBISVhCQk3wnfwMlk1rusN1wHPubOzJlzvjlz5sxc01Ma/hUEwQnwDIjqc7uvgv9YYO86qgIwCXQbdNTlQ8kcCBHgBch8TcloF6oJGr6phk6EQAkfdz3zvgDr9Mr7Fg1fptEZoM8jsmrokpfsiIFO4IIjuE2v1EDmR4LRdlR5Gh51hj8D34ABtm8YTtqna0TgklIw5CgQguKxIojEjmFROg/MKQO27NkFAB+4wAPouGUJiIvWKHwbAxX2XyWRKWkqhT+pbJntJZJuUzISW0+5hW+obxrVBsfvoH/dqCCJuU97GBh2VteLSiYvArmErT8EVoAK9Bw7enbpVYmvAQlyowYforrH5jXL2rPHI/TKONDB7u9AlavdaTBPvPmazUeQuy8f7UomUgTEwIJPEQ3sQGE/6ll2l9H/KcEzBcfWn2IclluM3DpddJxSHujlFkscbUPvmB0LHVnLrId7nlaZVkEc6QGXQI1MAwZcWmVRHeNaQwJMMiU2cwy4s7p/RJ2ckpvIQs+cIs+5GzitloLKHUV3MPREuXbTOKO91dX387gGTONxIgEWm+E61FFrpcyqXLHsEwiDjEsjAksqw5XPoL9MHVrn6QR4q+XZrDaR4RoWzq2ymafuRA/Mq1stSsHLVkcbdf9VjOcx8ZH3+SFWcCWlVPyWuUBOwUWdC1wP5NVjYiXFWLO69PZ6CRTUY6KSIoEKdf6T3IzzgHxnsyHctNBEkmn6Oob8ExUDg/ahGybd177cDjzH5xHwgDiSvoS7I/LZyvxJZj0wod7tkX5G0XVC7rEyLhfLJjBGbKoLLEfZWObyKeZ6oY82g+yf5Zn/mJyHX7PMf04z/T3/LcAAu4E6iiyJqf0AAAAASUVORK5CYII=", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - _onHandleDrag: function () { - var t = this._handled, - e = t.getCorner(this._corner), - i = this.getLatLng(); - t.dragBy(e, i); - }, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - })), - (L.dragHandle = function (t, e, i) { - return new L.DragHandle(t, e, i); - }); - }, - 988: function () { - L.EditHandle = L.Marker.extend({ - initialize: function (t, e, i) { - var o = t.getCorner(e); - L.setOptions(this, i), (this._handled = t), (this._corner = e); - var n = { draggable: !0, zIndexOffset: 10 }; - i && i.hasOwnProperty("draggable") && (n.draggable = i.draggable), - L.Marker.prototype.initialize.call(this, o, n); - }, - onAdd: function (t) { - L.Marker.prototype.onAdd.call(this, t), - this._bindListeners(), - this.updateHandle(); - }, - onRemove: function (t) { - this._unbindListeners(), L.Marker.prototype.onRemove.call(this, t); - }, - _onHandleDragStart: function () { - this._handled.fire("editstart"); - }, - _onHandleDragEnd: function () { - this._fireEdit(); - }, - _fireEdit: function () { - (this._handled.edited = !0), this._handled.fire("edit"); - }, - _bindListeners: function () { - this.on( - { - contextmenu: L.DomEvent.stop, - dragstart: this._onHandleDragStart, - drag: this._onHandleDrag, - dragend: this._onHandleDragEnd, - }, - this - ), - this._handled._map.on("zoomend", this.updateHandle, this), - this._handled.on("update", this.updateHandle, this); - }, - _unbindListeners: function () { - this.off( - { - contextmenu: L.DomEvent.stop, - dragstart: this._onHandleDragStart, - drag: this._onHandleDrag, - dragend: this._onHandleDragEnd, - }, - this - ), - this._handled._map.off("zoomend", this.updateHandle, this), - this._handled.off("update", this.updateHandle, this); - }, - _calculateScalingFactor: function (t, e) { - var i = this._handled, - o = i._map, - n = o.latLngToLayerPoint(i.getCenter()), - a = o.latLngToLayerPoint(t), - s = o.latLngToLayerPoint(e), - r = this._d2(n, a), - l = this._d2(n, s); - return Math.sqrt(l / r); - }, - _d2: function (t, e) { - var i = t.x - e.x, - o = t.y - e.y; - return Math.pow(i, 2) + Math.pow(o, 2); - }, - calculateAngleDelta: function (t, e) { - var i = this._handled, - o = i._map, - n = o.latLngToLayerPoint(i.getCenter()), - a = o.latLngToLayerPoint(t), - s = o.latLngToLayerPoint(e), - r = Math.atan2(n.y - a.y, n.x - a.x); - return Math.atan2(n.y - s.y, n.x - s.x) - r; - }, + }).then(mergedOpts.handleStatusRes); + }; // If the user has passed collection property + + + _this6.customCollection = !!opts.collection; + + if (!_this6.customCollection) { + opts.collection = _this6._group.generateExportJson().images; + } + + opts.frequency = opts.frequency || 3000; + opts.scale = opts.scale || 100; // switch it to _getAvgCmPerPixel ! + + opts.updater = opts.updater || _defaultUpdater; + opts.handleStatusRes = opts.handleStatusRes || _defaultHandleStatusRes; + opts.fetchStatusUrl = opts.fetchStatusUrl || _defaultFetchStatusUrl; + opts.fetchStatusUrl(opts); + }); + } +}); + +L.distortableCollection.edit = function (group, options) { + return new L.DistortableCollection.Edit(group, options); +}; + +/***/ }), + +/***/ "./src/edit/DistortableImage.Edit.js": +/*!*******************************************!*\ + !*** ./src/edit/DistortableImage.Edit.js ***! + \*******************************************/ +/***/ (function() { + +L.DistortableImage = L.DistortableImage || {}; // holds the keybindings & toolbar API for an individual image instance + +L.DistortableImage.Edit = L.Handler.extend({ + options: { + opacity: 0.7, + outline: '1px solid red', + keymap: L.distortableImage.action_map + }, + initialize: function initialize(overlay, options) { + this._overlay = overlay; + this._toggledImage = false; + this._mode = overlay.options.mode; + this._transparent = false; + this._outlined = false; + L.setOptions(this, options); + L.distortableImage.action_map.Escape = '_deselect'; + }, + + /* Run on image selection. */ + addHooks: function addHooks() { + var overlay = this._overlay; + this.editActions = this.options.actions; + /* bring the selected image into view */ + + overlay.bringToFront(); + + this._initModes(); + + this._initHandles(); + + this._appendHandlesandDragable(); + + if (overlay.isSelected() && !overlay.options.suppressToolbar) { + this._addToolbar(); + } + + this.parentGroup = overlay.eP ? overlay.eP : false; + L.DomEvent.on(overlay.getElement(), { + dblclick: this.nextMode + }, this); + L.DomEvent.on(window, 'keydown', this._onKeyDown, this); + }, + + /* Run on image deselection. */ + removeHooks: function removeHooks() { + var overlay = this._overlay; + var eP = this.parentGroup; // First, check if dragging exists - it may be off due to locking + + this._disableDragging(); + + if (this.toolbar) { + this._removeToolbar(); + } + + for (var handle in this._handles) { + L.DomUtil.remove(handle); + } + /** + * ensures if you disable an image while it is multi-selected + * additional deselection logic is run + */ + + + if (L.DomUtil.hasClass(overlay.getElement(), 'collected')) { + L.DomUtil.removeClass(overlay.getElement(), 'collected'); + } + + if (eP && !eP.anyCollected() && eP.editing.toolbar) { + eP.editing._removeToolbar(); + } + + L.DomEvent.off(overlay.getElement(), { + dblclick: this.nextMode + }, this); + L.DomEvent.off(window, 'keydown', this._onKeyDown, this); + }, + disable: function disable() { + if (!this._enabled) { + return this; + } + + this._overlay.deselect(); + + this._enabled = false; + this.removeHooks(); + return this; + }, + _initModes: function _initModes() { + this._modes = {}; // passed from L.DistortablImage.PopupBar. If the mode is one + // of the current toolbar actions, adds it to this._modes + + for (var mode in L.DistortableImage.Edit.MODES) { + var action = L.DistortableImage.Edit.MODES[mode]; + + if (this.editActions.indexOf(action) !== -1) { + this._modes[mode] = action; + } + } // sets the current mode to the 1st available one if the one selected + // during initialization is not available + + + if (!this._modes[this._mode]) { + this._mode = Object.keys(this._modes)[0]; + } + }, + _initHandles: function _initHandles() { + var overlay = this._overlay; + var i; + this._dragHandles = L.layerGroup(); + + for (i = 0; i < 4; i++) { + this._dragHandles.addLayer(L.dragHandle(overlay, i)); + } + + this._scaleHandles = L.layerGroup(); + + for (i = 0; i < 4; i++) { + this._scaleHandles.addLayer(L.scaleHandle(overlay, i)); + } + + this._distortHandles = L.layerGroup(); + + for (i = 0; i < 4; i++) { + this._distortHandles.addLayer(L.distortHandle(overlay, i)); + } + + this._rotateHandles = L.layerGroup(); // individual rotate + + for (i = 0; i < 4; i++) { + this._rotateHandles.addLayer(L.rotateHandle(overlay, i)); + } // handle includes rotate AND scale + + + this._freeRotateHandles = L.layerGroup(); + + for (i = 0; i < 4; i++) { + this._freeRotateHandles.addLayer(L.freeRotateHandle(overlay, i)); + } + + this._lockHandles = L.layerGroup(); + + for (i = 0; i < 4; i++) { + this._lockHandles.addLayer(L.lockHandle(overlay, i, { + draggable: false + })); + } + + this._handles = { + drag: this._dragHandles, + scale: this._scaleHandles, + distort: this._distortHandles, + rotate: this._rotateHandles, + freeRotate: this._freeRotateHandles, + lock: this._lockHandles + }; + }, + _appendHandlesandDragable: function _appendHandlesandDragable() { + var ov = this._overlay; // won't throw error if user adds 0 mode actions to toolbar + + if (!this._mode) { + this._enableDragging(); + + return; + } + + this._updateHandle(); + + if (!ov.isSelected() && this.currentHandle) { + this.currentHandle.eachLayer(function (handle) { + handle.setOpacity(0); + + if (handle.dragging) { + handle.dragging.disable(); + } }); - }, - 206: function () { - (L.FreeRotateHandle = L.EditHandle.extend({ - options: { - TYPE: "freeRotate", - icon: L.icon({ - iconUrl: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAHiSURBVMXBa3HbShgA0PMp/1sCCo8oCEpgTaCXgIXAJiDzyCJoAUTm4UVQAns1Y8+snWnTvJyeE16hkjDgDrfoNTMKcpC9UPiLSo8JyetkjEHxjPCMyoS199kFoz8Iv1HpMaN3qWDCHoegOKkkRwnJpRmroHgiPFEZ8IBekzEGxQtUEhKSS/fB7Ew4U+lxcGkVZG9QWWPSFAxBcdK59KApuA+yNwp2uEdx1GN25sZJZULSfAtm77SlbNjju6MvG75u+WHRWVR6rDVjMPsgwYyVZl3pLTpHkyYHOx8syMiayaJzlDTZ9YyaZNFVkiYH2ZUEBcVJJXVImuz6Js3Qofe59pq7DoOTILu+g+a288mCouk7/1iH4qTS+2QdDppbV1ZJmrnDXnPnc5UOs2Z0fUmTuyBr+krvSioJyUmQO0dZM7mepMkWnaNRkyrJB6uskTSjxY3Fll8bvmJwlDb83FJ8gMqAB80uyBY3Trb82PAfvjj6vuHnluIdKgMeNXOwctK5NKBoHitrb1RJeHRp5Ux4ojLg0aWMHGQvUOkxIWkKVsHsTPiNSo8HDC5lZIsgO6n0uMUdRvQuFQxB8UR4RmXC2vvsgtEfhL+o9JiQvE7GGBTPCK9QSUjoMWgKDthjDrIX+h/k0I7gth6N5gAAAABJRU5ErkJggg==", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - _onHandleDrag: function () { - var t = this._handled, - e = t._map, - i = t.getCorner(this._corner), - o = this.getLatLng(), - n = this.calculateAngleDelta(i, o), - a = this._calculateScalingFactor(i, o); - 0 !== n && t.rotateBy(n, "rad"); - var s = t.edgeMinWidth; - s || (s = 50); - var r = e.latLngToContainerPoint(t.getCorner(0)), - l = e.latLngToContainerPoint(t.getCorner(1)), - c = Math.abs(r.x - l.x), - d = Math.abs(r.y - l.y); - Math.sqrt(c * c + d * d) > s || a > 1 ? t.scaleBy(a) : t.scaleBy(1); - }, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - })), - (L.freeRotateHandle = function (t, e, i) { - return new L.FreeRotateHandle(t, e, i); - }); - }, - 789: function () { - (L.LockHandle = L.EditHandle.extend({ - options: { - TYPE: "lock", - interactive: !1, - icon: L.icon({ - iconUrl: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAD8SURBVO3BPU7CYAAA0AdfjIcQlRCQBG7C3gk2uIPG2RC3Dk16Gz0FTO1WZs/gwGCMP/2+xsSl7+n1er1Iz9LtRQjaPeMeO+TinLDCJV78YqjdA04YodKuxhUaPGoRxMmxwRQZSt87Yo4KExGCeAUyLLFB4bMacxywEClIU2KDKXbInTUYo8JCgoFuGoxQO5uiwY1EA91VmDqrcKeDoX8WdNNgjApvmGGLXKIgXY0xGkxQYItrrFFIEKQ5Yo4KEx9yrDFDhlKkIF6NOQ5Y+KpAhiXWKEQI4pxwiwoLPyuxwQw75FoE7fZYocFEuwI7jHCBV39gL92TXq/Xi/AOcmczZmaIMScAAAAASUVORK5CYII=", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - onRemove: function (t) { - this.unbindTooltip(), L.EditHandle.prototype.onRemove.call(this, t); - }, - _bindListeners: function () { - var t = this.getElement(); - L.EditHandle.prototype._bindListeners.call(this), - L.DomEvent.on( - t, - { mousedown: this._tooltipOn, mouseup: this._tooltipOff }, - this - ), - L.DomEvent.on(document, "pointerleave", this._tooltipOff, this); - }, - _unbindListeners: function () { - var t = this.getElement(); - L.EditHandle.prototype._bindListeners.call(this), - L.DomEvent.off( - t, - { mousedown: this._tooltipOn, mouseup: this._tooltipOff }, - this - ), - L.DomEvent.off(document, "pointerleave", this._tooltipOff, this); - }, - _onHandleDrag: function () {}, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - _tooltipOn: function (t) { - var e = this._handled.parentGroup, - i = e ? e.editing : this._handled.editing; - if ( - !t.shiftKey && - (this._handled.isSelected() || !e || e.isCollected(this._handled)) - ) { - var o = i._lockHandles; - this._timer = setTimeout( - L.bind(function () { - this._timeout && clearTimeout(this._timeout), - this.getTooltip() - ? o.eachLayer(function (t) { - this !== t && t.closeTooltip(); - }) - : this.bindTooltip("Locked!", { permanent: !0 }), - this.openTooltip(); - }, this), - 500 - ); + } + + if (!this.isMode('lock')) { + this._enableDragging(); + } + }, + _onKeyDown: function _onKeyDown(e) { + var keymap = this.options.keymap; + var handlerName = keymap[e.key]; + var ov = this._overlay; + var eP = this.parentGroup; + + if (eP && eP.anyCollected()) { + return; + } + + if (this[handlerName] !== undefined && !ov.options.suppressToolbar) { + if (ov.isSelected() && this.toolbar) { + this[handlerName].call(this); + } + } + }, + replaceTool: function replaceTool(old, next) { + var _this = this; + + if (next.baseClass !== 'leaflet-toolbar-icon' || this.hasTool(next)) { + return this; + } + + this.editActions.some(function (item, idx) { + if (item === old) { + _this._removeToolbar(); + + _this.editActions[idx] = next; + + _this._addToolbar(); + + for (var mode in L.DistortableImage.Edit.MODES) { + if (L.DistortableImage.Edit.MODES[mode] === old) { + delete _this._modes[mode]; + + _this._nextOrNone(mode); + } else if (L.DistortableImage.Edit.MODES[mode] === next) { + _this._modes[mode] = next; } - }, - _tooltipOff: function (t) { - var e = this._handled.parentGroup, - i = e ? e.editing : this._handled.editing; - if ( - !t.shiftKey && - (this._handled.isSelected() || !e || e.isCollected(this._handled)) - ) { - var o = i._lockHandles; - t.currentTarget === document && - o.eachLayer(function (t) { - t.closeTooltip(); - }), - this._timer && clearTimeout(this._timer), - (this._timeout = setTimeout( - L.bind(function () { - this.closeTooltip(); - }, this), - 400 - )); + } + + return true; + } + }); + return this; + }, + addTool: function addTool(value) { + if (value.baseClass === 'leaflet-toolbar-icon' && !this.hasTool(value)) { + this._removeToolbar(); + + this.editActions.push(value); + + this._addToolbar(); + + for (var mode in L.DistortableImage.Edit.MODES) { + if (L.DistortableImage.Edit.MODES[mode] === value) { + this._modes[mode] = value; + } + } + + if (!this._overlay.isSelected()) { + this._removeToolbar(); + } + } + + return this; + }, + hasTool: function hasTool(value) { + return this.editActions.some(function (action) { + return action === value; + }); + }, + removeTool: function removeTool(value) { + var _this2 = this; + + this.editActions.some(function (item, idx) { + if (item === value) { + _this2._removeToolbar(); + + _this2.editActions.splice(idx, 1); + + _this2._addToolbar(); + + for (var mode in L.DistortableImage.Edit.MODES) { + if (L.DistortableImage.Edit.MODES[mode] === value) { + delete _this2._modes[mode]; + + _this2._nextOrNone(mode); } - }, - })), - (L.lockHandle = function (t, e, i) { - return new L.LockHandle(t, e, i); - }); - }, - 337: function () { - (L.RotateHandle = L.EditHandle.extend({ - options: { - TYPE: "rotate", - icon: L.icon({ - iconUrl: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAHiSURBVMXBa3HbShgA0PMp/1sCCo8oCEpgTaCXgIXAJiDzyCJoAUTm4UVQAns1Y8+snWnTvJyeE16hkjDgDrfoNTMKcpC9UPiLSo8JyetkjEHxjPCMyoS199kFoz8Iv1HpMaN3qWDCHoegOKkkRwnJpRmroHgiPFEZ8IBekzEGxQtUEhKSS/fB7Ew4U+lxcGkVZG9QWWPSFAxBcdK59KApuA+yNwp2uEdx1GN25sZJZULSfAtm77SlbNjju6MvG75u+WHRWVR6rDVjMPsgwYyVZl3pLTpHkyYHOx8syMiayaJzlDTZ9YyaZNFVkiYH2ZUEBcVJJXVImuz6Js3Qofe59pq7DoOTILu+g+a288mCouk7/1iH4qTS+2QdDppbV1ZJmrnDXnPnc5UOs2Z0fUmTuyBr+krvSioJyUmQO0dZM7mepMkWnaNRkyrJB6uskTSjxY3Fll8bvmJwlDb83FJ8gMqAB80uyBY3Trb82PAfvjj6vuHnluIdKgMeNXOwctK5NKBoHitrb1RJeHRp5Ux4ojLg0aWMHGQvUOkxIWkKVsHsTPiNSo8HDC5lZIsgO6n0uMUdRvQuFQxB8UR4RmXC2vvsgtEfhL+o9JiQvE7GGBTPCK9QSUjoMWgKDthjDrIX+h/k0I7gth6N5gAAAABJRU5ErkJggg==", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - _onHandleDrag: function () { - var t = this._handled, - e = t.getCorner(this._corner), - i = this.getLatLng(), - o = this.calculateAngleDelta(e, i); - t.rotateBy(o, "rad"); - }, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - })), - (L.rotateHandle = function (t, e, i) { - return new L.RotateHandle(t, e, i); - }); - }, - 350: function () { - (L.ScaleHandle = L.EditHandle.extend({ - options: { - TYPE: "scale", - icon: L.icon({ - iconUrl: - "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0NTkiIGhlaWdodD0iNDY0IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iIj48cmVjdCBpZD0iYmFja2dyb3VuZHJlY3QiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHg9IjAiIHk9IjAiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgY2xhc3M9IiIgc3R5bGU9IiIvPjxnIGNsYXNzPSJjdXJyZW50TGF5ZXIiIHN0eWxlPSIiPjx0aXRsZT5MYXllciAxPC90aXRsZT48cGF0aCBkPSJNNDU5LjA0OTE1OTUzMDQ3MTM0LDg2LjkyNjIzNDUxMjU1MDAyIFYwIGgtODUuNzE0NTczMzU2MzEyMDkgdjI3LjA0MzcxNzQwMzkwNDQ1MiBIODUuNzE0NTczMzU2MzEyMDMgVjAgSDAgdjg2LjkyNjIzNDUxMjU1MDAyIGgyNS43MTQzNzIwMDY4OTM2MjYgdjI4OS43NTQxMTUwNDE4MzM0IEgwIHY4Ni45MjYyMzQ1MTI1NTAwMiBoODUuNzE0NTczMzU2MzEyMDkgdi0yNy4wNDM3MTc0MDM5MDQ0NTIgaDI4NS43MTUyNDQ1MjEwNDAzIHYyNy4wNDM3MTc0MDM5MDQ0NTIgaDg1LjcxNDU3MzM1NjMxMjA5IHYtODYuOTI2MjM0NTEyNTUwMDIgaC0yMy44MDk2MDM3MTAwODY2OSBWODYuOTI2MjM0NTEyNTUwMDIgSDQ1OS4wNDkxNTk1MzA0NzEzNCB6TTM4NC43NjMxOTU5NTUwMDA5LDEyLjU1NjAxMTY1MTgxMjc4MSBoNjEuOTA0OTY5NjQ2MjI1Mzk2IHY2Mi43ODAwNTgyNTkwNjM5MSBoLTYxLjkwNDk2OTY0NjIyNTM5NiBWMTIuNTU2MDExNjUxODEyNzgxIHpNMTIuMzgwOTkzOTI5MjQ1MDUsMTIuNTU2MDExNjUxODEyNzgxIGg2MS45MDQ5Njk2NDYyMjUzOTYgdjYyLjc4MDA1ODI1OTA2MzkxIEgxMi4zODA5OTM5MjkyNDUwNSBWMTIuNTU2MDExNjUxODEyNzgxIHpNNzQuMjg1OTYzNTc1NDcwNTMsNDUxLjA1MDU3MjQxNTEyMDY2IEgxMi4zODA5OTM5MjkyNDUwNSB2LTYyLjc4MDA1ODI1OTA2MzkxIGg2MS45MDQ5Njk2NDYyMjUzOTYgVjQ1MS4wNTA1NzI0MTUxMjA2NiB6TTQ0NS43MTU3ODE0NTI4MjI3NCw0NTEuMDUwNTcyNDE1MTIwNjYgaC02Mi44NTczNTM3OTQ2Mjg4NjQgdi02Mi43ODAwNTgyNTkwNjM5MSBoNjIuODU3MzUzNzk0NjI4ODY0IFY0NTEuMDUwNTcyNDE1MTIwNjYgek00MDcuNjIwNDE1NTE2Njg0MjYsMzc2LjY4MDM0OTU1NDM4MzQ0IGgtMzYuMTkwNTk3NjM5MzMxNzcgdjMyLjgzODc5OTcwNDc0MTEyIEg4NS43MTQ1NzMzNTYzMTIwMyB2LTMyLjgzODc5OTcwNDc0MTEyIEg0OS41MjM5NzU3MTY5ODAzMiBWODYuOTI2MjM0NTEyNTUwMDIgaDM2LjE5MDU5NzYzOTMzMTc3IFY1MC4yMjQwNDY2MDcyNTExMjUgaDI4Ny42MjAwMTI4MTc4NDcyIHYzNi43MDIxODc5MDUyOTg5IGgzNC4yODU4MjkzNDI1MjQ4MzUgVjM3Ni42ODAzNDk1NTQzODM0NCB6IiBpZD0ic3ZnXzIiIGNsYXNzPSIiIGZpbGw9IiMxYTFhZWIiIGZpbGwtb3BhY2l0eT0iMSIvPjwvZz48L3N2Zz4=", - iconSize: [32, 32], - iconAnchor: [16, 16], - }), - }, - _onHandleDrag: function () { - var t = this._handled, - e = t._map, - i = t.edgeMinWidth, - o = t.getCorner(this._corner), - n = this.getLatLng(), - a = this._calculateScalingFactor(o, n); - i || (i = 50); - var s = e.latLngToLayerPoint(t.getCorner(0)), - r = e.latLngToLayerPoint(t.getCorner(1)), - l = Math.abs(s.x - r.x), - c = Math.abs(s.y - r.y); - Math.sqrt(l * l + c * c) > i || a > 1 ? t.scaleBy(a) : t.scaleBy(1); - }, - updateHandle: function () { - this.setLatLng(this._handled.getCorner(this._corner)); - }, - })), - (L.scaleHandle = function (t, e, i) { - return new L.ScaleHandle(t, e, i); - }); - }, - 719: function () { - (L.distortableImage = L.DistortableImage || {}), - (L.distortableImage = L.DistortableImage), - (L.DistortableImage.group_action_map = {}), - (L.DistortableImage.ControlBar = L.Toolbar2.Control.extend({})), - (L.distortableImage.controlBar = function (t) { - return new L.DistortableImage.ControlBar(t); - }), - L.DistortableCollection.addInitHook(function () { - (this.ACTIONS = [ - L.ExportAction, - L.DeleteAction, - L.LockAction, - L.UnlockAction, - ]), - (L.DistortableCollection.Edit.MODES = { - lock: L.LockAction, - unlock: L.UnlockAction, - }); - var t = this.options.actions ? this.options.actions : this.ACTIONS; - this.editing = L.distortableCollection.edit(this, { actions: t }); + } + + return true; + } + }); + + if (!this._overlay.isSelected()) { + this._removeToolbar(); + } + + return this; + }, + // set the mode to the next mode or if that was the last one set mode to '' + _nextOrNone: function _nextOrNone(mode) { + if (this.isMode(mode)) { + if (Object.keys(this.getModes()).length >= 1) { + this.nextMode(); + } else { + if (mode === 'lock') { + this._enableDragging(); + } + + this._mode = ''; + + this._updateHandle(); + } + } + }, + _removeToolbar: function _removeToolbar() { + var ov = this._overlay; + var map = ov._map; + + if (this.toolbar) { + map.removeLayer(this.toolbar); + this.toolbar = false; + } + }, + _enableDragging: function _enableDragging() { + var _this3 = this; + + var overlay = this._overlay; + var map = overlay._map; + this.dragging = new L.Draggable(overlay.getElement()); + this.dragging.enable(); + /* Hide toolbars and markers while dragging; click will re-show it */ + + this.dragging.on('dragstart', function () { + overlay.fire('dragstart'); + + _this3._removeToolbar(); + }); + /* + * Adjust default behavior of L.Draggable, which overwrites the CSS3 + * distort transformations that we set when it calls L.DomUtil.setPosition. + */ + + this.dragging._updatePosition = function () { + var topLeft = overlay.getCorner(0); + + var delta = this._newPos.subtract(map.latLngToLayerPoint(topLeft)); + + var currentPoint; + var corners = {}; + var i; + this.fire('predrag'); + + for (i = 0; i < 4; i++) { + currentPoint = map.latLngToLayerPoint(overlay.getCorner(i)); + corners[i] = map.layerPointToLatLng(currentPoint.add(delta)); + } + + overlay.setCorners(corners); + overlay.fire('drag'); + this.fire('drag'); + }; + + this.dragging.on('dragend', function () { + overlay.fire('dragend'); + }); + }, + _disableDragging: function _disableDragging() { + if (this.dragging) { + this.dragging.disable(); + delete this.dragging; + } + }, + _dragMode: function _dragMode() { + this.setMode('drag'); + }, + _scaleMode: function _scaleMode() { + this.setMode('scale'); + }, + _distortMode: function _distortMode() { + this.setMode('distort'); + }, + _rotateMode: function _rotateMode() { + this.setMode('rotate'); + }, + _freeRotateMode: function _freeRotateMode() { + this.setMode('freeRotate'); + }, + _toggleLockMode: function _toggleLockMode() { + if (this.isMode('lock')) { + this._unlock(); + } else { + this._lock(); + } + }, + _toggleOpacity: function _toggleOpacity() { + var image = this._overlay.getElement(); + + var opacity; + + if (!this.hasTool(L.OpacityAction)) { + return; + } + + this._transparent = !this._transparent; + opacity = this._transparent ? this.options.opacity : 1; + L.DomUtil.setOpacity(image, opacity); + image.setAttribute('opacity', opacity); + + this._refresh(); + }, + _toggleBorder: function _toggleBorder() { + var image = this._overlay.getElement(); + + var outline; + + if (!this.hasTool(L.BorderAction)) { + return; + } + + this._outlined = !this._outlined; + outline = this._outlined ? this.options.outline : 'none'; + image.style.outline = outline; + + this._refresh(); + }, + // compare this to using overlay zIndex + _toggleOrder: function _toggleOrder() { + if (this._toggledImage) { + this._stackUp(); + } else { + this._stackDown(); + } + }, + _removeOverlay: function _removeOverlay() { + var ov = this._overlay; + var eP = this.parentGroup; + + if (this.isMode('lock') || !this.hasTool(L.DeleteAction)) { + return; + } + + var choice = L.DomUtil.confirmDelete(); + + if (!choice) { + return; + } + + this._removeToolbar(); + + if (eP) { + eP.removeLayer(ov); + } else { + ov._map.removeLayer(ov); + } + }, + // Based on https://github.com/publiclab/mapknitter/blob/8d94132c81b3040ae0d0b4627e685ff75275b416/app/assets/javascripts/mapknitter/Map.js#L47-L82 + _getExport: function _getExport() { + var overlay = this._overlay; + var map = overlay._map; + var img = overlay.getElement(); + + if (!this.hasTool(L.ExportAction)) { + return; + } // make a new image + + + var downloadable = new Image(); + downloadable.id = downloadable.id || 'tempId12345'; + document.body.appendChild(downloadable); + + downloadable.onload = function onLoadDownloadableImage() { + var height = downloadable.height; + var width = downloadable.width; + var nw = map.latLngToLayerPoint(overlay.getCorner(0)); + var ne = map.latLngToLayerPoint(overlay.getCorner(1)); + var sw = map.latLngToLayerPoint(overlay.getCorner(2)); + var se = map.latLngToLayerPoint(overlay.getCorner(3)); // I think this is to move the image to the upper left corner, + // eslint-disable-next-line max-len + // jywarren: i think we may need these or the image goes off the edge of the canvas + // jywarren: but these seem to break the distortion math... + // jywarren: i think it should be rejiggered so it + // finds the most negative values of x and y and then + // adds those to all coordinates + // nw.x -= nw.x; + // ne.x -= nw.x; + // se.x -= nw.x; + // sw.x -= nw.x; + // nw.y -= nw.y; + // ne.y -= nw.y; + // se.y -= nw.y; + // sw.y -= nw.y; + // run once warping is complete + + downloadable.onload = function () { + L.DomUtil.remove(downloadable); + }; + + if (window && window.hasOwnProperty('warpWebGl')) { + warpWebGl(downloadable.id, [0, 0, width, 0, width, height, 0, height], [nw.x, nw.y, ne.x, ne.y, se.x, se.y, sw.x, sw.y], true // trigger download + ); + } + }; + + downloadable.src = overlay.options.fullResolutionSrc || img.src; + }, + _stackUp: function _stackUp() { + var t = this._toggledImage; + + if (!t || !this.hasTool(L.StackAction)) { + return; + } + + this._toggledImage = false; + + this._overlay.bringToFront(); + + this._refresh(); + }, + _stackDown: function _stackDown() { + var t = this._toggledImage; + + if (t || !this.hasTool(L.StackAction)) { + return; + } + + this._toggledImage = true; + + this._overlay.bringToBack(); + + this._refresh(); + }, + _unlock: function _unlock() { + var ov = this._overlay; + var map = ov._map; + var eP = this.parentGroup; + + if (!this.isMode('lock')) { + return; + } + + if (eP && !eP.isCollected(ov) || !eP) { + if (!this.hasTool(L.LockAction)) { + return; + } + } + + if (this.currentHandle) { + map.removeLayer(this.currentHandle); + } + + if (ov.options.mode === 'lock' || !this.hasMode(ov.options.mode)) { + this._mode = ''; + this.currentHandle = ''; + } else { + this._mode = ov.options.mode; + } + + this._updateHandle(); + + this._enableDragging(); + + this._refresh(); + }, + _lock: function _lock() { + var ov = this._overlay; + var map = ov._map; + var eP = this.parentGroup; + + if (this.isMode('lock')) { + return; + } + + if (eP && !eP.isCollected(ov) || !eP) { + if (!this.hasTool(L.LockAction)) { + return; + } + } + + if (this.currentHandle) { + map.removeLayer(this.currentHandle); + } + + this._mode = 'lock'; + + this._updateHandle(); + + this._disableDragging(); + + this._refresh(); + }, + _deselect: function _deselect() { + this._overlay.deselect(); + }, + _showMarkers: function _showMarkers(e) { + var eP = this.parentGroup; + + if (!this.currentHandle) { + return; + } // only markers we want in collect interface for now is lock + + + if (!this.isMode('lock') && eP && eP.anyCollected()) { + return; + } + + this.currentHandle.eachLayer(function (handle) { + handle.setOpacity(1); + + if (handle.dragging) { + handle.dragging.enable(); + } + + L.DomUtil.addClass(handle.getElement(), 'leaflet-interactive'); + }); + }, + _hideMarkers: function _hideMarkers() { + var ov = this._overlay; + var eP = this.parentGroup; // workaround for race condition w/ feature group + + if (!this._handles) { + this._initHandles(); + } + + if (!this.currentHandle) { + return; + } + + if (this.isMode('lock') && eP && eP.isCollected(ov)) { + return; + } + + this.currentHandle.eachLayer(function (handle) { + handle.setOpacity(0); + + if (handle.dragging) { + handle.dragging.disable(); + } + + L.DomUtil.removeClass(handle.getElement(), 'leaflet-interactive'); + }); + }, + _updateHandle: function _updateHandle() { + var ov = this._overlay; + var map = ov._map; + var mode = this.getMode(); + + if (this.currentHandle) { + map.removeLayer(this.currentHandle); + } + + this.currentHandle = mode === '' ? '' : this._handles[mode]; + + if (this.currentHandle !== '') { + map.addLayer(this.currentHandle); + } + }, + _addToolbar: function _addToolbar() { + var ov = this._overlay; + var eP = this.parentGroup; + var map = ov._map; // Find the topmost point on the image. + + var corners = ov.getCorners(); + var maxLat = -Infinity; + + if (eP && eP.anyCollected()) { + eP.editing._addToolbar(); + + return; + } + + if (ov.options.suppressToolbar || this.toolbar) { + return; + } + + for (var i = 0; i < corners.length; i++) { + if (corners[i].lat > maxLat) { + maxLat = corners[i].lat; + } + } // Longitude is based on the centroid of the image. + + + var raisedPoint = ov.getCenter(); + raisedPoint.lat = maxLat; + this.toolbar = L.distortableImage.popupBar(raisedPoint, { + actions: this.editActions + }).addTo(map, ov); + ov.fire('toolbar:created'); + }, + _refresh: function _refresh() { + if (this.toolbar) { + this._removeToolbar(); + } + + this._addToolbar(); + }, + _updateToolbarPos: function _updateToolbarPos() { + var overlay = this._overlay; // Find the topmost point on the image. + + var corners = overlay.getCorners(); + var toolbar = this.toolbar; + var maxLat = -Infinity; + + if (toolbar && toolbar instanceof L.DistortableImage.PopupBar) { + for (var i = 0; i < corners.length; i++) { + if (corners[i].lat > maxLat) { + maxLat = corners[i].lat; + } + } // Longitude is based on the centroid of the image. + + + var raisedPoint = overlay.getCenter(); + raisedPoint.lat = maxLat; + + if (!overlay.options.suppressToolbar) { + this.toolbar.setLatLng(raisedPoint); + } + } + }, + hasMode: function hasMode(mode) { + return !!this._modes[mode]; + }, + getMode: function getMode() { + if (!this.enabled()) { + return; + } + + return this._mode; + }, + getModes: function getModes() { + return this._modes; + }, + isMode: function isMode(mode) { + if (!this.enabled()) { + return false; + } + + return this._mode === mode; + }, + setMode: function setMode(newMode) { + var ov = this._overlay; + var eP = this.parentGroup; + var mode = this.getMode(); + + if (mode === newMode || !this.hasMode(newMode) || !this.enabled()) { + return; + } + + if (this.toolbar) { + this.toolbar.clickTool(newMode); + } + + if (this.isMode('lock') && !this.dragging) { + this._enableDragging(); + } + + this._mode = newMode; + + if (this.isMode('lock')) { + this._disableDragging(); + } + + this._updateHandle(); + + this._refresh(); + + if (eP && eP.isCollected(ov)) { + ov.deselect(); + } + + return this; + }, + + /** + * need to attach a stop to img dblclick or it will propagate to + * the map and fire the handler that shows map location labels on map dblclick. + */ + nextMode: function nextMode(e) { + var mode = this.getMode(); + var eP = this.parentGroup; + var modesArray = Object.keys(this.getModes()); + var idx = modesArray.indexOf(mode); + var nextIdx = (idx + 1) % modesArray.length; + var newMode = modesArray[nextIdx]; + + if (e) { + if (eP && eP.anyCollected()) { + return; + } + + L.DomEvent.stop(e); + } + + return this.setMode(newMode); + } +}); + +L.distortableImage.edit = function (overlay, options) { + return new L.DistortableImage.Edit(overlay, options); +}; + +/***/ }), + +/***/ "./src/edit/actions/BorderAction.js": +/*!******************************************!*\ + !*** ./src/edit/actions/BorderAction.js ***! + \******************************************/ +/***/ (function() { + +L.BorderAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var mode = edit._mode; + var use; + var tooltip; + + if (edit._outlined) { + use = 'border_outer'; + tooltip = overlay.options.translation.removeBorder; + } else { + use = 'border_clear'; + tooltip = overlay.options.translation.addBorder; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: use, + tooltip: tooltip, + className: mode === 'lock' ? 'disabled' : '' + }; // conditional for disabling keybindings for this action when the image is locked. + + L.DistortableImage.action_map.b = mode === 'lock' ? '' : '_toggleBorder'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + L.IconUtil.toggleXlink(this._link, 'border_clear', 'border_outer'); + L.IconUtil.toggleTitle(this._link, 'Remove Border', 'Add Border'); + + edit._toggleBorder(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/DeleteAction.js": +/*!******************************************!*\ + !*** ./src/edit/actions/DeleteAction.js ***! + \******************************************/ +/***/ (function() { + +L.DeleteAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var use = 'delete_forever'; + var tooltip; + /** + * we can tell whether the overlay is an instance of `L.DistortableImageOverlay` or `L.DistortableCollection` bc only + * the former should have `parentGroup` defined on it. From there we call the apporpriate keybindings and methods. + */ + + if (edit instanceof L.DistortableImage.Edit) { + tooltip = overlay.options.translation.deleteImage; // backspace windows / delete mac + + L.DistortableImage.action_map.Backspace = edit._mode === 'lock' ? '' : '_removeOverlay'; + } else { + tooltip = overlay.options.translation.deleteImages; + L.DistortableImage.group_action_map.Backspace = edit._mode === 'lock' ? '' : '_removeGroup'; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: use, + tooltip: tooltip, + className: edit._mode === 'lock' ? 'disabled' : '' + }; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + if (edit instanceof L.DistortableImage.Edit) { + edit._removeOverlay(); + } else { + edit._removeGroup(); + } + } +}); + +/***/ }), + +/***/ "./src/edit/actions/DistortAction.js": +/*!*******************************************!*\ + !*** ./src/edit/actions/DistortAction.js ***! + \*******************************************/ +/***/ (function() { + +L.DistortAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'distort', + tooltip: overlay.options.translation.distortImage, + className: 'distort' + }; + L.DistortableImage.action_map.d = '_distortMode'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._distortMode(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/DragAction.js": +/*!****************************************!*\ + !*** ./src/edit/actions/DragAction.js ***! + \****************************************/ +/***/ (function() { + +L.DragAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'drag', + tooltip: overlay.options.translation.dragImage, + className: 'drag' + }; + L.DistortableImage.action_map.D = '_dragMode'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._dragMode(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/EditAction.js": +/*!****************************************!*\ + !*** ./src/edit/actions/EditAction.js ***! + \****************************************/ +/***/ (function() { + +L.DistortableImage = L.DistortableImage || {}; +L.distortableImage = L.DistortableImage; +L.DistortableImage.action_map = {}; +L.EditAction = L.Toolbar2.Action.extend({ + options: { + toolbarIcon: { + svg: false, + html: '', + className: '', + tooltip: '' + } + }, + initialize: function initialize(map, overlay, options) { + this._overlay = overlay; + this._map = map; + L.setOptions(this, options); + L.Toolbar2.Action.prototype.initialize.call(this, options); + + this._injectIconSet(); + }, + _createIcon: function _createIcon(toolbar, container, args) { + var _this = this; + + var iconOptions = this.options.toolbarIcon; + var className = iconOptions.className; + var edit = this._overlay.editing; + this.toolbar = toolbar; + this._icon = L.DomUtil.create('li', '', container); + this._link = L.DomUtil.create('a', '', this._icon); + + if (iconOptions.svg) { + this._link.innerHTML = L.IconUtil.create(iconOptions.html); + } else { + this._link.innerHTML = iconOptions.html; + } + + this._link.setAttribute('href', '#'); + + this._link.setAttribute('title', iconOptions.tooltip); + + this._link.setAttribute('role', 'button'); + + L.DomUtil.addClass(this._link, this.constructor.baseClass); + + if (className) { + L.DomUtil.addClass(this._link, className); + + if (className === 'disabled') { + L.DomUtil.addClass(this._icon, className); + } + + if (className === edit._mode) { + L.DomUtil.addClass(this._link, 'selected-mode'); + } else { + L.DomUtil.removeClass(this._link, 'selected-mode'); + } + } + + L.DomEvent.on(this._link, 'click', this.enable, this); + L.DomEvent.on(this._overlay, 'update', function () { + var match = _this._link.innerHTML.match(/xlink:href="#restore"/); + + if (match && match.length === 1) { + _this._enableAction(); + } + }); + /* Add secondary toolbar */ + + this._addSubToolbar(toolbar, this._icon, args); + }, + _injectIconSet: function _injectIconSet() { + if (document.querySelector('#iconset')) { + return; + } + + var el = document.createElement('div'); + el.id = 'iconset'; + el.setAttribute('hidden', 'hidden'); + el.innerHTML = new L.ToolbarIconSet().render(); + document.querySelector('.leaflet-marker-pane').appendChild(el); + }, + _enableAction: function _enableAction() { + L.DomUtil.removeClass(this._link.parentElement, 'disabled'); + L.DomUtil.removeClass(this._link, 'disabled'); + }, + _disableAction: function _disableAction() { + L.DomUtil.addClass(this._link.parentElement, 'disabled'); + L.DomUtil.addClass(this._link, 'disabled'); + } +}); + +L.editAction = function (map, overlay, options) { + return new L.EditAction(map, overlay, options); +}; + +/***/ }), + +/***/ "./src/edit/actions/ExportAction.js": +/*!******************************************!*\ + !*** ./src/edit/actions/ExportAction.js ***! + \******************************************/ +/***/ (function() { + +L.ExportAction = L.EditAction.extend({ + // This function is executed every time we select an image + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var tooltip; + this.isExporting = false; + this.mouseLeaveSkip = true; + this.isHooksExecuted = false; + + if (edit instanceof L.DistortableImage.Edit) { + L.DistortableImage.action_map.e = '_getExport'; + tooltip = overlay.options.translation.exportImage; + } else { + L.DistortableImage.group_action_map.e = 'runExporter'; + tooltip = overlay.options.translation.exportImages; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'get_app', + tooltip: tooltip + }; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + if (edit instanceof L.DistortableImage.Edit) { + edit._getExport(); + + return; + } // Make sure that addHooks is executed only once, event listeners will handle the rest + + + if (this.isHooksExecuted) { + return; + } else { + this.isHooksExecuted = true; + } + + var exportTool = this._link.parentElement; + this.mouseEnterHandler = this.handleMouseEnter.bind(this); + this.mouseLeaveHandler = this.handleMouseLeave.bind(this); + L.DomEvent.on(exportTool, 'click', function () { + if (!this.isExporting) { + this.isExporting = true; + this.renderExportIcon(); + setTimeout(this.attachMouseEventListeners.bind(this, exportTool), 100); + edit.runExporter().then(function () { + this.resetState(); + this.detachMouseEventListeners(exportTool); + }.bind(this)); + } else { + // Clicking on the export icon after export has started will be ignored + if (this.mouseLeaveSkip) { + return; + } + + this.resetState(); + this.detachMouseEventListeners(exportTool); + edit.cancelExport(); + } + }, this); + }, + resetState: function resetState() { + this.renderDownloadIcon(); + this.isExporting = false; + this.mouseLeaveSkip = true; + }, + attachMouseEventListeners: function attachMouseEventListeners(element) { + element.addEventListener('mouseenter', this.mouseEnterHandler); + element.addEventListener('mouseleave', this.mouseLeaveHandler); + }, + detachMouseEventListeners: function detachMouseEventListeners(element) { + element.removeEventListener('mouseenter', this.mouseEnterHandler); + element.removeEventListener('mouseleave', this.mouseLeaveHandler); + }, + handleMouseEnter: function handleMouseEnter() { + this.renderCancelIcon(); + }, + handleMouseLeave: function handleMouseLeave() { + if (!this.mouseLeaveSkip) { + this.renderExportIcon(); + } else { + this.mouseLeaveSkip = false; + } + }, + renderDownloadIcon: function renderDownloadIcon() { + L.IconUtil.toggleXlink(this._link, 'get_app', 'spinner'); + L.IconUtil.toggleTitle(this._link, 'Export Images', 'Loading...'); + L.DomUtil.removeClass(this._link.firstChild, 'loader'); + }, + renderExportIcon: function renderExportIcon() { + L.IconUtil.toggleXlink(this._link, 'spinner'); + L.IconUtil.toggleTitle(this._link, 'Export Images', 'Loading...'); + L.IconUtil.addClassToSvg(this._link, 'loader'); + }, + renderCancelIcon: function renderCancelIcon() { + L.IconUtil.toggleXlink(this._link, 'cancel'); + L.IconUtil.toggleTitle(this._link, 'Cancel Export', 'Loading...'); + L.DomUtil.removeClass(this._link.firstChild, 'loader'); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/FreeRotateAction.js": +/*!**********************************************!*\ + !*** ./src/edit/actions/FreeRotateAction.js ***! + \**********************************************/ +/***/ (function() { + +L.FreeRotateAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'crop_rotate', + tooltip: overlay.options.translation.freeRotateImage, + className: 'freeRotate' + }; + L.DistortableImage.action_map.f = '_freeRotateMode'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._freeRotateMode(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/GeolocateAction.js": +/*!*********************************************!*\ + !*** ./src/edit/actions/GeolocateAction.js ***! + \*********************************************/ +/***/ (function() { + +L.GeolocateAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'explore', + tooltip: overlay.options.translation.geolocateImage, + className: edit._mode === 'lock' ? 'disabled' : '' + }; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var image = this._overlay.getElement(); + + EXIF.getData(image, L.EXIF(image)); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/LockAction.js": +/*!****************************************!*\ + !*** ./src/edit/actions/LockAction.js ***! + \****************************************/ +/***/ (function() { + +L.LockAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var use; + var tooltip; + + if (edit instanceof L.DistortableImage.Edit) { + L.DistortableImage.action_map.u = '_unlock'; + L.DistortableImage.action_map.l = '_lock'; + tooltip = overlay.options.translation.lockMode; + use = edit.isMode('lock') ? 'lock' : 'unlock'; + } else { + L.DistortableImage.group_action_map.l = '_lockGroup'; + tooltip = overlay.options.translation.lockImages; + use = 'lock'; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: use, + tooltip: tooltip, + className: 'lock' + }; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + if (edit instanceof L.DistortableImage.Edit) { + edit._toggleLockMode(); + } else { + edit._lockGroup(); + } + } +}); + +/***/ }), + +/***/ "./src/edit/actions/OpacityAction.js": +/*!*******************************************!*\ + !*** ./src/edit/actions/OpacityAction.js ***! + \*******************************************/ +/***/ (function() { + +L.OpacityAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var mode = edit._mode; + var use; + var tooltip; + + if (edit._transparent) { + use = 'opacity_empty'; + tooltip = overlay.options.translation.makeImageOpaque; + } else { + use = 'opacity'; + tooltip = overlay.options.translation.makeImageTransparent; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: use, + tooltip: tooltip, + className: mode === 'lock' ? 'disabled' : '' + }; + L.DistortableImage.action_map.o = mode === 'lock' ? '' : '_toggleOpacity'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + var link = this._link; + L.IconUtil.toggleXlink(link, 'opacity', 'opacity_empty'); + L.IconUtil.toggleTitle(link, 'Make Image Transparent', 'Make Image Opaque'); + + edit._toggleOpacity(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/RestoreAction.js": +/*!*******************************************!*\ + !*** ./src/edit/actions/RestoreAction.js ***! + \*******************************************/ +/***/ (function() { + +L.RestoreAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var mode = L.Utils.getNestedVal(overlay, 'editing', '_mode'); + var edited = overlay.edited; + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'restore', + tooltip: overlay.options.translation.restoreImage, + className: edited && mode !== 'lock' ? '' : 'disabled' + }; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var ov = this._overlay; + L.DomEvent.on(ov, { + edit: this._enableAction, + restore: this._disableAction + }, this); + ov.restore(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/RotateAction.js": +/*!******************************************!*\ + !*** ./src/edit/actions/RotateAction.js ***! + \******************************************/ +/***/ (function() { + +L.RotateAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'rotate', + tooltip: overlay.options.translation.rotateImage, + className: 'rotate' + }; + L.DistortableImage.action_map.r = '_rotateMode'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._rotateMode(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/ScaleAction.js": +/*!*****************************************!*\ + !*** ./src/edit/actions/ScaleAction.js ***! + \*****************************************/ +/***/ (function() { + +L.ScaleAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'scale', + tooltip: overlay.options.translation.scaleImage, + className: 'scale' + }; + L.DistortableImage.action_map.s = '_scaleMode'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._scaleMode(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/StackAction.js": +/*!*****************************************!*\ + !*** ./src/edit/actions/StackAction.js ***! + \*****************************************/ +/***/ (function() { + +L.StackAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + var edit = overlay.editing; + var use; + var tooltip; + + if (edit._toggledImage) { + use = 'flip_to_back'; + tooltip = overlay.options.translation.stackToFront; + } else { + use = 'flip_to_front'; + tooltip = overlay.options.translation.stackToBack; + } + + options = options || {}; + options.toolbarIcon = { + svg: true, + html: use, + tooltip: tooltip, + className: edit._mode === 'lock' ? 'disabled' : '' + }; + L.DistortableImage.action_map.q = edit._mode === 'lock' ? '' : '_stackUp'; + L.DistortableImage.action_map.a = edit._mode === 'lock' ? '' : '_stackDown'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + L.IconUtil.toggleXlink(this._link, 'flip_to_front', 'flip_to_back'); + L.IconUtil.toggleTitle(this._link, 'Stack to Front', 'Stack to Back'); + + edit._toggleOrder(); + } +}); + +/***/ }), + +/***/ "./src/edit/actions/UnlockAction.js": +/*!******************************************!*\ + !*** ./src/edit/actions/UnlockAction.js ***! + \******************************************/ +/***/ (function() { + +L.UnlockAction = L.EditAction.extend({ + initialize: function initialize(map, overlay, options) { + options = options || {}; + options.toolbarIcon = { + svg: true, + html: 'unlock', + tooltip: overlay.options.translation.unlockImages + }; + L.DistortableImage.group_action_map.u = '_unlockGroup'; + L.EditAction.prototype.initialize.call(this, map, overlay, options); + }, + addHooks: function addHooks() { + var edit = this._overlay.editing; + + edit._unlockGroup(); + } +}); + +/***/ }), + +/***/ "./src/edit/getEXIFdata.js": +/*!*********************************!*\ + !*** ./src/edit/getEXIFdata.js ***! + \*********************************/ +/***/ (function() { + +/* eslint-disable no-unused-vars */ +L.EXIF = function getEXIFdata(img) { + if (Object.keys(EXIF.getAllTags(img)).length !== 0) { + console.log(EXIF.getAllTags(img)); + var GPS = EXIF.getAllTags(img); + var altitude; + /* If the lat/lng is available. */ + + if (typeof GPS.GPSLatitude !== 'undefined' && typeof GPS.GPSLongitude !== 'undefined') { + // sadly, encoded in [degrees,minutes,seconds] + // primitive value = GPS.GPSLatitude[x].numerator + var lat = GPS.GPSLatitude[0] + GPS.GPSLatitude[1] / 60 + GPS.GPSLatitude[2] / 3600; + var lng = GPS.GPSLongitude[0] + GPS.GPSLongitude[1] / 60 + GPS.GPSLongitude[2] / 3600; + + if (GPS.GPSLatitudeRef !== 'N') { + lat = lat * -1; + } + + if (GPS.GPSLongitudeRef === 'W') { + lng = lng * -1; + } + } // Attempt to use GPS compass heading; will require + // some trig to calc corner points, which you can find below: + + + var angle = 0; // "T" refers to "True north", so -90. + + if (GPS.GPSImgDirectionRef === 'T') { + angle = Math.PI / 180 * (GPS.GPSImgDirection.numerator / GPS.GPSImgDirection.denominator - 90); // "M" refers to "Magnetic north" + } else if (GPS.GPSImgDirectionRef === 'M') { + angle = Math.PI / 180 * (GPS.GPSImgDirection.numerator / GPS.GPSImgDirection.denominator - 90); + } else { + console.log('No compass data found'); + } + + console.log('Orientation:', GPS.Orientation); + /* If there is orientation data -- i.e. landscape/portrait etc */ + + if (GPS.Orientation === 6) { + // CCW + angle += Math.PI / 180 * -90; + } else if (GPS.Orientation === 8) { + // CW + angle += Math.PI / 180 * 90; + } else if (GPS.Orientation === 3) { + // 180 + angle += Math.PI / 180 * 180; + } + /* If there is altitude data */ + + + if (typeof GPS.GPSAltitude !== 'undefined' && typeof GPS.GPSAltitudeRef !== 'undefined') { + // Attempt to use GPS altitude: + // (may eventually need to find EXIF field of view for correction) + if (typeof GPS.GPSAltitude !== 'undefined' && typeof GPS.GPSAltitudeRef !== 'undefined') { + altitude = GPS.GPSAltitude.numerator / GPS.GPSAltitude.denominator + GPS.GPSAltitudeRef; + } else { + altitude = 0; // none + } + } + } else { + alert('EXIF initialized. Press again to view data in console.'); + } +}; + +/***/ }), + +/***/ "./src/edit/handles/DistortHandle.js": +/*!*******************************************!*\ + !*** ./src/edit/handles/DistortHandle.js ***! + \*******************************************/ +/***/ (function() { + +L.DistortHandle = L.EditHandle.extend({ + options: { + TYPE: 'distort', + icon: L.icon({ + iconUrl: // eslint-disable-next-line max-len + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAChSURBVO3BIU4DURgGwNkvL2B6AkQTLBqP4QCoSm7DDXoBLBZHDbfgICAIZjEV3YTn9uVHdMZZtcnCfI13bIzxg0emg6Nm6QVbYz3jylEsXRrvwommb49X67jFkz80fR9Mb1YxTzqiWBSLYlEsikWxKBbFolgUi2JRLIpFsSgWxaJY03fHHOu40dH07bAzWCx9Ge/TiWbpHgdsjPGNB2f/yS+7xRCyiiZPJQAAAABJRU5ErkJggg==', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + _onHandleDrag: function _onHandleDrag() { + var overlay = this._handled; + overlay.setCorner(this._corner, this.getLatLng()); + }, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + } +}); + +L.distortHandle = function (overlay, idx, options) { + return new L.DistortHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/handles/DragHandle.js": +/*!****************************************!*\ + !*** ./src/edit/handles/DragHandle.js ***! + \****************************************/ +/***/ (function() { + +L.DragHandle = L.EditHandle.extend({ + options: { + TYPE: 'drag', + icon: L.icon({ + // eslint-disable-next-line max-len + iconUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAsVJREFUeNrMVztLXEEUvnNVFAVBAhY2aRKbTZEHJNpYabuNjSgYg/GxdsmPSJkUAa/ZdVEX8mgWYVutbHxAHkVskjQBuUUgBISVhCQk3wnfwMlk1rusN1wHPubOzJlzvjlz5sxc01Ma/hUEwQnwDIjqc7uvgv9YYO86qgIwCXQbdNTlQ8kcCBHgBch8TcloF6oJGr6phk6EQAkfdz3zvgDr9Mr7Fg1fptEZoM8jsmrokpfsiIFO4IIjuE2v1EDmR4LRdlR5Gh51hj8D34ABtm8YTtqna0TgklIw5CgQguKxIojEjmFROg/MKQO27NkFAB+4wAPouGUJiIvWKHwbAxX2XyWRKWkqhT+pbJntJZJuUzISW0+5hW+obxrVBsfvoH/dqCCJuU97GBh2VteLSiYvArmErT8EVoAK9Bw7enbpVYmvAQlyowYforrH5jXL2rPHI/TKONDB7u9AlavdaTBPvPmazUeQuy8f7UomUgTEwIJPEQ3sQGE/6ll2l9H/KcEzBcfWn2IclluM3DpddJxSHujlFkscbUPvmB0LHVnLrId7nlaZVkEc6QGXQI1MAwZcWmVRHeNaQwJMMiU2cwy4s7p/RJ2ckpvIQs+cIs+5GzitloLKHUV3MPREuXbTOKO91dX387gGTONxIgEWm+E61FFrpcyqXLHsEwiDjEsjAksqw5XPoL9MHVrn6QR4q+XZrDaR4RoWzq2ymafuRA/Mq1stSsHLVkcbdf9VjOcx8ZH3+SFWcCWlVPyWuUBOwUWdC1wP5NVjYiXFWLO69PZ6CRTUY6KSIoEKdf6T3IzzgHxnsyHctNBEkmn6Oob8ExUDg/ahGybd177cDjzH5xHwgDiSvoS7I/LZyvxJZj0wod7tkX5G0XVC7rEyLhfLJjBGbKoLLEfZWObyKeZ6oY82g+yf5Zn/mJyHX7PMf04z/T3/LcAAu4E6iiyJqf0AAAAASUVORK5CYII=', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + _onHandleDrag: function _onHandleDrag() { + var overlay = this._handled; + var formerLatLng = overlay.getCorner(this._corner); + var newLatLng = this.getLatLng(); + overlay.dragBy(formerLatLng, newLatLng); + }, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + } +}); + +L.dragHandle = function (overlay, idx, options) { + return new L.DragHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/handles/EditHandle.js": +/*!****************************************!*\ + !*** ./src/edit/handles/EditHandle.js ***! + \****************************************/ +/***/ (function() { + +L.EditHandle = L.Marker.extend({ + initialize: function initialize(overlay, corner, options) { + var latlng = overlay.getCorner(corner); + L.setOptions(this, options); + this._handled = overlay; + this._corner = corner; + var markerOptions = { + draggable: true, + zIndexOffset: 10 + }; + + if (options && options.hasOwnProperty('draggable')) { + markerOptions.draggable = options.draggable; + } + + L.Marker.prototype.initialize.call(this, latlng, markerOptions); + }, + onAdd: function onAdd(map) { + L.Marker.prototype.onAdd.call(this, map); + + this._bindListeners(); + + this.updateHandle(); + }, + onRemove: function onRemove(map) { + this._unbindListeners(); + + L.Marker.prototype.onRemove.call(this, map); + }, + _onHandleDragStart: function _onHandleDragStart() { + this._handled.fire('editstart'); + }, + _onHandleDragEnd: function _onHandleDragEnd() { + this._fireEdit(); + }, + _fireEdit: function _fireEdit() { + this._handled.edited = true; + + this._handled.fire('edit'); + }, + _bindListeners: function _bindListeners() { + this.on({ + contextmenu: L.DomEvent.stop, + dragstart: this._onHandleDragStart, + drag: this._onHandleDrag, + dragend: this._onHandleDragEnd + }, this); + + this._handled._map.on('zoomend', this.updateHandle, this); + + this._handled.on('update', this.updateHandle, this); + }, + _unbindListeners: function _unbindListeners() { + this.off({ + contextmenu: L.DomEvent.stop, + dragstart: this._onHandleDragStart, + drag: this._onHandleDrag, + dragend: this._onHandleDragEnd + }, this); + + this._handled._map.off('zoomend', this.updateHandle, this); + + this._handled.off('update', this.updateHandle, this); + }, + + /* Takes two latlngs and calculates the scaling difference. */ + _calculateScalingFactor: function _calculateScalingFactor(latlngA, latlngB) { + var overlay = this._handled; + var map = overlay._map; + var centerPoint = map.latLngToLayerPoint(overlay.getCenter()); + var formerPoint = map.latLngToLayerPoint(latlngA); + var newPoint = map.latLngToLayerPoint(latlngB); + + var formerRadiusSquared = this._d2(centerPoint, formerPoint); + + var newRadiusSquared = this._d2(centerPoint, newPoint); + + return Math.sqrt(newRadiusSquared / formerRadiusSquared); + }, + + /* Distance between two points in cartesian space, squared (distance formula). */ + _d2: function _d2(a, b) { + var dx = a.x - b.x; + var dy = a.y - b.y; + return Math.pow(dx, 2) + Math.pow(dy, 2); + }, + + /* Takes two latlngs and calculates the angle between them. */ + calculateAngleDelta: function calculateAngleDelta(latlngA, latlngB) { + var overlay = this._handled; + var map = overlay._map; + var centerPoint = map.latLngToLayerPoint(overlay.getCenter()); + var formerPoint = map.latLngToLayerPoint(latlngA); + var newPoint = map.latLngToLayerPoint(latlngB); + var initialAngle = Math.atan2(centerPoint.y - formerPoint.y, centerPoint.x - formerPoint.x); + var newAngle = Math.atan2(centerPoint.y - newPoint.y, centerPoint.x - newPoint.x); + return newAngle - initialAngle; + } +}); + +/***/ }), + +/***/ "./src/edit/handles/FreeRotateHandle.js": +/*!**********************************************!*\ + !*** ./src/edit/handles/FreeRotateHandle.js ***! + \**********************************************/ +/***/ (function() { + +L.FreeRotateHandle = L.EditHandle.extend({ + options: { + TYPE: 'freeRotate', + icon: L.icon({ + iconUrl: // eslint-disable-next-line max-len + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAHiSURBVMXBa3HbShgA0PMp/1sCCo8oCEpgTaCXgIXAJiDzyCJoAUTm4UVQAns1Y8+snWnTvJyeE16hkjDgDrfoNTMKcpC9UPiLSo8JyetkjEHxjPCMyoS199kFoz8Iv1HpMaN3qWDCHoegOKkkRwnJpRmroHgiPFEZ8IBekzEGxQtUEhKSS/fB7Ew4U+lxcGkVZG9QWWPSFAxBcdK59KApuA+yNwp2uEdx1GN25sZJZULSfAtm77SlbNjju6MvG75u+WHRWVR6rDVjMPsgwYyVZl3pLTpHkyYHOx8syMiayaJzlDTZ9YyaZNFVkiYH2ZUEBcVJJXVImuz6Js3Qofe59pq7DoOTILu+g+a288mCouk7/1iH4qTS+2QdDppbV1ZJmrnDXnPnc5UOs2Z0fUmTuyBr+krvSioJyUmQO0dZM7mepMkWnaNRkyrJB6uskTSjxY3Fll8bvmJwlDb83FJ8gMqAB80uyBY3Trb82PAfvjj6vuHnluIdKgMeNXOwctK5NKBoHitrb1RJeHRp5Ux4ojLg0aWMHGQvUOkxIWkKVsHsTPiNSo8HDC5lZIsgO6n0uMUdRvQuFQxB8UR4RmXC2vvsgtEfhL+o9JiQvE7GGBTPCK9QSUjoMWgKDthjDrIX+h/k0I7gth6N5gAAAABJRU5ErkJggg==', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + _onHandleDrag: function _onHandleDrag() { + var overlay = this._handled; + var map = overlay._map; + var formerLatLng = overlay.getCorner(this._corner); + var newLatLng = this.getLatLng(); + var angle = this.calculateAngleDelta(formerLatLng, newLatLng); + + var scale = this._calculateScalingFactor(formerLatLng, newLatLng); + + if (angle !== 0) { + overlay.rotateBy(angle, 'rad'); + } + + var edgeMinWidth = overlay.edgeMinWidth; + + if (!edgeMinWidth) { + edgeMinWidth = 50; + } + /* just in case */ + + + var corner1 = map.latLngToContainerPoint(overlay.getCorner(0)); + var corner2 = map.latLngToContainerPoint(overlay.getCorner(1)); + var w = Math.abs(corner1.x - corner2.x); + var h = Math.abs(corner1.y - corner2.y); + var distance = Math.sqrt(w * w + h * h); + + if (distance > edgeMinWidth || scale > 1) { + overlay.scaleBy(scale); + } else { + overlay.scaleBy(1); + } + }, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + } +}); + +L.freeRotateHandle = function (overlay, idx, options) { + return new L.FreeRotateHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/handles/LockHandle.js": +/*!****************************************!*\ + !*** ./src/edit/handles/LockHandle.js ***! + \****************************************/ +/***/ (function() { + +L.LockHandle = L.EditHandle.extend({ + options: { + TYPE: 'lock', + interactive: false, + icon: L.icon({ + // eslint-disable-next-line max-len + iconUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAD8SURBVO3BPU7CYAAA0AdfjIcQlRCQBG7C3gk2uIPG2RC3Dk16Gz0FTO1WZs/gwGCMP/2+xsSl7+n1er1Iz9LtRQjaPeMeO+TinLDCJV78YqjdA04YodKuxhUaPGoRxMmxwRQZSt87Yo4KExGCeAUyLLFB4bMacxywEClIU2KDKXbInTUYo8JCgoFuGoxQO5uiwY1EA91VmDqrcKeDoX8WdNNgjApvmGGLXKIgXY0xGkxQYItrrFFIEKQ5Yo4KEx9yrDFDhlKkIF6NOQ5Y+KpAhiXWKEQI4pxwiwoLPyuxwQw75FoE7fZYocFEuwI7jHCBV39gL92TXq/Xi/AOcmczZmaIMScAAAAASUVORK5CYII=', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + onRemove: function onRemove(map) { + this.unbindTooltip(); + L.EditHandle.prototype.onRemove.call(this, map); + }, + _bindListeners: function _bindListeners() { + var icon = this.getElement(); + + L.EditHandle.prototype._bindListeners.call(this); + + L.DomEvent.on(icon, { + mousedown: this._tooltipOn, + mouseup: this._tooltipOff + }, this); + L.DomEvent.on(document, 'pointerleave', this._tooltipOff, this); + }, + _unbindListeners: function _unbindListeners() { + var icon = this.getElement(); + + L.EditHandle.prototype._bindListeners.call(this); + + L.DomEvent.off(icon, { + mousedown: this._tooltipOn, + mouseup: this._tooltipOff + }, this); + L.DomEvent.off(document, 'pointerleave', this._tooltipOff, this); + }, + + /* cannot be dragged */ + _onHandleDrag: function _onHandleDrag() {}, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + }, + _tooltipOn: function _tooltipOn(e) { + var eP = this._handled.parentGroup; + var edit = eP ? eP.editing : this._handled.editing; + + if (e.shiftKey) { + return; + } + + if (!this._handled.isSelected() && eP && !eP.isCollected(this._handled)) { + return; + } + + var handlesArr = edit._lockHandles; + this._timer = setTimeout(L.bind(function () { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!this.getTooltip()) { + this.bindTooltip('Locked!', { + permanent: true }); - }, - 93: function () { - (L.DistortableImage = L.DistortableImage || {}), - (L.distortableImage = L.DistortableImage), - (L.DistortableImage.action_map = {}), - (L.DistortableImage.PopupBar = L.Toolbar2.Popup.extend({ - options: { anchor: [0, -10] }, - initialize: function (t, e) { - L.setOptions(this, e), - L.Toolbar2.Popup.prototype.initialize.call(this, t, e); - }, - addHooks: function (t, e) { - (this.map = t), (this.ov = e); - }, - tools: function () { - if (this._ul) return this._ul.children; - }, - clickTool: function (t) { - for (var e = this.tools(), i = 0; i < e.length; i++) { - var o = e.item(i).children[0]; - if (L.DomUtil.hasClass(o, t)) return o.click(), o; - } - return !1; - }, - })), - (L.distortableImage.popupBar = function (t, e) { - return new L.DistortableImage.PopupBar(t, e); - }), - L.DistortableImageOverlay.addInitHook(function () { - (this.ACTIONS = [ - L.DragAction, - L.ScaleAction, - L.DistortAction, - L.RotateAction, - L.FreeRotateAction, - L.LockAction, - L.OpacityAction, - L.BorderAction, - L.ExportAction, - L.DeleteAction, - ]), - (L.DistortableImage.Edit.MODES = { - drag: L.DragAction, - scale: L.ScaleAction, - distort: L.DistortAction, - rotate: L.RotateAction, - freeRotate: L.FreeRotateAction, - lock: L.LockAction, - }); - var t = this.options.actions ? this.options.actions : this.ACTIONS; - this.editing = L.distortableImage.edit(this, { actions: t }); + } else { + handlesArr.eachLayer(function (handle) { + if (this !== handle) { + handle.closeTooltip(); + } }); - }, - 376: function () { - L.IconSet = L.Class.extend({ - _svg: '', - _symbols: "", - render: function () { - return this.addSymbols(this._symbols), this._svg; - }, - addSymbols: function (t) { - this._svg += t; - }, - }); - }, - 261: function () { - L.KeymapperIconSet = L.IconSet.extend({ - _symbols: - '', - }); - }, - 929: function () { - L.ToolbarIconSet = L.IconSet.extend({ - _symbols: - '', - }); - }, - 496: function () { - L.Map.mergeOptions({ boxCollector: !0, boxZoom: !1 }), - (L.Map.BoxCollector = L.Map.BoxZoom.extend({ - initialize: function (t) { - (this._map = t), - (this._container = t._container), - (this._pane = t._panes.overlayPane), - (this._resetStateTimeout = 0), - t.on("unload", this._destroy, this); - }, - addHooks: function () { - L.DomEvent.on( - this._container, - "mousedown", - this._onMouseDown, - this - ); - }, - removeHooks: function () { - L.DomEvent.off( - this._container, - "mousedown", - this._onMouseDown, - this - ); - }, - moved: function () { - return this._moved; - }, - _destroy: function () { - L.DomUtil.remove(this._pane), delete this._pane; - }, - _resetState: function () { - (this._resetStateTimeout = 0), (this._moved = !1); - }, - _clearDeferredResetState: function () { - 0 !== this._resetStateTimeout && - (clearTimeout(this._resetStateTimeout), - (this._resetStateTimeout = 0)); - }, - _onMouseDown: function (t) { - if (!t.shiftKey || (1 !== t.which && 1 !== t.button)) return !1; - this._clearDeferredResetState(), - this._resetState(), - L.DomUtil.disableTextSelection(), - L.DomUtil.disableImageDrag(), - (this._startPoint = this._map.mouseEventToContainerPoint(t)), - L.DomEvent.on( - document, - { - contextmenu: L.DomEvent.stop, - mousemove: this._onMouseMove, - mouseup: this._onMouseUp, - }, - this - ); - }, - _onMouseMove: function (t) { - this._moved || - ((this._moved = !0), - (this._box = L.DomUtil.create( - "div", - "leaflet-zoom-box", - this._container - )), - L.DomUtil.addClass(this._container, "leaflet-crosshair"), - this._map.fire("boxzoomstart")), - (this._point = this._map.mouseEventToContainerPoint(t)), - (this._bounds = L.bounds(this._startPoint, this._point)); - var e = this._bounds.getSize(); - L.DomUtil.setPosition(this._box, this._bounds.min), - (this._box.style.width = e.x + "px"), - (this._box.style.height = e.y + "px"); - }, - _finish: function () { - this._moved && - (L.DomUtil.remove(this._box), - L.DomUtil.removeClass(this._container, "leaflet-crosshair")), - L.DomUtil.enableTextSelection(), - L.DomUtil.enableImageDrag(), - L.DomEvent.off( - document, - { - contextmenu: L.DomEvent.stop, - mousemove: this._onMouseMove, - mouseup: this._onMouseUp, - }, - this - ); - }, - _onMouseUp: function (t) { - if ( - (1 === t.which || 1 === t.button) && - (this._finish(), this._moved) - ) { - this._clearDeferredResetState(), - (this._resetStateTimeout = setTimeout( - L.Util.bind(this._resetState, this), - 0 - )); - var e = L.latLngBounds( - this._map.containerPointToLatLng( - this._bounds.getBottomLeft() - ), - this._map.containerPointToLatLng(this._bounds.getTopRight()) - ), - i = this._map.getZoom(), - o = this._map.getCenter(); - (e = this._map._latLngBoundsToNewLayerBounds(e, i, o)), - this._map.fire("boxcollectend", { boxCollectBounds: e }); - } - }, - })), - L.Map.addInitHook("addHandler", "boxCollector", L.Map.BoxCollector); - }, - 291: function () { - L.Map.mergeOptions({ doubleClickLabels: !0 }), - (L.Map.DoubleClickLabels = L.Map.DoubleClickZoom.extend({ - enable: function () { - var t = this._map; - return ( - this._enabled || - (t.doubleClickZoom.enabled() && t.doubleClickZoom.disable(), - this._map.fire("singleclickon"), - (this._enabled = !0), - this.addHooks()), - this - ); - }, - disable: function () { - return this._enabled - ? ((this._enabled = !1), this.removeHooks(), this) - : this; - }, - _fireIfSingle: function (t) { - var e = this._map, - i = t.originalEvent; - (i && i.shiftKey) || - ((e._clicked += 1), - (this._map._clickTimeout = setTimeout(function () { - 1 === e._clicked - ? ((e._clicked = 0), - e.fire("singleclick", { type: "singleclick" })) - : L.Browser.touch && - i && - i.sourceCapabilities.firesTouchEvents && - e.fire("dblclick"); - }, 250))); - }, - _onDoubleClick: function () { - var t = this._map, - e = t._labels; - setTimeout(function () { - (t._clicked = 0), clearTimeout(t._clickTimeout); - }, 0), - e && - (1 === e.options.opacity - ? ((e.options.opacity = 0), e.setOpacity(0)) - : ((e.options.opacity = 1), e.setOpacity(1))); - }, - })), - L.Map.addInitHook( - "addHandler", - "doubleClickLabels", - L.Map.DoubleClickLabels - ); - }, - 752: function () { - L.Map.DoubleClickZoom.include({ - addHooks: function () { - this._map.on( - { click: this._fireIfSingle, dblclick: this._onDoubleClick }, - this - ); - }, - removeHooks: function () { - this._map.off( - { click: this._fireIfSingle, dblclick: this._onDoubleClick }, - this - ); - }, - enable: function () { - return ( - this._enabled || - (this._map.doubleClickLabels && - this._map.doubleClickLabels.enabled()) || - (this._map.fire("singleclickon"), - (this._enabled = !0), - this.addHooks()), - this - ); - }, - disable: function () { - return this._enabled - ? (this._map.fire("singleclickoff"), - (this._enabled = !1), - this.removeHooks(), - this) - : this; - }, - _fireIfSingle: function (t) { - var e = this._map, - i = t.originalEvent; - (i && i.shiftKey) || - ((e._clicked += 1), - (this._map._clickTimeout = setTimeout(function () { - 1 === e._clicked - ? ((e._clicked = 0), - e.fire("singleclick", { type: "singleclick" })) - : L.Browser.touch && - i && - i.sourceCapabilities.firesTouchEvents && - e._fireDOMEvent(i, "dblclick", [e]); - }, 250))); - }, - _onDoubleClick: function (t) { - var e = this._map, - i = t.originalEvent; - if ( - (setTimeout(function () { - (e._clicked = 0), clearTimeout(e._clickTimeout); - }, 0), - !i) - ) - return !1; - var o = e.getZoom(), - n = e.options.zoomDelta, - a = i.shiftKey ? o - n : o + n; - "center" === e.options.doubleClickZoom - ? e.setZoom(a) - : e.setZoomAround(t.containerPoint, a); - }, + } + + this.openTooltip(); + }, this), 500); + }, + _tooltipOff: function _tooltipOff(e) { + var eP = this._handled.parentGroup; + var edit = eP ? eP.editing : this._handled.editing; + + if (e.shiftKey) { + return; + } + + if (!this._handled.isSelected() && eP && !eP.isCollected(this._handled)) { + return; + } + + var handlesArr = edit._lockHandles; + + if (e.currentTarget === document) { + handlesArr.eachLayer(function (handle) { + handle.closeTooltip(); }); - }, - 131: function () { - L.Map.include({ - _clicked: 0, - addGoogleMutant: function (t) { - return ( - (t = this.mutantOptions = - L.extend( - { - mutantOpacity: 0.8, - maxZoom: 24, - maxNativeZoom: 20, - minZoom: 0, - labels: !0, - labelOpacity: 1, - doubleClickLabels: !0, - }, - t - )).labels || - (this.mutantOptions = L.extend(this.mutantOptions, { - labelOpacity: t.labels ? 1 : void 0, - doubleClickLabels: !!t.labels || void 0, - })), - (this._googleMutant = L.tileLayer( - "http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", - { - maxZoom: t.maxZoom, - maxNativeZoom: t.maxNativeZoom, - minZoom: t.minZoom, - opacity: t.mutantOpacity, - } - ).addTo(this)), - t.labels ? this._addLabels(t) : (this.doubleClickLabels = void 0), - this - ); - }, - _addLabels: function (t) { - return ( - 0 !== t.labelOpacity && - 1 !== t.labelOpacity && - (t.labelOpacity = 1), - (this._labels = L.tileLayer( - "https://stamen-tiles-{s}.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}{r}.{ext}", - { - attribution: - 'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors', - subdomains: "abcd", - interactive: !1, - opacity: t.labelOpacity, - maxZoom: t.maxZoom, - maxNativeZoom: t.maxNativeZoom, - minZoom: t.minZoom, - ext: "png", - } - ).addTo(this)), - this.mutantOptions.doubleClickLabels && - this.doubleClickLabels.enable(), - this - ); - }, - }), - L.Map.addInitHook(function () { - this.doubleClickLabels.disable(), this.doubleClickZoom.enable(); + } + + if (this._timer) { + clearTimeout(this._timer); + } + + this._timeout = setTimeout(L.bind(function () { + this.closeTooltip(); + }, this), 400); + } +}); + +L.lockHandle = function (overlay, idx, options) { + return new L.LockHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/handles/RotateHandle.js": +/*!******************************************!*\ + !*** ./src/edit/handles/RotateHandle.js ***! + \******************************************/ +/***/ (function() { + +L.RotateHandle = L.EditHandle.extend({ + options: { + TYPE: 'rotate', + icon: L.icon({ + iconUrl: // eslint-disable-next-line max-len + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAklEQVR4AewaftIAAAHiSURBVMXBa3HbShgA0PMp/1sCCo8oCEpgTaCXgIXAJiDzyCJoAUTm4UVQAns1Y8+snWnTvJyeE16hkjDgDrfoNTMKcpC9UPiLSo8JyetkjEHxjPCMyoS199kFoz8Iv1HpMaN3qWDCHoegOKkkRwnJpRmroHgiPFEZ8IBekzEGxQtUEhKSS/fB7Ew4U+lxcGkVZG9QWWPSFAxBcdK59KApuA+yNwp2uEdx1GN25sZJZULSfAtm77SlbNjju6MvG75u+WHRWVR6rDVjMPsgwYyVZl3pLTpHkyYHOx8syMiayaJzlDTZ9YyaZNFVkiYH2ZUEBcVJJXVImuz6Js3Qofe59pq7DoOTILu+g+a288mCouk7/1iH4qTS+2QdDppbV1ZJmrnDXnPnc5UOs2Z0fUmTuyBr+krvSioJyUmQO0dZM7mepMkWnaNRkyrJB6uskTSjxY3Fll8bvmJwlDb83FJ8gMqAB80uyBY3Trb82PAfvjj6vuHnluIdKgMeNXOwctK5NKBoHitrb1RJeHRp5Ux4ojLg0aWMHGQvUOkxIWkKVsHsTPiNSo8HDC5lZIsgO6n0uMUdRvQuFQxB8UR4RmXC2vvsgtEfhL+o9JiQvE7GGBTPCK9QSUjoMWgKDthjDrIX+h/k0I7gth6N5gAAAABJRU5ErkJggg==', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + _onHandleDrag: function _onHandleDrag() { + var overlay = this._handled; + var formerLatLng = overlay.getCorner(this._corner); + var newLatLng = this.getLatLng(); + var angle = this.calculateAngleDelta(formerLatLng, newLatLng); + /* + * running rotation logic even for an angle delta of 0 + * prevents a small, occasional marker flicker + */ + + overlay.rotateBy(angle, 'rad'); + }, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + } +}); + +L.rotateHandle = function (overlay, idx, options) { + return new L.RotateHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/handles/ScaleHandle.js": +/*!*****************************************!*\ + !*** ./src/edit/handles/ScaleHandle.js ***! + \*****************************************/ +/***/ (function() { + +L.ScaleHandle = L.EditHandle.extend({ + options: { + TYPE: 'scale', + icon: L.icon({ + iconUrl: // eslint-disable-next-line max-len + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0NTkiIGhlaWdodD0iNDY0IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iIj48cmVjdCBpZD0iYmFja2dyb3VuZHJlY3QiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHg9IjAiIHk9IjAiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgY2xhc3M9IiIgc3R5bGU9IiIvPjxnIGNsYXNzPSJjdXJyZW50TGF5ZXIiIHN0eWxlPSIiPjx0aXRsZT5MYXllciAxPC90aXRsZT48cGF0aCBkPSJNNDU5LjA0OTE1OTUzMDQ3MTM0LDg2LjkyNjIzNDUxMjU1MDAyIFYwIGgtODUuNzE0NTczMzU2MzEyMDkgdjI3LjA0MzcxNzQwMzkwNDQ1MiBIODUuNzE0NTczMzU2MzEyMDMgVjAgSDAgdjg2LjkyNjIzNDUxMjU1MDAyIGgyNS43MTQzNzIwMDY4OTM2MjYgdjI4OS43NTQxMTUwNDE4MzM0IEgwIHY4Ni45MjYyMzQ1MTI1NTAwMiBoODUuNzE0NTczMzU2MzEyMDkgdi0yNy4wNDM3MTc0MDM5MDQ0NTIgaDI4NS43MTUyNDQ1MjEwNDAzIHYyNy4wNDM3MTc0MDM5MDQ0NTIgaDg1LjcxNDU3MzM1NjMxMjA5IHYtODYuOTI2MjM0NTEyNTUwMDIgaC0yMy44MDk2MDM3MTAwODY2OSBWODYuOTI2MjM0NTEyNTUwMDIgSDQ1OS4wNDkxNTk1MzA0NzEzNCB6TTM4NC43NjMxOTU5NTUwMDA5LDEyLjU1NjAxMTY1MTgxMjc4MSBoNjEuOTA0OTY5NjQ2MjI1Mzk2IHY2Mi43ODAwNTgyNTkwNjM5MSBoLTYxLjkwNDk2OTY0NjIyNTM5NiBWMTIuNTU2MDExNjUxODEyNzgxIHpNMTIuMzgwOTkzOTI5MjQ1MDUsMTIuNTU2MDExNjUxODEyNzgxIGg2MS45MDQ5Njk2NDYyMjUzOTYgdjYyLjc4MDA1ODI1OTA2MzkxIEgxMi4zODA5OTM5MjkyNDUwNSBWMTIuNTU2MDExNjUxODEyNzgxIHpNNzQuMjg1OTYzNTc1NDcwNTMsNDUxLjA1MDU3MjQxNTEyMDY2IEgxMi4zODA5OTM5MjkyNDUwNSB2LTYyLjc4MDA1ODI1OTA2MzkxIGg2MS45MDQ5Njk2NDYyMjUzOTYgVjQ1MS4wNTA1NzI0MTUxMjA2NiB6TTQ0NS43MTU3ODE0NTI4MjI3NCw0NTEuMDUwNTcyNDE1MTIwNjYgaC02Mi44NTczNTM3OTQ2Mjg4NjQgdi02Mi43ODAwNTgyNTkwNjM5MSBoNjIuODU3MzUzNzk0NjI4ODY0IFY0NTEuMDUwNTcyNDE1MTIwNjYgek00MDcuNjIwNDE1NTE2Njg0MjYsMzc2LjY4MDM0OTU1NDM4MzQ0IGgtMzYuMTkwNTk3NjM5MzMxNzcgdjMyLjgzODc5OTcwNDc0MTEyIEg4NS43MTQ1NzMzNTYzMTIwMyB2LTMyLjgzODc5OTcwNDc0MTEyIEg0OS41MjM5NzU3MTY5ODAzMiBWODYuOTI2MjM0NTEyNTUwMDIgaDM2LjE5MDU5NzYzOTMzMTc3IFY1MC4yMjQwNDY2MDcyNTExMjUgaDI4Ny42MjAwMTI4MTc4NDcyIHYzNi43MDIxODc5MDUyOTg5IGgzNC4yODU4MjkzNDI1MjQ4MzUgVjM3Ni42ODAzNDk1NTQzODM0NCB6IiBpZD0ic3ZnXzIiIGNsYXNzPSIiIGZpbGw9IiMxYTFhZWIiIGZpbGwtb3BhY2l0eT0iMSIvPjwvZz48L3N2Zz4=', + iconSize: [32, 32], + iconAnchor: [16, 16] + }) + }, + _onHandleDrag: function _onHandleDrag() { + var overlay = this._handled; + var map = overlay._map; + var edgeMinWidth = overlay.edgeMinWidth; + var formerLatLng = overlay.getCorner(this._corner); + var newLatLng = this.getLatLng(); + + var scale = this._calculateScalingFactor(formerLatLng, newLatLng); + /* + * checks whether the "edgeMinWidth" property is set and tracks the minimum edge length; + * this enables preventing scaling to zero, but we might also add an overall scale limit + */ + + + if (!edgeMinWidth) { + edgeMinWidth = 50; + } + /* just in case */ + + + var corner1 = map.latLngToLayerPoint(overlay.getCorner(0)); + var corner2 = map.latLngToLayerPoint(overlay.getCorner(1)); + var w = Math.abs(corner1.x - corner2.x); + var h = Math.abs(corner1.y - corner2.y); + var distance = Math.sqrt(w * w + h * h); + + if (distance > edgeMinWidth || scale > 1) { + overlay.scaleBy(scale); + /* + * running scale logic even for a scale ratio of 1 + * prevents a small, occasional marker flicker + */ + } else { + overlay.scaleBy(1); + } + }, + updateHandle: function updateHandle() { + this.setLatLng(this._handled.getCorner(this._corner)); + } +}); + +L.scaleHandle = function (overlay, idx, options) { + return new L.ScaleHandle(overlay, idx, options); +}; + +/***/ }), + +/***/ "./src/edit/toolbars/DistortableImage.ControlBar.js": +/*!**********************************************************!*\ + !*** ./src/edit/toolbars/DistortableImage.ControlBar.js ***! + \**********************************************************/ +/***/ (function() { + +L.distortableImage = L.DistortableImage || {}; +L.distortableImage = L.DistortableImage; +L.DistortableImage.group_action_map = {}; +L.DistortableImage.ControlBar = L.Toolbar2.Control.extend({}); + +L.distortableImage.controlBar = function (options) { + return new L.DistortableImage.ControlBar(options); +}; +/** addInitHooks run before onAdd */ + + +L.DistortableCollection.addInitHook(function () { + /** Default actions */ + this.ACTIONS = [L.ExportAction, L.DeleteAction, L.LockAction, L.UnlockAction]; // all possible modes + + L.DistortableCollection.Edit.MODES = { + lock: L.LockAction, + unlock: L.UnlockAction + }; + var a = this.options.actions ? this.options.actions : this.ACTIONS; + this.editing = L.distortableCollection.edit(this, { + actions: a + }); +}); + +/***/ }), + +/***/ "./src/edit/toolbars/DistortableImage.PopupBar.js": +/*!********************************************************!*\ + !*** ./src/edit/toolbars/DistortableImage.PopupBar.js ***! + \********************************************************/ +/***/ (function() { + +L.DistortableImage = L.DistortableImage || {}; +L.distortableImage = L.DistortableImage; +L.DistortableImage.action_map = {}; +L.DistortableImage.PopupBar = L.Toolbar2.Popup.extend({ + options: { + anchor: [0, -10] + }, + initialize: function initialize(latlng, options) { + L.setOptions(this, options); + L.Toolbar2.Popup.prototype.initialize.call(this, latlng, options); + }, + addHooks: function addHooks(map, ov) { + this.map = map; + this.ov = ov; + }, + tools: function tools() { + if (this._ul) { + return this._ul.children; + } + }, + clickTool: function clickTool(name) { + var tools = this.tools(); + + for (var i = 0; i < tools.length; i++) { + var tool = tools.item(i).children[0]; + + if (L.DomUtil.hasClass(tool, name)) { + tool.click(); + return tool; + } + } + + return false; + } +}); + +L.distortableImage.popupBar = function (latlng, options) { + return new L.DistortableImage.PopupBar(latlng, options); +}; + +L.DistortableImageOverlay.addInitHook(function () { + /** Default actions */ + this.ACTIONS = [L.DragAction, L.ScaleAction, L.DistortAction, L.RotateAction, L.FreeRotateAction, L.LockAction, L.OpacityAction, L.BorderAction, L.ExportAction, L.DeleteAction]; // all possible modes + + L.DistortableImage.Edit.MODES = { + drag: L.DragAction, + scale: L.ScaleAction, + distort: L.DistortAction, + rotate: L.RotateAction, + freeRotate: L.FreeRotateAction, + lock: L.LockAction + }; + var a = this.options.actions ? this.options.actions : this.ACTIONS; + this.editing = L.distortableImage.edit(this, { + actions: a + }); +}); + +/***/ }), + +/***/ "./src/iconsets/IconSet.js": +/*!*********************************!*\ + !*** ./src/iconsets/IconSet.js ***! + \*********************************/ +/***/ (function() { + +/* this is the baseclass other IconSets inherit from, +* we don't use it directly */ +L.IconSet = L.Class.extend({ + _svg: '', + _symbols: '', + render: function render() { + this.addSymbols(this._symbols); + return this._svg; + }, + addSymbols: function addSymbols(symbols) { + this._svg += symbols; + } +}); + +/***/ }), + +/***/ "./src/iconsets/KeymapperIconSet.js": +/*!******************************************!*\ + !*** ./src/iconsets/KeymapperIconSet.js ***! + \******************************************/ +/***/ (function() { + +L.KeymapperIconSet = L.IconSet.extend({ + _symbols: // eslint-disable-next-line max-len + '' +}); + +/***/ }), + +/***/ "./src/iconsets/ToolbarIconSet.js": +/*!****************************************!*\ + !*** ./src/iconsets/ToolbarIconSet.js ***! + \****************************************/ +/***/ (function() { + +/* eslint-disable max-len */ +L.ToolbarIconSet = L.IconSet.extend({ + _symbols: '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' +}); + +/***/ }), + +/***/ "./src/mapmixins/BoxCollector.js": +/*!***************************************!*\ + !*** ./src/mapmixins/BoxCollector.js ***! + \***************************************/ +/***/ (function() { + +L.Map.mergeOptions({ + boxCollector: true, + boxZoom: false +}); +/** + * primarily Leaflet 1.5.1 source code. Overriden so that it's a collection box used with + * our `L.DistortableCollection` class instead of a zoom box. + * */ + +L.Map.BoxCollector = L.Map.BoxZoom.extend({ + initialize: function initialize(map) { + this._map = map; + this._container = map._container; + this._pane = map._panes.overlayPane; + this._resetStateTimeout = 0; + map.on('unload', this._destroy, this); + }, + addHooks: function addHooks() { + L.DomEvent.on(this._container, 'mousedown', this._onMouseDown, this); + }, + removeHooks: function removeHooks() { + L.DomEvent.off(this._container, 'mousedown', this._onMouseDown, this); + }, + moved: function moved() { + return this._moved; + }, + _destroy: function _destroy() { + L.DomUtil.remove(this._pane); + delete this._pane; + }, + _resetState: function _resetState() { + this._resetStateTimeout = 0; + this._moved = false; + }, + _clearDeferredResetState: function _clearDeferredResetState() { + if (this._resetStateTimeout !== 0) { + clearTimeout(this._resetStateTimeout); + this._resetStateTimeout = 0; + } + }, + _onMouseDown: function _onMouseDown(e) { + if (!e.shiftKey || e.which !== 1 && e.button !== 1) { + return false; + } // Clear the deferred resetState if it hasn't executed yet, otherwise it + // will interrupt the interaction and orphan a box element in the container. + + + this._clearDeferredResetState(); + + this._resetState(); + + L.DomUtil.disableTextSelection(); + L.DomUtil.disableImageDrag(); + this._startPoint = this._map.mouseEventToContainerPoint(e); + L.DomEvent.on(document, { + contextmenu: L.DomEvent.stop, + mousemove: this._onMouseMove, + mouseup: this._onMouseUp + }, this); + }, + _onMouseMove: function _onMouseMove(e) { + if (!this._moved) { + this._moved = true; + this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._container); + L.DomUtil.addClass(this._container, 'leaflet-crosshair'); + + this._map.fire('boxzoomstart'); + } + + this._point = this._map.mouseEventToContainerPoint(e); + this._bounds = L.bounds(this._startPoint, this._point); + + var size = this._bounds.getSize(); + + L.DomUtil.setPosition(this._box, this._bounds.min); + this._box.style.width = size.x + 'px'; + this._box.style.height = size.y + 'px'; + }, + _finish: function _finish() { + if (this._moved) { + L.DomUtil.remove(this._box); + L.DomUtil.removeClass(this._container, 'leaflet-crosshair'); + } + + L.DomUtil.enableTextSelection(); + L.DomUtil.enableImageDrag(); + L.DomEvent.off(document, { + contextmenu: L.DomEvent.stop, + mousemove: this._onMouseMove, + mouseup: this._onMouseUp + }, this); + }, + _onMouseUp: function _onMouseUp(e) { + if (e.which !== 1 && e.button !== 1) { + return; + } + + this._finish(); + + if (!this._moved) { + return; + } // Postpone to next JS tick so internal click event handling + // still see it as "moved". + + + this._clearDeferredResetState(); + + this._resetStateTimeout = setTimeout(L.Util.bind(this._resetState, this), 0); + var bounds = L.latLngBounds(this._map.containerPointToLatLng(this._bounds.getBottomLeft()), this._map.containerPointToLatLng(this._bounds.getTopRight())); + + var zoom = this._map.getZoom(); + + var center = this._map.getCenter(); // calls the `project` method but 1st updates the pixel origin - see https://github.com/publiclab/Leaflet.DistortableImage/pull/344 + + + bounds = this._map._latLngBoundsToNewLayerBounds(bounds, zoom, center); + + this._map.fire('boxcollectend', { + boxCollectBounds: bounds + }); + } +}); +L.Map.addInitHook('addHandler', 'boxCollector', L.Map.BoxCollector); + +/***/ }), + +/***/ "./src/mapmixins/DoubleClickLabels.js": +/*!********************************************!*\ + !*** ./src/mapmixins/DoubleClickLabels.js ***! + \********************************************/ +/***/ (function() { + +L.Map.mergeOptions({ + doubleClickLabels: true +}); +/** + * The `doubleClickLabels` handler replaces `doubleClickZoom` by default if `#addGoogleMutant` + * is used unless the options 'labels: false' or 'doubleClickZoom: false` were passed to it. + */ + +L.Map.DoubleClickLabels = L.Map.DoubleClickZoom.extend({ + enable: function enable() { + var map = this._map; + + if (this._enabled) { + return this; + } // disable 'doubleClickZoom' if 'doubleClickLabels' is enabled. + + + if (map.doubleClickZoom.enabled()) { + map.doubleClickZoom.disable(); + } + + this._map.fire('singleclickon'); + + this._enabled = true; + this.addHooks(); + return this; + }, + disable: function disable() { + if (!this._enabled) { + return this; + } + + this._enabled = false; + this.removeHooks(); + return this; + }, + _fireIfSingle: function _fireIfSingle(e) { + var map = this._map; + var oe = e.originalEvent; // prevents deselection in case of box selector + + if (oe && oe.shiftKey) { + return; + } + + map._clicked += 1; + this._map._clickTimeout = setTimeout(function () { + if (map._clicked === 1) { + map._clicked = 0; + map.fire('singleclick', { + type: 'singleclick' }); - }, - 999: function () { - L.DomUtil = L.extend(L.DomUtil, { - initTranslation: function (t) { - this.translation = t; - }, - getMatrixString: function (t) { - var e = L.Browser.webkit3d || L.Browser.gecko3d || L.Browser.ie3d, - i = [ - t[0], - t[3], - 0, - t[6], - t[1], - t[4], - 0, - t[7], - 0, - 0, - 1, - 0, - t[2], - t[5], - 0, - t[8], - ], - o = e ? "matrix3d(" + i.join(",") + ")" : ""; - return ( - e || - console.log( - "Your browser must support 3D CSS transformsin order to use DistortableImageOverlay." - ), - o - ); - }, - toggleClass: function (t, e) { - var i = e; - return this.hasClass(t, i) - ? this.removeClass(t, i) - : this.addClass(t, i); - }, - confirmDelete: function () { - return window.confirm(this.translation.confirmImageDelete); - }, - confirmDeletes: function (t) { - if (1 === t) return this.confirmDelete(); - var e, - i = this.translation.confirmImagesDeletes; - return (e = "function" == typeof i ? i(t) : i), window.confirm(e); - }, + } else { + // manually fire doubleclick event only for touch screens that don't natively fire it + if (L.Browser.touch && oe && oe.sourceCapabilities.firesTouchEvents) { + map.fire('dblclick'); + } + } + }, 250); + }, + _onDoubleClick: function _onDoubleClick() { + var map = this._map; + var labels = map._labels; + setTimeout(function () { + map._clicked = 0; + clearTimeout(map._clickTimeout); + }, 0); + + if (!labels) { + return; + } + + if (labels.options.opacity === 1) { + labels.options.opacity = 0; + labels.setOpacity(0); + } else { + labels.options.opacity = 1; + labels.setOpacity(1); + } + } +}); +L.Map.addInitHook('addHandler', 'doubleClickLabels', L.Map.DoubleClickLabels); + +/***/ }), + +/***/ "./src/mapmixins/DoubleClickZoom.js": +/*!******************************************!*\ + !*** ./src/mapmixins/DoubleClickZoom.js ***! + \******************************************/ +/***/ (function() { + +/** + * `L.Map.DoubleClickZoom` from leaflet 1.5.1, overrwritten so that it + * 1) Fires a `singleclick` event to avoid deselecting images on `dblclick`. + * 2) Maintains a mutually exclusive relationship with the map's `DoubleClickLabels` handler + */ +L.Map.DoubleClickZoom.include({ + addHooks: function addHooks() { + this._map.on({ + click: this._fireIfSingle, + dblclick: this._onDoubleClick + }, this); + }, + removeHooks: function removeHooks() { + this._map.off({ + click: this._fireIfSingle, + dblclick: this._onDoubleClick + }, this); + }, + enable: function enable() { + if (this._enabled) { + return this; + } // don't enable 'doubleClickZoom' unless 'doubleClickLabels' is disabled first + + + if (this._map.doubleClickLabels) { + if (this._map.doubleClickLabels.enabled()) { + return this; + } + } // signify to collection/instance classes to turn on 'singleclick' listeners + + + this._map.fire('singleclickon'); + + this._enabled = true; + this.addHooks(); + return this; + }, + disable: function disable() { + if (!this._enabled) { + return this; + } // signify to collection/instance safe to swap 'singleclick' listeners with 'click' listeners. + + + this._map.fire('singleclickoff'); + + this._enabled = false; + this.removeHooks(); + return this; + }, + _fireIfSingle: function _fireIfSingle(e) { + var map = this._map; + var oe = e.originalEvent; // prevents deselection in case of box selector + + if (oe && oe.shiftKey) { + return; + } + + map._clicked += 1; + this._map._clickTimeout = setTimeout(function () { + if (map._clicked === 1) { + map._clicked = 0; + map.fire('singleclick', { + type: 'singleclick' + }); + } else { + // manually fire doubleclick event only for touch screens that don't natively fire it + if (L.Browser.touch && oe && oe.sourceCapabilities.firesTouchEvents) { + // in `DoubleClickLabels.js`, we just do map.fire('dblclick') bc `_onDoublClick` doesn't use the + // passed "e" (for now). To generate a 'real' DOM event that will have all of its corresponding core + // properties (originalEvent, latlng, etc.), use Leaflet's `#map._fireDOMEvent` (Leaflet 1.5.1 source) + map._fireDOMEvent(oe, 'dblclick', [map]); + } + } + }, 250); + }, + _onDoubleClick: function _onDoubleClick(e) { + var map = this._map; + var oe = e.originalEvent; + setTimeout(function () { + map._clicked = 0; + clearTimeout(map._clickTimeout); + }, 0); + + if (!oe) { + return false; + } + + var oldZoom = map.getZoom(); + var delta = map.options.zoomDelta; + var zoom = oe.shiftKey ? oldZoom - delta : oldZoom + delta; + + if (map.options.doubleClickZoom === 'center') { + map.setZoom(zoom); + } else { + map.setZoomAround(e.containerPoint, zoom); + } + } +}); + +/***/ }), + +/***/ "./src/mapmixins/MapMixins.js": +/*!************************************!*\ + !*** ./src/mapmixins/MapMixins.js ***! + \************************************/ +/***/ (function() { + +/* eslint-disable max-len */ +L.Map.include({ + _clicked: 0, + addGoogleMutant: function addGoogleMutant(opts) { + var url = 'http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}'; + opts = this.mutantOptions = L.extend({ + mutantOpacity: 0.8, + maxZoom: 24, + maxNativeZoom: 20, + minZoom: 0, + labels: true, + labelOpacity: 1, + doubleClickLabels: true + }, opts); + + if (!opts.labels) { + this.mutantOptions = L.extend(this.mutantOptions, { + labelOpacity: opts.labels ? 1 : undefined, + doubleClickLabels: opts.labels ? true : undefined }); - }, - 85: function () { - L.IconUtil = { - create: function (t) { - return ( - /^#/.test(t) && (t = t.replace(/^#/, "")), - '' - ); - }, - addClassToSvg: function (t, e) { - var i = t.querySelector("svg"); - i && L.DomUtil.addClass(i, e); - }, - toggleXlink: function (t, e, i) { - /^#/.test(e) || (e = "#" + e), /^#/.test(i) || (i = "#" + i); - var o = t.querySelector("use"); - if (o) { - var n = o.getAttribute("xlink:href") === e ? i : e; - return o.setAttribute("xlink:href", n), n; + } + + this._googleMutant = L.tileLayer(url, { + maxZoom: opts.maxZoom, + maxNativeZoom: opts.maxNativeZoom, + minZoom: opts.minZoom, + opacity: opts.mutantOpacity + }).addTo(this); + + if (opts.labels) { + this._addLabels(opts); + } // shouldn't have this handler at all if there are no labels to toggle + else { + this.doubleClickLabels = undefined; + } + + return this; + }, + _addLabels: function _addLabels(opts) { + var url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}{r}.{ext}'; + + if (opts.labelOpacity !== 0 && opts.labelOpacity !== 1) { + opts.labelOpacity = 1; + } + + this._labels = L.tileLayer(url, { + attribution: 'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors', + subdomains: 'abcd', + interactive: false, + opacity: opts.labelOpacity, + maxZoom: opts.maxZoom, + maxNativeZoom: opts.maxNativeZoom, + minZoom: opts.minZoom, + ext: 'png' + }).addTo(this); + + if (this.mutantOptions.doubleClickLabels) { + this.doubleClickLabels.enable(); + } + + return this; + } +}); // start off with doubleClickZoom enabled, doubleClickLabels can later be enabled instead +// during initialization + +L.Map.addInitHook(function () { + this.doubleClickLabels.disable(); + this.doubleClickZoom.enable(); +}); + +/***/ }), + +/***/ "./src/util/DomUtil.js": +/*!*****************************!*\ + !*** ./src/util/DomUtil.js ***! + \*****************************/ +/***/ (function() { + +L.DomUtil = L.extend(L.DomUtil, { + initTranslation: function initTranslation(obj) { + this.translation = obj; + }, + getMatrixString: function getMatrixString(m) { + var is3d = L.Browser.webkit3d || L.Browser.gecko3d || L.Browser.ie3d; + /* + * Since matrix3d takes a 4*4 matrix, we add in an empty row and column, + * which act as the identity on the z-axis. + * See: + * http://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/ + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#M.C3.B6bius'_homogeneous_coordinates_in_projective_geometry + */ + + var matrix = [m[0], m[3], 0, m[6], m[1], m[4], 0, m[7], 0, 0, 1, 0, m[2], m[5], 0, m[8]]; + var str = is3d ? 'matrix3d(' + matrix.join(',') + ')' : ''; + + if (!is3d) { + console.log('Your browser must support 3D CSS transforms' + 'in order to use DistortableImageOverlay.'); + } + + return str; + }, + toggleClass: function toggleClass(el, className) { + var c = className; + return this.hasClass(el, c) ? this.removeClass(el, c) : this.addClass(el, c); + }, + confirmDelete: function confirmDelete() { + return window.confirm(this.translation.confirmImageDelete); + }, + confirmDeletes: function confirmDeletes(n) { + if (n === 1) { + return this.confirmDelete(); + } + + var translation = this.translation.confirmImagesDeletes; + var warningMsg = ''; + + if (typeof translation === 'function') { + warningMsg = translation(n); + } else { + warningMsg = translation; + } + + return window.confirm(warningMsg); + } +}); + +/***/ }), + +/***/ "./src/util/IconUtil.js": +/*!******************************!*\ + !*** ./src/util/IconUtil.js ***! + \******************************/ +/***/ (function() { + +L.IconUtil = { + /* creates an svg elemenet with built in accessibility properties + * and standardized classes for styling, takes in the fragment + * identifier (id) of the symbol to reference. note for symplicity + * we allow providing the icon target with or without the '#' prefix + */ + create: function create(ref) { + if (/^#/.test(ref)) { + ref = ref.replace(/^#/, ''); + } + + return '' + '' + ''; + }, + addClassToSvg: function addClassToSvg(container, loader) { + var svg = container.querySelector('svg'); + + if (svg) { + L.DomUtil.addClass(svg, loader); + } + }, + // finds the use element and toggles its icon reference + toggleXlink: function toggleXlink(container, ref1, ref2) { + if (!/^#/.test(ref1)) { + ref1 = '#' + ref1; + } + + if (!/^#/.test(ref2)) { + ref2 = '#' + ref2; + } + + var use = container.querySelector('use'); + + if (use) { + var toggled = use.getAttribute('xlink:href') === ref1 ? ref2 : ref1; + use.setAttribute('xlink:href', toggled); + return toggled; + } + + return false; + }, + toggleTitle: function toggleTitle(container, title1, title2) { + var toggled = container.getAttribute('title') === title1 ? title2 : title1; + container.setAttribute('title', toggled); + + if (container.hasAttribute('aria-label')) { + container.setAttribute('aria-label', toggled); + } + + return toggled; + } +}; + +/***/ }), + +/***/ "./src/util/ImageUtil.js": +/*!*******************************!*\ + !*** ./src/util/ImageUtil.js ***! + \*******************************/ +/***/ (function() { + +L.ImageUtil = { + getCmPerPixel: function getCmPerPixel(overlay) { + var map = overlay._map; + var dist = map.latLngToLayerPoint(overlay.getCorner(0)).distanceTo(map.latLngToLayerPoint(overlay.getCorner(1))); + return dist * 100 / overlay.getElement().width; + } +}; + +/***/ }), + +/***/ "./src/util/MatrixUtil.js": +/*!********************************!*\ + !*** ./src/util/MatrixUtil.js ***! + \********************************/ +/***/ (function() { + +L.MatrixUtil = { + // Compute the adjugate of m + adj: function adj(m) { + return [m[4] * m[8] - m[5] * m[7], m[2] * m[7] - m[1] * m[8], m[1] * m[5] - m[2] * m[4], m[5] * m[6] - m[3] * m[8], m[0] * m[8] - m[2] * m[6], m[2] * m[3] - m[0] * m[5], m[3] * m[7] - m[4] * m[6], m[1] * m[6] - m[0] * m[7], m[0] * m[4] - m[1] * m[3]]; + }, + // multiply two 3*3 matrices + multmm: function multmm(a, b) { + var c = []; + var i; + + for (i = 0; i < 3; i++) { + for (var j = 0; j < 3; j++) { + var cij = 0; + + for (var k = 0; k < 3; k++) { + cij += a[3 * i + k] * b[3 * k + j]; + } + + c[3 * i + j] = cij; + } + } + + return c; + }, + // multiply a 3*3 matrix and a 3-vector + multmv: function multmv(m, v) { + return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]]; + }, + // multiply a scalar and a 3*3 matrix + multsm: function multsm(s, m) { + var matrix = []; + + for (var i = 0, l = m.length; i < l; i++) { + matrix.push(s * m[i]); + } + + return matrix; + }, + basisToPoints: function basisToPoints(x1, y1, x2, y2, x3, y3, x4, y4) { + var m = [x1, x2, x3, y1, y2, y3, 1, 1, 1]; + var v = L.MatrixUtil.multmv(L.MatrixUtil.adj(m), [x4, y4, 1]); + return L.MatrixUtil.multmm(m, [v[0], 0, 0, 0, v[1], 0, 0, 0, v[2]]); + }, + project: function project(m, x, y) { + var v = L.MatrixUtil.multmv(m, [x, y, 1]); + return [v[0] / v[2], v[1] / v[2]]; + }, + general2DProjection: function general2DProjection(x1s, y1s, x1d, y1d, x2s, y2s, x2d, y2d, x3s, y3s, x3d, y3d, x4s, y4s, x4d, y4d) { + var s = L.MatrixUtil.basisToPoints(x1s, y1s, x2s, y2s, x3s, y3s, x4s, y4s); + var d = L.MatrixUtil.basisToPoints(x1d, y1d, x2d, y2d, x3d, y3d, x4d, y4d); + var m = L.MatrixUtil.multmm(d, L.MatrixUtil.adj(s)); // Normalize to the unique matrix with m[8] == 1. + // See: http://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/ + + return L.MatrixUtil.multsm(1 / m[8], m); + } +}; + +/***/ }), + +/***/ "./src/util/TrigUtil.js": +/*!******************************!*\ + !*** ./src/util/TrigUtil.js ***! + \******************************/ +/***/ (function() { + +L.TrigUtil = { + calcAngle: function calcAngle(x, y) { + var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'deg'; + return unit === 'deg' ? this.radiansToDegrees(Math.atan2(y, x)) : Math.atan2(y, x); + }, + radiansToDegrees: function radiansToDegrees(angle) { + return angle * 180 / Math.PI; + }, + degreesToRadians: function degreesToRadians(angle) { + return angle * Math.PI / 180; + } +}; + +/***/ }), + +/***/ "./src/util/Utils.js": +/*!***************************!*\ + !*** ./src/util/Utils.js ***! + \***************************/ +/***/ (function() { + +L.Utils = { + initTranslation: function initTranslation() { + var translation = { + deleteImage: 'Delete Image', + deleteImages: 'Delete Images', + distortImage: 'Distort Image', + dragImage: 'Drag Image', + exportImage: 'Export Image', + exportImages: 'Export Images', + removeBorder: 'Remove Border', + addBorder: 'Add Border', + freeRotateImage: 'Free rotate Image', + geolocateImage: 'Geolocate Image', + lockMode: 'Lock Mode', + lockImages: 'Lock Images', + makeImageOpaque: 'Make Image Opaque', + makeImageTransparent: 'Make Image Transparent', + restoreImage: 'Restore Natural Image', + rotateImage: 'Rotate Image', + scaleImage: 'Scale Image', + stackToFront: 'Stack to Front', + stackToBack: 'Stack to Back', + unlockImages: 'Unlock Images', + confirmImageDelete: 'Are you sure? This image will be permanently deleted from the map.', + confirmImagesDeletes: 'Are you sure? These images will be permanently deleted from the map.' + }; + + if (!this.options.translation) { + this.options.translation = translation; + } else { + // If the translation for a word is not specified, fallback to English. + for (var key in translation) { + if (!this.options.translation.hasOwnProperty(key)) { + this.options.translation[key] = translation[key]; + } + } + } + + L.DomUtil.initTranslation(this.options.translation); + }, + getNestedVal: function getNestedVal(obj, key, nestedKey) { + var dig = [key, nestedKey]; + return dig.reduce(function (obj, k) { + return obj && obj[k]; + }, obj); + } +}; + +/***/ }), + +/***/ "./node_modules/events/events.js": +/*!***************************************!*\ + !*** ./node_modules/events/events.js ***! + \***************************************/ +/***/ (function(module) { + +"use strict"; +// 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. + + + +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} + +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} + +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; +module.exports.once = once; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +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. +var defaultMaxListeners = 10; + +function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } +} + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); + +EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +}; + +// 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 setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; + +function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; + +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; } - return !1; - }, - toggleTitle: function (t, e, i) { - var o = t.getAttribute("title") === e ? i : e; - return ( - t.setAttribute("title", o), - t.hasAttribute("aria-label") && t.setAttribute("aria-label", o), - o - ); - }, - }; - }, - 351: function () { - L.ImageUtil = { - getCmPerPixel: function (t) { - var e = t._map; - return ( - (100 * - e - .latLngToLayerPoint(t.getCorner(0)) - .distanceTo(e.latLngToLayerPoint(t.getCorner(1)))) / - t.getElement().width - ); - }, - }; - }, - 360: function () { - L.MatrixUtil = { - adj: function (t) { - return [ - t[4] * t[8] - t[5] * t[7], - t[2] * t[7] - t[1] * t[8], - t[1] * t[5] - t[2] * t[4], - t[5] * t[6] - t[3] * t[8], - t[0] * t[8] - t[2] * t[6], - t[2] * t[3] - t[0] * t[5], - t[3] * t[7] - t[4] * t[6], - t[1] * t[6] - t[0] * t[7], - t[0] * t[4] - t[1] * t[3], - ]; - }, - multmm: function (t, e) { - var i, - o = []; - for (i = 0; i < 3; i++) - for (var n = 0; n < 3; n++) { - for (var a = 0, s = 0; s < 3; s++) - a += t[3 * i + s] * e[3 * s + n]; - o[3 * i + n] = a; + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + }; + + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); +} + +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } +} + +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } +} + + +/***/ }), + +/***/ "./node_modules/html-entities/lib/index.js": +/*!*************************************************!*\ + !*** ./node_modules/html-entities/lib/index.js ***! + \*************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +var named_references_1 = __webpack_require__(/*! ./named-references */ "./node_modules/html-entities/lib/named-references.js"); +var numeric_unicode_map_1 = __webpack_require__(/*! ./numeric-unicode-map */ "./node_modules/html-entities/lib/numeric-unicode-map.js"); +var surrogate_pairs_1 = __webpack_require__(/*! ./surrogate-pairs */ "./node_modules/html-entities/lib/surrogate-pairs.js"); +var allNamedReferences = __assign(__assign({}, named_references_1.namedReferences), { all: named_references_1.namedReferences.html5 }); +var encodeRegExps = { + specialChars: /[<>'"&]/g, + nonAscii: /(?:[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, + nonAsciiPrintable: /(?:[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, + extensive: /(?:[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g +}; +var defaultEncodeOptions = { + mode: 'specialChars', + level: 'all', + numeric: 'decimal' +}; +/** Encodes all the necessary (specified by `level`) characters in the text */ +function encode(text, _a) { + var _b = _a === void 0 ? defaultEncodeOptions : _a, _c = _b.mode, mode = _c === void 0 ? 'specialChars' : _c, _d = _b.numeric, numeric = _d === void 0 ? 'decimal' : _d, _e = _b.level, level = _e === void 0 ? 'all' : _e; + if (!text) { + return ''; + } + var encodeRegExp = encodeRegExps[mode]; + var references = allNamedReferences[level].characters; + var isHex = numeric === 'hexadecimal'; + encodeRegExp.lastIndex = 0; + var _b = encodeRegExp.exec(text); + var _c; + if (_b) { + _c = ''; + var _d = 0; + do { + if (_d !== _b.index) { + _c += text.substring(_d, _b.index); } - return o; - }, - multmv: function (t, e) { - return [ - t[0] * e[0] + t[1] * e[1] + t[2] * e[2], - t[3] * e[0] + t[4] * e[1] + t[5] * e[2], - t[6] * e[0] + t[7] * e[1] + t[8] * e[2], - ]; - }, - multsm: function (t, e) { - for (var i = [], o = 0, n = e.length; o < n; o++) i.push(t * e[o]); - return i; - }, - basisToPoints: function (t, e, i, o, n, a, s, r) { - var l = [t, i, n, e, o, a, 1, 1, 1], - c = L.MatrixUtil.multmv(L.MatrixUtil.adj(l), [s, r, 1]); - return L.MatrixUtil.multmm(l, [c[0], 0, 0, 0, c[1], 0, 0, 0, c[2]]); - }, - project: function (t, e, i) { - var o = L.MatrixUtil.multmv(t, [e, i, 1]); - return [o[0] / o[2], o[1] / o[2]]; - }, - general2DProjection: function ( - t, - e, - i, - o, - n, - a, - s, - r, - l, - c, - d, - h, - g, - m, - u, - p - ) { - var _ = L.MatrixUtil.basisToPoints(t, e, n, a, l, c, g, m), - v = L.MatrixUtil.basisToPoints(i, o, s, r, d, h, u, p), - f = L.MatrixUtil.multmm(v, L.MatrixUtil.adj(_)); - return L.MatrixUtil.multsm(1 / f[8], f); - }, - }; + var _e = _b[0]; + var result_1 = references[_e]; + if (!result_1) { + var code_1 = _e.length > 1 ? surrogate_pairs_1.getCodePoint(_e, 0) : _e.charCodeAt(0); + result_1 = (isHex ? '&#x' + code_1.toString(16) : '&#' + code_1) + ';'; + } + _c += result_1; + _d = _b.index + _e.length; + } while ((_b = encodeRegExp.exec(text))); + if (_d !== text.length) { + _c += text.substring(_d); + } + } + else { + _c = + text; + } + return _c; +} +exports.encode = encode; +var defaultDecodeOptions = { + scope: 'body', + level: 'all' +}; +var strict = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g; +var attribute = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g; +var baseDecodeRegExps = { + xml: { + strict: strict, + attribute: attribute, + body: named_references_1.bodyRegExps.xml }, - 682: function () { - L.TrigUtil = { - calcAngle: function (t, e) { - var i = - arguments.length > 2 && void 0 !== arguments[2] - ? arguments[2] - : "deg"; - return "deg" === i - ? this.radiansToDegrees(Math.atan2(e, t)) - : Math.atan2(e, t); - }, - radiansToDegrees: function (t) { - return (180 * t) / Math.PI; - }, - degreesToRadians: function (t) { - return (t * Math.PI) / 180; - }, - }; + html4: { + strict: strict, + attribute: attribute, + body: named_references_1.bodyRegExps.html4 }, - 866: function () { - L.Utils = { - initTranslation: function () { - var t = { - deleteImage: "Delete Image", - deleteImages: "Delete Images", - distortImage: "Distort Image", - dragImage: "Drag Image", - exportImage: "Export Image", - exportImages: "Export Images", - removeBorder: "Remove Border", - addBorder: "Add Border", - freeRotateImage: "Free rotate Image", - geolocateImage: "Geolocate Image", - lockMode: "Lock Mode", - lockImages: "Lock Images", - makeImageOpaque: "Make Image Opaque", - makeImageTransparent: "Make Image Transparent", - restoreImage: "Restore Natural Image", - rotateImage: "Rotate Image", - scaleImage: "Scale Image", - stackToFront: "Stack to Front", - stackToBack: "Stack to Back", - unlockImages: "Unlock Images", - confirmImageDelete: - "Are you sure? This image will be permanently deleted from the map.", - confirmImagesDeletes: - "Are you sure? These images will be permanently deleted from the map.", - }; - if (this.options.translation) - for (var e in t) - this.options.translation.hasOwnProperty(e) || - (this.options.translation[e] = t[e]); - else this.options.translation = t; - L.DomUtil.initTranslation(this.options.translation); - }, - getNestedVal: function (t, e, i) { - return [e, i].reduce(function (t, e) { - return t && t[e]; - }, t); - }, + html5: { + strict: strict, + attribute: attribute, + body: named_references_1.bodyRegExps.html5 + } +}; +var decodeRegExps = __assign(__assign({}, baseDecodeRegExps), { all: baseDecodeRegExps.html5 }); +var fromCharCode = String.fromCharCode; +var outOfBoundsChar = fromCharCode(65533); +var defaultDecodeEntityOptions = { + level: 'all' +}; +/** Decodes a single entity */ +function decodeEntity(entity, _a) { + var _b = (_a === void 0 ? defaultDecodeEntityOptions : _a).level, level = _b === void 0 ? 'all' : _b; + if (!entity) { + return ''; + } + var _b = entity; + var decodeEntityLastChar_1 = entity[entity.length - 1]; + if (false) {} + else if (false) {} + else { + var decodeResultByReference_1 = allNamedReferences[level].entities[entity]; + if (decodeResultByReference_1) { + _b = decodeResultByReference_1; + } + else if (entity[0] === '&' && entity[1] === '#') { + var decodeSecondChar_1 = entity[2]; + var decodeCode_1 = decodeSecondChar_1 == 'x' || decodeSecondChar_1 == 'X' + ? parseInt(entity.substr(3), 16) + : parseInt(entity.substr(2)); + _b = + decodeCode_1 >= 0x10ffff + ? outOfBoundsChar + : decodeCode_1 > 65535 + ? surrogate_pairs_1.fromCodePoint(decodeCode_1) + : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_1] || decodeCode_1); + } + } + return _b; +} +exports.decodeEntity = decodeEntity; +/** Decodes all entities in the text */ +function decode(text, _a) { + var decodeSecondChar_1 = _a === void 0 ? defaultDecodeOptions : _a, decodeCode_1 = decodeSecondChar_1.level, level = decodeCode_1 === void 0 ? 'all' : decodeCode_1, _b = decodeSecondChar_1.scope, scope = _b === void 0 ? level === 'xml' ? 'strict' : 'body' : _b; + if (!text) { + return ''; + } + var decodeRegExp = decodeRegExps[level][scope]; + var references = allNamedReferences[level].entities; + var isAttribute = scope === 'attribute'; + var isStrict = scope === 'strict'; + decodeRegExp.lastIndex = 0; + var replaceMatch_1 = decodeRegExp.exec(text); + var replaceResult_1; + if (replaceMatch_1) { + replaceResult_1 = ''; + var replaceLastIndex_1 = 0; + do { + if (replaceLastIndex_1 !== replaceMatch_1.index) { + replaceResult_1 += text.substring(replaceLastIndex_1, replaceMatch_1.index); + } + var replaceInput_1 = replaceMatch_1[0]; + var decodeResult_1 = replaceInput_1; + var decodeEntityLastChar_2 = replaceInput_1[replaceInput_1.length - 1]; + if (isAttribute + && decodeEntityLastChar_2 === '=') { + decodeResult_1 = replaceInput_1; + } + else if (isStrict + && decodeEntityLastChar_2 !== ';') { + decodeResult_1 = replaceInput_1; + } + else { + var decodeResultByReference_2 = references[replaceInput_1]; + if (decodeResultByReference_2) { + decodeResult_1 = decodeResultByReference_2; + } + else if (replaceInput_1[0] === '&' && replaceInput_1[1] === '#') { + var decodeSecondChar_2 = replaceInput_1[2]; + var decodeCode_2 = decodeSecondChar_2 == 'x' || decodeSecondChar_2 == 'X' + ? parseInt(replaceInput_1.substr(3), 16) + : parseInt(replaceInput_1.substr(2)); + decodeResult_1 = + decodeCode_2 >= 0x10ffff + ? outOfBoundsChar + : decodeCode_2 > 65535 + ? surrogate_pairs_1.fromCodePoint(decodeCode_2) + : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_2] || decodeCode_2); + } + } + replaceResult_1 += decodeResult_1; + replaceLastIndex_1 = replaceMatch_1.index + replaceInput_1.length; + } while ((replaceMatch_1 = decodeRegExp.exec(text))); + if (replaceLastIndex_1 !== text.length) { + replaceResult_1 += text.substring(replaceLastIndex_1); + } + } + else { + replaceResult_1 = + text; + } + return replaceResult_1; +} +exports.decode = decode; + + +/***/ }), + +/***/ "./node_modules/html-entities/lib/named-references.js": +/*!************************************************************!*\ + !*** ./node_modules/html-entities/lib/named-references.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.bodyRegExps={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g};exports.namedReferences={xml:{entities:{"<":"<",">":">",""":'"',"'":"'","&":"&"},characters:{"<":"<",">":">",'"':""","'":"'","&":"&"}},html4:{entities:{"'":"'"," ":" "," ":" ","¡":"¡","¡":"¡","¢":"¢","¢":"¢","£":"£","£":"£","¤":"¤","¤":"¤","¥":"¥","¥":"¥","¦":"¦","¦":"¦","§":"§","§":"§","¨":"¨","¨":"¨","©":"©","©":"©","ª":"ª","ª":"ª","«":"«","«":"«","¬":"¬","¬":"¬","­":"­","­":"­","®":"®","®":"®","¯":"¯","¯":"¯","°":"°","°":"°","±":"±","±":"±","²":"²","²":"²","³":"³","³":"³","´":"´","´":"´","µ":"µ","µ":"µ","¶":"¶","¶":"¶","·":"·","·":"·","¸":"¸","¸":"¸","¹":"¹","¹":"¹","º":"º","º":"º","»":"»","»":"»","¼":"¼","¼":"¼","½":"½","½":"½","¾":"¾","¾":"¾","¿":"¿","¿":"¿","À":"À","À":"À","Á":"Á","Á":"Á","Â":"Â","Â":"Â","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","Å":"Å","Å":"Å","Æ":"Æ","Æ":"Æ","Ç":"Ç","Ç":"Ç","È":"È","È":"È","É":"É","É":"É","Ê":"Ê","Ê":"Ê","Ë":"Ë","Ë":"Ë","Ì":"Ì","Ì":"Ì","Í":"Í","Í":"Í","Î":"Î","Î":"Î","Ï":"Ï","Ï":"Ï","Ð":"Ð","Ð":"Ð","Ñ":"Ñ","Ñ":"Ñ","Ò":"Ò","Ò":"Ò","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","Õ":"Õ","Õ":"Õ","Ö":"Ö","Ö":"Ö","×":"×","×":"×","Ø":"Ø","Ø":"Ø","Ù":"Ù","Ù":"Ù","Ú":"Ú","Ú":"Ú","Û":"Û","Û":"Û","Ü":"Ü","Ü":"Ü","Ý":"Ý","Ý":"Ý","Þ":"Þ","Þ":"Þ","ß":"ß","ß":"ß","à":"à","à":"à","á":"á","á":"á","â":"â","â":"â","ã":"ã","ã":"ã","ä":"ä","ä":"ä","å":"å","å":"å","æ":"æ","æ":"æ","ç":"ç","ç":"ç","è":"è","è":"è","é":"é","é":"é","ê":"ê","ê":"ê","ë":"ë","ë":"ë","ì":"ì","ì":"ì","í":"í","í":"í","î":"î","î":"î","ï":"ï","ï":"ï","ð":"ð","ð":"ð","ñ":"ñ","ñ":"ñ","ò":"ò","ò":"ò","ó":"ó","ó":"ó","ô":"ô","ô":"ô","õ":"õ","õ":"õ","ö":"ö","ö":"ö","÷":"÷","÷":"÷","ø":"ø","ø":"ø","ù":"ù","ù":"ù","ú":"ú","ú":"ú","û":"û","û":"û","ü":"ü","ü":"ü","ý":"ý","ý":"ý","þ":"þ","þ":"þ","ÿ":"ÿ","ÿ":"ÿ",""":'"',""":'"',"&":"&","&":"&","<":"<","<":"<",">":">",">":">","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€","ƒ":"ƒ","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},characters:{"'":"'"," ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ",'"':""","&":"&","<":"<",">":">","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€","ƒ":"ƒ","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","〈":"⟨","〉":"⟩","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"}},html5:{entities:{"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"⁡","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"⁣","⁢":"⁢","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"​","​":"​","​":"​","​":"​","≫":"≫","≪":"≪"," ":"\n","𝔑":"𝔑","⁠":"⁠"," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц"," ":"\t","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"​","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"⁡","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"⁣","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"⁢","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"‎","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"‏","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"­","­":"­","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"‍","‌":"‌"},characters:{"Æ":"Æ","&":"&","Á":"Á","Ă":"Ă","Â":"Â","А":"А","𝔄":"𝔄","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"⁡","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","≎":"≎","Ч":"Ч","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","⇓":"⇓","⇐":"⇐","⇔":"⇔","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","É":"É","Ě":"Ě","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","Ѓ":"Ѓ",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","Ħ":"Ħ","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ī":"Ī","ⅈ":"ⅈ","∬":"∬","∫":"∫","⋂":"⋂","⁣":"⁣","⁢":"⁢","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","𝕃":"𝕃","↙":"↙","↘":"↘","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"​","\n":" ","𝔑":"𝔑","⁠":"⁠"," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Õ":"Õ","⨷":"⨷","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",'"':""","𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","\t":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ū":"Ū",_:"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","а":"а","æ":"æ","𝔞":"𝔞","à":"à","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","⍼":"⍼","ą":"ą","𝕒":"𝕒","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","å":"å","𝒶":"𝒶","*":"*","ã":"ã","ä":"ä","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⎶":"⎶","б":"б","„":"„","⦰":"⦰","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","◯":"◯","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⤍":"⤍","⧫":"⧫","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","¦":"¦","𝒷":"𝒷","⁏":"⁏","\\":"\","⧅":"⧅","⟈":"⟈","•":"•","⪮":"⪮","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","⩍":"⩍","č":"č","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","⦲":"⦲","¢":"¢","𝔠":"𝔠","ч":"ч","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣",":":":",",":",","@":"@","∁":"∁","⩭":"⩭","𝕔":"𝕔","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋎":"⋎","⋏":"⋏","¤":"¤","∱":"∱","⌭":"⌭","⥥":"⥥","†":"†","ℸ":"ℸ","‐":"‐","⤏":"⤏","ď":"ď","д":"д","⇊":"⇊","⩷":"⩷","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","♦":"♦","ϝ":"ϝ","⋲":"⋲","÷":"÷","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍",$:"$","𝕕":"𝕕","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","⦦":"⦦","џ":"џ","⟿":"⟿","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","≕":"≕","э":"э","ė":"ė","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ϵ":"ϵ","=":"=","≟":"≟","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","η":"η","ð":"ð","ë":"ë","€":"€","!":"!","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi",fj:"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","⅓":"⅓","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","⪌":"⪌","ǵ":"ǵ","γ":"γ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","ℷ":"ℷ","ѓ":"ѓ","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪈":"⪈","⋧":"⋧","𝕘":"𝕘","ℊ":"ℊ","⪎":"⪎","⪐":"⪐","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⥸":"⥸","≩︀":"≩︀","ъ":"ъ","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ħ":"ħ","⁃":"⁃","í":"í","î":"î","и":"и","е":"е","¡":"¡","𝔦":"𝔦","ì":"ì","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","℅":"℅","∞":"∞","⧝":"⧝","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","¿":"¿","𝒾":"𝒾","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","ĩ":"ĩ","і":"і","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⤛":"⤛","⤎":"⤎","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","λ":"λ","⦑":"⦑","⪅":"⪅","«":"«","⤟":"⤟","⤝":"⤝","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","л":"л","⤶":"⤶","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","⇇":"⇇","⋋":"⋋","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⋖":"⋖","⥼":"⥼","𝔩":"𝔩","⪑":"⪑","⥪":"⥪","▄":"▄","љ":"љ","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","≨":"≨","⪉":"⪉","⪇":"⪇","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟼":"⟼","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","◊":"◊","(":"(","⦓":"⦓","⥭":"⥭","‎":"‎","⊿":"⊿","‹":"‹","𝓁":"𝓁","⪍":"⪍","⪏":"⪏","‚":"‚","ł":"ł","⪦":"⪦","⩹":"⩹","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","∺":"∺","¯":"¯","♂":"♂","✠":"✠","▮":"▮","⨩":"⨩","м":"м","—":"—","𝔪":"𝔪","℧":"℧","µ":"µ","⫰":"⫰","−":"−","⨪":"⨪","⫛":"⫛","⊧":"⊧","𝕞":"𝕞","𝓂":"𝓂","μ":"μ","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","⇏":"⇏","⊯":"⊯","⊮":"⊮","ń":"ń","∠⃒":"∠⃒","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","♮":"♮","⩃":"⩃","ň":"ň","ņ":"ņ","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","⇗":"⇗","⤤":"⤤","≐̸":"≐̸","⤨":"⤨","𝔫":"𝔫","↮":"↮","⫲":"⫲","⋼":"⋼","⋺":"⋺","њ":"њ","≦̸":"≦̸","↚":"↚","‥":"‥","𝕟":"𝕟","¬":"¬","⋹̸":"⋹̸","⋵̸":"⋵̸","⋷":"⋷","⋶":"⋶","⋾":"⋾","⋽":"⋽","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","𝓃":"𝓃","⊄":"⊄","⫅̸":"⫅̸","⊅":"⊅","⫆̸":"⫆̸","ñ":"ñ","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","⤧":"⤧","ó":"ó","ô":"ô","о":"о","ő":"ő","⨸":"⨸","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","⧁":"⧁","⦵":"⦵","⦾":"⦾","⦻":"⦻","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","∨":"∨","⩝":"⩝","ℴ":"ℴ","ª":"ª","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ø":"ø","⊘":"⊘","õ":"õ","⨶":"⨶","ö":"ö","⌽":"⌽","¶":"¶","⫳":"⫳","⫽":"⫽","п":"п","%":"%",".":".","‰":"‰","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","☎":"☎","π":"π","ϖ":"ϖ","ℎ":"ℎ","+":"+","⨣":"⨣","⨢":"⨢","⨥":"⨥","⩲":"⩲","⨦":"⨦","⨧":"⨧","⨕":"⨕","𝕡":"𝕡","£":"£","⪳":"⪳","⪷":"⪷","⪹":"⪹","⪵":"⪵","⋨":"⋨","′":"′","⌮":"⌮","⌒":"⌒","⌓":"⌓","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","⨖":"⨖","?":"?","⤜":"⤜","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","⦳":"⦳","⦒":"⦒","⦥":"⦥","»":"»","⥵":"⥵","⤠":"⤠","⤳":"⤳","⤞":"⤞","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","р":"р","⤷":"⤷","⥩":"⥩","↳":"↳","▭":"▭","⥽":"⥽","𝔯":"𝔯","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","⇉":"⇉","⋌":"⋌","˚":"˚","‏":"‏","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","›":"›","𝓇":"𝓇","⋊":"⋊","▹":"▹","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","⪴":"⪴","⪸":"⪸","š":"š","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","с":"с","⋅":"⋅","⩦":"⩦","⇘":"⇘","§":"§",";":";","⤩":"⤩","✶":"✶","𝔰":"𝔰","♯":"♯","щ":"щ","ш":"ш","­":"­","σ":"σ","ς":"ς","⩪":"⩪","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","⨳":"⨳","⧤":"⧤","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","⊓︀":"⊓︀","⊔︀":"⊔︀","𝓈":"𝓈","☆":"☆","⊂":"⊂","⫅":"⫅","⪽":"⪽","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⫇":"⫇","⫕":"⫕","⫓":"⫓","♪":"♪","¹":"¹","²":"²","³":"³","⫆":"⫆","⪾":"⪾","⫘":"⫘","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤪":"⤪","ß":"ß","⌖":"⌖","τ":"τ","ť":"ť","ţ":"ţ","т":"т","⌕":"⌕","𝔱":"𝔱","θ":"θ","ϑ":"ϑ","þ":"þ","×":"×","⨱":"⨱","⨰":"⨰","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","‴":"‴","▵":"▵","≜":"≜","◬":"◬","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","⥣":"⥣","ú":"ú","ў":"ў","ŭ":"ŭ","û":"û","у":"у","ű":"ű","⥾":"⥾","𝔲":"𝔲","ù":"ù","▀":"▀","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","ų":"ų","𝕦":"𝕦","υ":"υ","⇈":"⇈","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","ü":"ü","⦧":"⦧","⫨":"⫨","⫩":"⫩","⦜":"⦜","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","в":"в","⊻":"⊻","≚":"≚","⋮":"⋮","𝔳":"𝔳","𝕧":"𝕧","𝓋":"𝓋","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","𝓌":"𝓌","𝔵":"𝔵","ξ":"ξ","⋻":"⋻","𝕩":"𝕩","𝓍":"𝓍","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"‍","‌":"‌"}}}; + +/***/ }), + +/***/ "./node_modules/html-entities/lib/numeric-unicode-map.js": +/*!***************************************************************!*\ + !*** ./node_modules/html-entities/lib/numeric-unicode-map.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.numericUnicodeMap={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}; + +/***/ }), + +/***/ "./node_modules/html-entities/lib/surrogate-pairs.js": +/*!***********************************************************!*\ + !*** ./node_modules/html-entities/lib/surrogate-pairs.js ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({value:true}));exports.fromCodePoint=String.fromCodePoint||function(astralCodePoint){return String.fromCharCode(Math.floor((astralCodePoint-65536)/1024)+55296,(astralCodePoint-65536)%1024+56320)};exports.getCodePoint=String.prototype.codePointAt?function(input,position){return input.codePointAt(position)}:function(input,position){return(input.charCodeAt(position)-55296)*1024+input.charCodeAt(position+1)-56320+65536};exports.highSurrogateFrom=55296;exports.highSurrogateTo=56319; + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/clients/WebSocketClient.js": +/*!***************************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/clients/WebSocketClient.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ WebSocketClient; } +/* harmony export */ }); +/* harmony import */ var _utils_log_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/log.js */ "./node_modules/webpack-dev-server/client/utils/log.js"); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + +var WebSocketClient = /*#__PURE__*/function () { + /** + * @param {string} url + */ + function WebSocketClient(url) { + _classCallCheck(this, WebSocketClient); + + this.client = new WebSocket(url); + + this.client.onerror = function (error) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_0__.log.error(error); + }; + } + /** + * @param {(...args: any[]) => void} f + */ + + + _createClass(WebSocketClient, [{ + key: "onOpen", + value: function onOpen(f) { + this.client.onopen = f; + } + /** + * @param {(...args: any[]) => void} f + */ + + }, { + key: "onClose", + value: function onClose(f) { + this.client.onclose = f; + } // call f with the message string as the first argument + + /** + * @param {(...args: any[]) => void} f + */ + + }, { + key: "onMessage", + value: function onMessage(f) { + this.client.onmessage = function (e) { + f(e.data); }; - }, + } + }]); + + return WebSocketClient; +}(); + + + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=localhost&port=8081&pathname=%2Fws&logging=none&reconnect=10": +/*!**********************************************************************************************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=localhost&port=8081&pathname=%2Fws&logging=none&reconnect=10 ***! + \**********************************************************************************************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var __resourceQuery = "?protocol=ws%3A&hostname=localhost&port=8081&pathname=%2Fws&logging=none&reconnect=10"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var webpack_hot_log_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack/hot/log.js */ "./node_modules/webpack/hot/log.js"); +/* harmony import */ var webpack_hot_log_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webpack_hot_log_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_stripAnsi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/stripAnsi.js */ "./node_modules/webpack-dev-server/client/utils/stripAnsi.js"); +/* harmony import */ var _utils_parseURL_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/parseURL.js */ "./node_modules/webpack-dev-server/client/utils/parseURL.js"); +/* harmony import */ var _socket_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./socket.js */ "./node_modules/webpack-dev-server/client/socket.js"); +/* harmony import */ var _overlay_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./overlay.js */ "./node_modules/webpack-dev-server/client/overlay.js"); +/* harmony import */ var _utils_log_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/log.js */ "./node_modules/webpack-dev-server/client/utils/log.js"); +/* harmony import */ var _utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/sendMessage.js */ "./node_modules/webpack-dev-server/client/utils/sendMessage.js"); +/* harmony import */ var _utils_reloadApp_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/reloadApp.js */ "./node_modules/webpack-dev-server/client/utils/reloadApp.js"); +/* harmony import */ var _utils_createSocketURL_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/createSocketURL.js */ "./node_modules/webpack-dev-server/client/utils/createSocketURL.js"); +/* global __resourceQuery, __webpack_hash__ */ +/// + + + + + + + + + +/** + * @typedef {Object} Options + * @property {boolean} hot + * @property {boolean} liveReload + * @property {boolean} progress + * @property {boolean | { warnings?: boolean, errors?: boolean, trustedTypesPolicyName?: string }} overlay + * @property {string} [logging] + * @property {number} [reconnect] + */ + +/** + * @typedef {Object} Status + * @property {boolean} isUnloading + * @property {string} currentHash + * @property {string} [previousHash] + */ + +/** + * @type {Status} + */ + +var status = { + isUnloading: false, + // TODO Workaround for webpack v4, `__webpack_hash__` is not replaced without HotModuleReplacement + // eslint-disable-next-line camelcase + currentHash: true ? __webpack_require__.h() : 0 +}; +/** @type {Options} */ + +var options = { + hot: false, + liveReload: false, + progress: false, + overlay: false +}; +var parsedResourceQuery = (0,_utils_parseURL_js__WEBPACK_IMPORTED_MODULE_2__["default"])(__resourceQuery); + +if (parsedResourceQuery.hot === "true") { + options.hot = true; + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Hot Module Replacement enabled."); +} + +if (parsedResourceQuery["live-reload"] === "true") { + options.liveReload = true; + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Live Reloading enabled."); +} + +if (parsedResourceQuery.logging) { + options.logging = parsedResourceQuery.logging; +} + +if (typeof parsedResourceQuery.reconnect !== "undefined") { + options.reconnect = Number(parsedResourceQuery.reconnect); +} +/** + * @param {string} level + */ + + +function setAllLogLevel(level) { + // This is needed because the HMR logger operate separately from dev server logger + webpack_hot_log_js__WEBPACK_IMPORTED_MODULE_0___default().setLogLevel(level === "verbose" || level === "log" ? "info" : level); + (0,_utils_log_js__WEBPACK_IMPORTED_MODULE_5__.setLogLevel)(level); +} + +if (options.logging) { + setAllLogLevel(options.logging); +} + +self.addEventListener("beforeunload", function () { + status.isUnloading = true; +}); +var onSocketMessage = { + hot: function hot() { + if (parsedResourceQuery.hot === "false") { + return; + } + + options.hot = true; + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Hot Module Replacement enabled."); + }, + liveReload: function liveReload() { + if (parsedResourceQuery["live-reload"] === "false") { + return; + } + + options.liveReload = true; + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Live Reloading enabled."); + }, + invalid: function invalid() { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("App updated. Recompiling..."); // Fixes #1042. overlay doesn't clear if errors are fixed but warnings remain. + + if (options.overlay) { + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.hide)(); + } + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Invalid"); + }, + + /** + * @param {string} hash + */ + hash: function hash(_hash) { + status.previousHash = status.currentHash; + status.currentHash = _hash; + }, + logging: setAllLogLevel, + + /** + * @param {boolean} value + */ + overlay: function overlay(value) { + if (typeof document === "undefined") { + return; + } + + options.overlay = value; + }, + + /** + * @param {number} value + */ + reconnect: function reconnect(value) { + if (parsedResourceQuery.reconnect === "false") { + return; + } + + options.reconnect = value; + }, + + /** + * @param {boolean} value + */ + progress: function progress(value) { + options.progress = value; + }, + + /** + * @param {{ pluginName?: string, percent: number, msg: string }} data + */ + "progress-update": function progressUpdate(data) { + if (options.progress) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("".concat(data.pluginName ? "[".concat(data.pluginName, "] ") : "").concat(data.percent, "% - ").concat(data.msg, ".")); + } + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Progress", data); + }, + "still-ok": function stillOk() { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Nothing changed."); + + if (options.overlay) { + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.hide)(); + } + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("StillOk"); + }, + ok: function ok() { + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Ok"); + + if (options.overlay) { + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.hide)(); + } + + (0,_utils_reloadApp_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options, status); + }, + // TODO: remove in v5 in favor of 'static-changed' + + /** + * @param {string} file + */ + "content-changed": function contentChanged(file) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("".concat(file ? "\"".concat(file, "\"") : "Content", " from static directory was changed. Reloading...")); + self.location.reload(); + }, + + /** + * @param {string} file + */ + "static-changed": function staticChanged(file) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("".concat(file ? "\"".concat(file, "\"") : "Content", " from static directory was changed. Reloading...")); + self.location.reload(); + }, + + /** + * @param {Error[]} warnings + * @param {any} params + */ + warnings: function warnings(_warnings, params) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.warn("Warnings while compiling."); + + var printableWarnings = _warnings.map(function (error) { + var _formatProblem = (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.formatProblem)("warning", error), + header = _formatProblem.header, + body = _formatProblem.body; + + return "".concat(header, "\n").concat((0,_utils_stripAnsi_js__WEBPACK_IMPORTED_MODULE_1__["default"])(body)); + }); + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Warnings", printableWarnings); + + for (var i = 0; i < printableWarnings.length; i++) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.warn(printableWarnings[i]); + } + + var needShowOverlayForWarnings = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.warnings; + + if (needShowOverlayForWarnings) { + var trustedTypesPolicyName = typeof options.overlay === "object" && options.overlay.trustedTypesPolicyName; + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.show)("warning", _warnings, trustedTypesPolicyName || null); + } + + if (params && params.preventReloading) { + return; + } + + (0,_utils_reloadApp_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options, status); + }, + + /** + * @param {Error[]} errors + */ + errors: function errors(_errors) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.error("Errors while compiling. Reload prevented."); + + var printableErrors = _errors.map(function (error) { + var _formatProblem2 = (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.formatProblem)("error", error), + header = _formatProblem2.header, + body = _formatProblem2.body; + + return "".concat(header, "\n").concat((0,_utils_stripAnsi_js__WEBPACK_IMPORTED_MODULE_1__["default"])(body)); + }); + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Errors", printableErrors); + + for (var i = 0; i < printableErrors.length; i++) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.error(printableErrors[i]); + } + + var needShowOverlayForErrors = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.errors; + + if (needShowOverlayForErrors) { + var trustedTypesPolicyName = typeof options.overlay === "object" && options.overlay.trustedTypesPolicyName; + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.show)("error", _errors, trustedTypesPolicyName || null); + } + }, + + /** + * @param {Error} error + */ + error: function error(_error) { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.error(_error); + }, + close: function close() { + _utils_log_js__WEBPACK_IMPORTED_MODULE_5__.log.info("Disconnected!"); + + if (options.overlay) { + (0,_overlay_js__WEBPACK_IMPORTED_MODULE_4__.hide)(); + } + + (0,_utils_sendMessage_js__WEBPACK_IMPORTED_MODULE_6__["default"])("Close"); + } +}; +var socketURL = (0,_utils_createSocketURL_js__WEBPACK_IMPORTED_MODULE_8__["default"])(parsedResourceQuery); +(0,_socket_js__WEBPACK_IMPORTED_MODULE_3__["default"])(socketURL, onSocketMessage, options.reconnect); + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/modules/logger/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/modules/logger/index.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./client-src/modules/logger/SyncBailHookFake.js": +/*!*******************************************************!*\ + !*** ./client-src/modules/logger/SyncBailHookFake.js ***! + \*******************************************************/ +/***/ (function(module) { + + +/** + * Client stub for tapable SyncBailHook + */ + +module.exports = function clientTapableSyncBailHook() { + return { + call: function call() {} + }; +}; + +/***/ }), + +/***/ "./node_modules/webpack/lib/logging/Logger.js": +/*!****************************************************!*\ + !*** ./node_modules/webpack/lib/logging/Logger.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _iterableToArray(iter) { + if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a 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); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} + +var LogType = Object.freeze({ + error: + /** @type {"error"} */ + "error", + // message, c style arguments + warn: + /** @type {"warn"} */ + "warn", + // message, c style arguments + info: + /** @type {"info"} */ + "info", + // message, c style arguments + log: + /** @type {"log"} */ + "log", + // message, c style arguments + debug: + /** @type {"debug"} */ + "debug", + // message, c style arguments + trace: + /** @type {"trace"} */ + "trace", + // no arguments + group: + /** @type {"group"} */ + "group", + // [label] + groupCollapsed: + /** @type {"groupCollapsed"} */ + "groupCollapsed", + // [label] + groupEnd: + /** @type {"groupEnd"} */ + "groupEnd", + // [label] + profile: + /** @type {"profile"} */ + "profile", + // [profileName] + profileEnd: + /** @type {"profileEnd"} */ + "profileEnd", + // [profileName] + time: + /** @type {"time"} */ + "time", + // name, time as [seconds, nanoseconds] + clear: + /** @type {"clear"} */ + "clear", + // no arguments + status: + /** @type {"status"} */ + "status" // message, arguments + +}); +exports.LogType = LogType; +/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */ + +var LOG_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger raw log method"); +var TIMERS_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger times"); +var TIMERS_AGGREGATES_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger aggregated times"); + +var WebpackLogger = /*#__PURE__*/function () { + /** + * @param {function(LogTypeEnum, any[]=): void} log log function + * @param {function(string | function(): string): WebpackLogger} getChildLogger function to create child logger + */ + function WebpackLogger(log, getChildLogger) { + _classCallCheck(this, WebpackLogger); + + this[LOG_SYMBOL] = log; + this.getChildLogger = getChildLogger; + } + + _createClass(WebpackLogger, [{ + key: "error", + value: function error() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this[LOG_SYMBOL](LogType.error, args); + } + }, { + key: "warn", + value: function warn() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this[LOG_SYMBOL](LogType.warn, args); + } + }, { + key: "info", + value: function info() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + this[LOG_SYMBOL](LogType.info, args); + } + }, { + key: "log", + value: function log() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + this[LOG_SYMBOL](LogType.log, args); + } + }, { + key: "debug", + value: function debug() { + for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } + + this[LOG_SYMBOL](LogType.debug, args); + } + }, { + key: "assert", + value: function assert(assertion) { + if (!assertion) { + for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) { + args[_key6 - 1] = arguments[_key6]; + } + + this[LOG_SYMBOL](LogType.error, args); + } + } + }, { + key: "trace", + value: function trace() { + this[LOG_SYMBOL](LogType.trace, ["Trace"]); + } + }, { + key: "clear", + value: function clear() { + this[LOG_SYMBOL](LogType.clear); + } + }, { + key: "status", + value: function status() { + for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + args[_key7] = arguments[_key7]; + } + + this[LOG_SYMBOL](LogType.status, args); + } + }, { + key: "group", + value: function group() { + for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + args[_key8] = arguments[_key8]; + } + + this[LOG_SYMBOL](LogType.group, args); + } + }, { + key: "groupCollapsed", + value: function groupCollapsed() { + for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { + args[_key9] = arguments[_key9]; + } + + this[LOG_SYMBOL](LogType.groupCollapsed, args); + } + }, { + key: "groupEnd", + value: function groupEnd() { + for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { + args[_key10] = arguments[_key10]; + } + + this[LOG_SYMBOL](LogType.groupEnd, args); + } + }, { + key: "profile", + value: function profile(label) { + this[LOG_SYMBOL](LogType.profile, [label]); + } + }, { + key: "profileEnd", + value: function profileEnd(label) { + this[LOG_SYMBOL](LogType.profileEnd, [label]); + } + }, { + key: "time", + value: function time(label) { + this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map(); + this[TIMERS_SYMBOL].set(label, process.hrtime()); + } + }, { + key: "timeLog", + value: function timeLog(label) { + var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); + + if (!prev) { + throw new Error("No such label '".concat(label, "' for WebpackLogger.timeLog()")); + } + + var time = process.hrtime(prev); + this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time))); + } + }, { + key: "timeEnd", + value: function timeEnd(label) { + var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); + + if (!prev) { + throw new Error("No such label '".concat(label, "' for WebpackLogger.timeEnd()")); + } + + var time = process.hrtime(prev); + this[TIMERS_SYMBOL].delete(label); + this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time))); + } + }, { + key: "timeAggregate", + value: function timeAggregate(label) { + var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); + + if (!prev) { + throw new Error("No such label '".concat(label, "' for WebpackLogger.timeAggregate()")); + } + + var time = process.hrtime(prev); + this[TIMERS_SYMBOL].delete(label); + this[TIMERS_AGGREGATES_SYMBOL] = this[TIMERS_AGGREGATES_SYMBOL] || new Map(); + var current = this[TIMERS_AGGREGATES_SYMBOL].get(label); + + if (current !== undefined) { + if (time[1] + current[1] > 1e9) { + time[0] += current[0] + 1; + time[1] = time[1] - 1e9 + current[1]; + } else { + time[0] += current[0]; + time[1] += current[1]; + } + } + + this[TIMERS_AGGREGATES_SYMBOL].set(label, time); + } + }, { + key: "timeAggregateEnd", + value: function timeAggregateEnd(label) { + if (this[TIMERS_AGGREGATES_SYMBOL] === undefined) return; + var time = this[TIMERS_AGGREGATES_SYMBOL].get(label); + if (time === undefined) return; + this[TIMERS_AGGREGATES_SYMBOL].delete(label); + this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time))); + } + }]); + + return WebpackLogger; +}(); + +exports.Logger = WebpackLogger; + +/***/ }), + +/***/ "./node_modules/webpack/lib/logging/createConsoleLogger.js": +/*!*****************************************************************!*\ + !*** ./node_modules/webpack/lib/logging/createConsoleLogger.js ***! + \*****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_10785__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} + +function _iterableToArray(iter) { + if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); +} + +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; +} + +var _require = __nested_webpack_require_10785__(/*! ./Logger */ "./node_modules/webpack/lib/logging/Logger.js"), + LogType = _require.LogType; +/** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */ + +/** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */ + +/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */ + +/** @typedef {function(string): boolean} FilterFunction */ + +/** + * @typedef {Object} LoggerConsole + * @property {function(): void} clear + * @property {function(): void} trace + * @property {(...args: any[]) => void} info + * @property {(...args: any[]) => void} log + * @property {(...args: any[]) => void} warn + * @property {(...args: any[]) => void} error + * @property {(...args: any[]) => void=} debug + * @property {(...args: any[]) => void=} group + * @property {(...args: any[]) => void=} groupCollapsed + * @property {(...args: any[]) => void=} groupEnd + * @property {(...args: any[]) => void=} status + * @property {(...args: any[]) => void=} profile + * @property {(...args: any[]) => void=} profileEnd + * @property {(...args: any[]) => void=} logTime + */ + +/** + * @typedef {Object} LoggerOptions + * @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel + * @property {FilterTypes|boolean} debug filter for debug logging + * @property {LoggerConsole} console the console to log to + */ + +/** + * @param {FilterItemTypes} item an input item + * @returns {FilterFunction} filter function + */ + + +var filterToFunction = function filterToFunction(item) { + if (typeof item === "string") { + var regExp = new RegExp("[\\\\/]".concat(item.replace( // eslint-disable-next-line no-useless-escape + /[-[\]{}()*+?.\\^$|]/g, "\\$&"), "([\\\\/]|$|!|\\?)")); + return function (ident) { + return regExp.test(ident); + }; + } + + if (item && typeof item === "object" && typeof item.test === "function") { + return function (ident) { + return item.test(ident); + }; + } + + if (typeof item === "function") { + return item; + } + + if (typeof item === "boolean") { + return function () { + return item; + }; + } +}; +/** + * @enum {number} + */ + + +var LogLevel = { + none: 6, + false: 6, + error: 5, + warn: 4, + info: 3, + log: 2, + true: 2, + verbose: 1 +}; +/** + * @param {LoggerOptions} options options object + * @returns {function(string, LogTypeEnum, any[]): void} logging function + */ + +module.exports = function (_ref) { + var _ref$level = _ref.level, + level = _ref$level === void 0 ? "info" : _ref$level, + _ref$debug = _ref.debug, + debug = _ref$debug === void 0 ? false : _ref$debug, + console = _ref.console; + var debugFilters = typeof debug === "boolean" ? [function () { + return debug; + }] : + /** @type {FilterItemTypes[]} */ + [].concat(debug).map(filterToFunction); + /** @type {number} */ + + var loglevel = LogLevel["".concat(level)] || 0; + /** + * @param {string} name name of the logger + * @param {LogTypeEnum} type type of the log entry + * @param {any[]} args arguments of the log entry + * @returns {void} + */ + + var logger = function logger(name, type, args) { + var labeledArgs = function labeledArgs() { + if (Array.isArray(args)) { + if (args.length > 0 && typeof args[0] === "string") { + return ["[".concat(name, "] ").concat(args[0])].concat(_toConsumableArray(args.slice(1))); + } else { + return ["[".concat(name, "]")].concat(_toConsumableArray(args)); + } + } else { + return []; + } + }; + + var debug = debugFilters.some(function (f) { + return f(name); + }); + + switch (type) { + case LogType.debug: + if (!debug) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins + + if (typeof console.debug === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.debug.apply(console, _toConsumableArray(labeledArgs())); + } else { + console.log.apply(console, _toConsumableArray(labeledArgs())); + } + + break; + + case LogType.log: + if (!debug && loglevel > LogLevel.log) return; + console.log.apply(console, _toConsumableArray(labeledArgs())); + break; + + case LogType.info: + if (!debug && loglevel > LogLevel.info) return; + console.info.apply(console, _toConsumableArray(labeledArgs())); + break; + + case LogType.warn: + if (!debug && loglevel > LogLevel.warn) return; + console.warn.apply(console, _toConsumableArray(labeledArgs())); + break; + + case LogType.error: + if (!debug && loglevel > LogLevel.error) return; + console.error.apply(console, _toConsumableArray(labeledArgs())); + break; + + case LogType.trace: + if (!debug) return; + console.trace(); + break; + + case LogType.groupCollapsed: + if (!debug && loglevel > LogLevel.log) return; + + if (!debug && loglevel > LogLevel.verbose) { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.groupCollapsed === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.groupCollapsed.apply(console, _toConsumableArray(labeledArgs())); + } else { + console.log.apply(console, _toConsumableArray(labeledArgs())); + } + + break; + } + + // falls through + + case LogType.group: + if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins + + if (typeof console.group === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.group.apply(console, _toConsumableArray(labeledArgs())); + } else { + console.log.apply(console, _toConsumableArray(labeledArgs())); + } + + break; + + case LogType.groupEnd: + if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins + + if (typeof console.groupEnd === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.groupEnd(); + } + + break; + + case LogType.time: + { + if (!debug && loglevel > LogLevel.log) return; + var ms = args[1] * 1000 + args[2] / 1000000; + var msg = "[".concat(name, "] ").concat(args[0], ": ").concat(ms, " ms"); + + if (typeof console.logTime === "function") { + console.logTime(msg); + } else { + console.log(msg); + } + + break; + } + + case LogType.profile: + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profile === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profile.apply(console, _toConsumableArray(labeledArgs())); + } + + break; + + case LogType.profileEnd: + // eslint-disable-next-line node/no-unsupported-features/node-builtins + if (typeof console.profileEnd === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.profileEnd.apply(console, _toConsumableArray(labeledArgs())); + } + + break; + + case LogType.clear: + if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins + + if (typeof console.clear === "function") { + // eslint-disable-next-line node/no-unsupported-features/node-builtins + console.clear(); + } + + break; + + case LogType.status: + if (!debug && loglevel > LogLevel.info) return; + + if (typeof console.status === "function") { + if (args.length === 0) { + console.status(); + } else { + console.status.apply(console, _toConsumableArray(labeledArgs())); + } + } else { + if (args.length !== 0) { + console.info.apply(console, _toConsumableArray(labeledArgs())); + } + } + + break; + + default: + throw new Error("Unexpected LogType ".concat(type)); + } + }; + + return logger; +}; + +/***/ }), + +/***/ "./node_modules/webpack/lib/logging/runtime.js": +/*!*****************************************************!*\ + !*** ./node_modules/webpack/lib/logging/runtime.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __nested_webpack_require_20872__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + +function _extends() { + _extends = Object.assign ? Object.assign.bind() : 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; + }; + return _extends.apply(this, arguments); +} + +var SyncBailHook = __nested_webpack_require_20872__(/*! tapable/lib/SyncBailHook */ "./client-src/modules/logger/SyncBailHookFake.js"); + +var _require = __nested_webpack_require_20872__(/*! ./Logger */ "./node_modules/webpack/lib/logging/Logger.js"), + Logger = _require.Logger; + +var createConsoleLogger = __nested_webpack_require_20872__(/*! ./createConsoleLogger */ "./node_modules/webpack/lib/logging/createConsoleLogger.js"); +/** @type {createConsoleLogger.LoggerOptions} */ + + +var currentDefaultLoggerOptions = { + level: "info", + debug: false, + console: console +}; +var currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions); +/** + * @param {string} name name of the logger + * @returns {Logger} a logger + */ + +exports.getLogger = function (name) { + return new Logger(function (type, args) { + if (exports.hooks.log.call(name, type, args) === undefined) { + currentDefaultLogger(name, type, args); + } + }, function (childName) { + return exports.getLogger("".concat(name, "/").concat(childName)); + }); +}; +/** + * @param {createConsoleLogger.LoggerOptions} options new options, merge with old options + * @returns {void} + */ + + +exports.configureDefaultLogger = function (options) { + _extends(currentDefaultLoggerOptions, options); + + currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions); +}; + +exports.hooks = { + log: new SyncBailHook(["origin", "type", "args"]) +}; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_23009__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_23009__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __nested_webpack_require_23009__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__nested_webpack_require_23009__.o(definition, key) && !__nested_webpack_require_23009__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __nested_webpack_require_23009__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __nested_webpack_require_23009__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +!function() { +/*!********************************************!*\ + !*** ./client-src/modules/logger/index.js ***! + \********************************************/ +__nested_webpack_require_23009__.r(__webpack_exports__); +/* harmony export */ __nested_webpack_require_23009__.d(__webpack_exports__, { +/* harmony export */ "default": function() { return /* reexport default export from named module */ webpack_lib_logging_runtime_js__WEBPACK_IMPORTED_MODULE_0__; } +/* harmony export */ }); +/* harmony import */ var webpack_lib_logging_runtime_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_23009__(/*! webpack/lib/logging/runtime.js */ "./node_modules/webpack/lib/logging/runtime.js"); + +}(); +var __webpack_export_target__ = exports; +for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; +if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); +/******/ })() +; + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/overlay.js": +/*!***********************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/overlay.js ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "formatProblem": function() { return /* binding */ formatProblem; }, +/* harmony export */ "hide": function() { return /* binding */ hide; }, +/* harmony export */ "show": function() { return /* binding */ show; } +/* harmony export */ }); +/* harmony import */ var ansi_html_community__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ansi-html-community */ "./node_modules/ansi-html-community/index.js"); +/* harmony import */ var ansi_html_community__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ansi_html_community__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! html-entities */ "./node_modules/html-entities/lib/index.js"); +/* harmony import */ var html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(html_entities__WEBPACK_IMPORTED_MODULE_1__); +// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app) +// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware). + + +var colors = { + reset: ["transparent", "transparent"], + black: "181818", + red: "E36049", + green: "B3CB74", + yellow: "FFD080", + blue: "7CAFC2", + magenta: "7FACCA", + cyan: "C3C2EF", + lightgrey: "EBE7E3", + darkgrey: "6D7891" +}; +/** @type {HTMLIFrameElement | null | undefined} */ + +var iframeContainerElement; +/** @type {HTMLDivElement | null | undefined} */ + +var containerElement; +/** @type {Array<(element: HTMLDivElement) => void>} */ + +var onLoadQueue = []; +/** @type {TrustedTypePolicy | undefined} */ + +var overlayTrustedTypesPolicy; +ansi_html_community__WEBPACK_IMPORTED_MODULE_0___default().setColors(colors); +/** + * @param {string | null} trustedTypesPolicyName + */ + +function createContainer(trustedTypesPolicyName) { + // Enable Trusted Types if they are available in the current browser. + if (window.trustedTypes) { + overlayTrustedTypesPolicy = window.trustedTypes.createPolicy(trustedTypesPolicyName || "webpack-dev-server#overlay", { + createHTML: function createHTML(value) { + return value; + } + }); + } + + iframeContainerElement = document.createElement("iframe"); + iframeContainerElement.id = "webpack-dev-server-client-overlay"; + iframeContainerElement.src = "about:blank"; + iframeContainerElement.style.position = "fixed"; + iframeContainerElement.style.left = 0; + iframeContainerElement.style.top = 0; + iframeContainerElement.style.right = 0; + iframeContainerElement.style.bottom = 0; + iframeContainerElement.style.width = "100vw"; + iframeContainerElement.style.height = "100vh"; + iframeContainerElement.style.border = "none"; + iframeContainerElement.style.zIndex = 9999999999; + + iframeContainerElement.onload = function () { + containerElement = + /** @type {Document} */ + + /** @type {HTMLIFrameElement} */ + iframeContainerElement.contentDocument.createElement("div"); + containerElement.id = "webpack-dev-server-client-overlay-div"; + containerElement.style.position = "fixed"; + containerElement.style.boxSizing = "border-box"; + containerElement.style.left = 0; + containerElement.style.top = 0; + containerElement.style.right = 0; + containerElement.style.bottom = 0; + containerElement.style.width = "100vw"; + containerElement.style.height = "100vh"; + containerElement.style.backgroundColor = "rgba(0, 0, 0, 0.85)"; + containerElement.style.color = "#E8E8E8"; + containerElement.style.fontFamily = "Menlo, Consolas, monospace"; + containerElement.style.fontSize = "large"; + containerElement.style.padding = "2rem"; + containerElement.style.lineHeight = "1.2"; + containerElement.style.whiteSpace = "pre-wrap"; + containerElement.style.overflow = "auto"; + var headerElement = document.createElement("span"); + headerElement.innerText = "Compiled with problems:"; + var closeButtonElement = document.createElement("button"); + closeButtonElement.innerText = "X"; + closeButtonElement.style.background = "transparent"; + closeButtonElement.style.border = "none"; + closeButtonElement.style.fontSize = "20px"; + closeButtonElement.style.fontWeight = "bold"; + closeButtonElement.style.color = "white"; + closeButtonElement.style.cursor = "pointer"; + closeButtonElement.style.cssFloat = "right"; // @ts-ignore + + closeButtonElement.style.styleFloat = "right"; + closeButtonElement.addEventListener("click", function () { + hide(); + }); + containerElement.appendChild(headerElement); + containerElement.appendChild(closeButtonElement); + containerElement.appendChild(document.createElement("br")); + containerElement.appendChild(document.createElement("br")); + /** @type {Document} */ + + /** @type {HTMLIFrameElement} */ + iframeContainerElement.contentDocument.body.appendChild(containerElement); + onLoadQueue.forEach(function (onLoad) { + onLoad( + /** @type {HTMLDivElement} */ + containerElement); + }); + onLoadQueue = []; + /** @type {HTMLIFrameElement} */ + + iframeContainerElement.onload = null; + }; + + document.body.appendChild(iframeContainerElement); +} +/** + * @param {(element: HTMLDivElement) => void} callback + * @param {string | null} trustedTypesPolicyName + */ + + +function ensureOverlayExists(callback, trustedTypesPolicyName) { + if (containerElement) { + // Everything is ready, call the callback right away. + callback(containerElement); + return; + } + + onLoadQueue.push(callback); + + if (iframeContainerElement) { + return; + } + + createContainer(trustedTypesPolicyName); +} // Successful compilation. + + +function hide() { + if (!iframeContainerElement) { + return; + } // Clean up and reset internal state. + + + document.body.removeChild(iframeContainerElement); + iframeContainerElement = null; + containerElement = null; +} +/** + * @param {string} type + * @param {string | { file?: string, moduleName?: string, loc?: string, message?: string }} item + * @returns {{ header: string, body: string }} + */ + + +function formatProblem(type, item) { + var header = type === "warning" ? "WARNING" : "ERROR"; + var body = ""; + + if (typeof item === "string") { + body += item; + } else { + var file = item.file || ""; // eslint-disable-next-line no-nested-ternary + + var moduleName = item.moduleName ? item.moduleName.indexOf("!") !== -1 ? "".concat(item.moduleName.replace(/^(\s|\S)*!/, ""), " (").concat(item.moduleName, ")") : "".concat(item.moduleName) : ""; + var loc = item.loc; + header += "".concat(moduleName || file ? " in ".concat(moduleName ? "".concat(moduleName).concat(file ? " (".concat(file, ")") : "") : file).concat(loc ? " ".concat(loc) : "") : ""); + body += item.message || ""; + } + + return { + header: header, + body: body }; - t[999](), - t[85](), - t[351](), - t[360](), - t[682](), - t[866](), - t[477](), - t[808](), - t[743](), - t[988](), - t[92](), - t[194](), - t[206](), - t[789](), - t[337](), - t[350](), - t[376](), - t[261](), - t[929](), - t[280](), - t[426](), - t[114](), - t[231](), - t[541](), - t[149](), - t[74](), - t[691](), - t[105](), - t[944](), - t[954](), - t[178](), - t[547](), - t[886](), - t[129](), - t[93](), - t[719](), - t[397](), - t[428](), - t[782](), - t[752](), - t[496](), - t[291](), - t[131](); -})(); -//# sourceMappingURL=leaflet.distortableimage.js.map +} // Compilation with errors (e.g. syntax error or missing modules). + +/** + * @param {string} type + * @param {Array} messages + * @param {string | null} trustedTypesPolicyName + */ + + +function show(type, messages, trustedTypesPolicyName) { + ensureOverlayExists(function () { + messages.forEach(function (message) { + var entryElement = document.createElement("div"); + var typeElement = document.createElement("span"); + + var _formatProblem = formatProblem(type, message), + header = _formatProblem.header, + body = _formatProblem.body; + + typeElement.innerText = header; + typeElement.style.color = "#".concat(colors.red); // Make it look similar to our terminal. + + var text = ansi_html_community__WEBPACK_IMPORTED_MODULE_0___default()((0,html_entities__WEBPACK_IMPORTED_MODULE_1__.encode)(body)); + var messageTextNode = document.createElement("div"); + messageTextNode.innerHTML = overlayTrustedTypesPolicy ? overlayTrustedTypesPolicy.createHTML(text) : text; + entryElement.appendChild(typeElement); + entryElement.appendChild(document.createElement("br")); + entryElement.appendChild(document.createElement("br")); + entryElement.appendChild(messageTextNode); + entryElement.appendChild(document.createElement("br")); + entryElement.appendChild(document.createElement("br")); + /** @type {HTMLDivElement} */ + + containerElement.appendChild(entryElement); + }); + }, trustedTypesPolicyName); +} + + + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/socket.js": +/*!**********************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/socket.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "client": function() { return /* binding */ client; } +/* harmony export */ }); +/* harmony import */ var _clients_WebSocketClient_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clients/WebSocketClient.js */ "./node_modules/webpack-dev-server/client/clients/WebSocketClient.js"); +/* harmony import */ var _utils_log_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/log.js */ "./node_modules/webpack-dev-server/client/utils/log.js"); +/* provided dependency */ var __webpack_dev_server_client__ = __webpack_require__(/*! ./node_modules/webpack-dev-server/client/clients/WebSocketClient.js */ "./node_modules/webpack-dev-server/client/clients/WebSocketClient.js"); +/* global __webpack_dev_server_client__ */ + + // this WebsocketClient is here as a default fallback, in case the client is not injected + +/* eslint-disable camelcase */ + +var Client = // eslint-disable-next-line no-nested-ternary +typeof __webpack_dev_server_client__ !== "undefined" ? typeof __webpack_dev_server_client__.default !== "undefined" ? __webpack_dev_server_client__.default : __webpack_dev_server_client__ : _clients_WebSocketClient_js__WEBPACK_IMPORTED_MODULE_0__["default"]; +/* eslint-enable camelcase */ + +var retries = 0; +var maxRetries = 10; // Initialized client is exported so external consumers can utilize the same instance +// It is mutable to enforce singleton +// eslint-disable-next-line import/no-mutable-exports + +var client = null; +/** + * @param {string} url + * @param {{ [handler: string]: (data?: any, params?: any) => any }} handlers + * @param {number} [reconnect] + */ + +var socket = function initSocket(url, handlers, reconnect) { + client = new Client(url); + client.onOpen(function () { + retries = 0; + + if (typeof reconnect !== "undefined") { + maxRetries = reconnect; + } + }); + client.onClose(function () { + if (retries === 0) { + handlers.close(); + } // Try to reconnect. + + + client = null; // After 10 retries stop trying, to prevent logspam. + + if (retries < maxRetries) { + // Exponentially increase timeout to reconnect. + // Respectfully copied from the package `got`. + // eslint-disable-next-line no-restricted-properties + var retryInMs = 1000 * Math.pow(2, retries) + Math.random() * 100; + retries += 1; + _utils_log_js__WEBPACK_IMPORTED_MODULE_1__.log.info("Trying to reconnect..."); + setTimeout(function () { + socket(url, handlers, reconnect); + }, retryInMs); + } + }); + client.onMessage( + /** + * @param {any} data + */ + function (data) { + var message = JSON.parse(data); + + if (handlers[message.type]) { + handlers[message.type](message.data, message.params); + } + }); +}; + +/* harmony default export */ __webpack_exports__["default"] = (socket); + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/utils/createSocketURL.js": +/*!*************************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/utils/createSocketURL.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * @param {{ protocol?: string, auth?: string, hostname?: string, port?: string, pathname?: string, search?: string, hash?: string, slashes?: boolean }} objURL + * @returns {string} + */ +function format(objURL) { + var protocol = objURL.protocol || ""; + + if (protocol && protocol.substr(-1) !== ":") { + protocol += ":"; + } + + var auth = objURL.auth || ""; + + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ":"); + auth += "@"; + } + + var host = ""; + + if (objURL.hostname) { + host = auth + (objURL.hostname.indexOf(":") === -1 ? objURL.hostname : "[".concat(objURL.hostname, "]")); + + if (objURL.port) { + host += ":".concat(objURL.port); + } + } + + var pathname = objURL.pathname || ""; + + if (objURL.slashes) { + host = "//".concat(host || ""); + + if (pathname && pathname.charAt(0) !== "/") { + pathname = "/".concat(pathname); + } + } else if (!host) { + host = ""; + } + + var search = objURL.search || ""; + + if (search && search.charAt(0) !== "?") { + search = "?".concat(search); + } + + var hash = objURL.hash || ""; + + if (hash && hash.charAt(0) !== "#") { + hash = "#".concat(hash); + } + + pathname = pathname.replace(/[?#]/g, + /** + * @param {string} match + * @returns {string} + */ + function (match) { + return encodeURIComponent(match); + }); + search = search.replace("#", "%23"); + return "".concat(protocol).concat(host).concat(pathname).concat(search).concat(hash); +} +/** + * @param {URL & { fromCurrentScript?: boolean }} parsedURL + * @returns {string} + */ + + +function createSocketURL(parsedURL) { + var hostname = parsedURL.hostname; // Node.js module parses it as `::` + // `new URL(urlString, [baseURLString])` parses it as '[::]' + + var isInAddrAny = hostname === "0.0.0.0" || hostname === "::" || hostname === "[::]"; // why do we need this check? + // hostname n/a for file protocol (example, when using electron, ionic) + // see: https://github.com/webpack/webpack-dev-server/pull/384 + + if (isInAddrAny && self.location.hostname && self.location.protocol.indexOf("http") === 0) { + hostname = self.location.hostname; + } + + var socketURLProtocol = parsedURL.protocol || self.location.protocol; // When https is used in the app, secure web sockets are always necessary because the browser doesn't accept non-secure web sockets. + + if (socketURLProtocol === "auto:" || hostname && isInAddrAny && self.location.protocol === "https:") { + socketURLProtocol = self.location.protocol; + } + + socketURLProtocol = socketURLProtocol.replace(/^(?:http|.+-extension|file)/i, "ws"); + var socketURLAuth = ""; // `new URL(urlString, [baseURLstring])` doesn't have `auth` property + // Parse authentication credentials in case we need them + + if (parsedURL.username) { + socketURLAuth = parsedURL.username; // Since HTTP basic authentication does not allow empty username, + // we only include password if the username is not empty. + + if (parsedURL.password) { + // Result: : + socketURLAuth = socketURLAuth.concat(":", parsedURL.password); + } + } // In case the host is a raw IPv6 address, it can be enclosed in + // the brackets as the brackets are needed in the final URL string. + // Need to remove those as url.format blindly adds its own set of brackets + // if the host string contains colons. That would lead to non-working + // double brackets (e.g. [[::]]) host + // + // All of these web socket url params are optionally passed in through resourceQuery, + // so we need to fall back to the default if they are not provided + + + var socketURLHostname = (hostname || self.location.hostname || "localhost").replace(/^\[(.*)\]$/, "$1"); + var socketURLPort = parsedURL.port; + + if (!socketURLPort || socketURLPort === "0") { + socketURLPort = self.location.port; + } // If path is provided it'll be passed in via the resourceQuery as a + // query param so it has to be parsed out of the querystring in order for the + // client to open the socket to the correct location. + + + var socketURLPathname = "/ws"; + + if (parsedURL.pathname && !parsedURL.fromCurrentScript) { + socketURLPathname = parsedURL.pathname; + } + + return format({ + protocol: socketURLProtocol, + auth: socketURLAuth, + hostname: socketURLHostname, + port: socketURLPort, + pathname: socketURLPathname, + slashes: true + }); +} + +/* harmony default export */ __webpack_exports__["default"] = (createSocketURL); + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/utils/getCurrentScriptSource.js": +/*!********************************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/utils/getCurrentScriptSource.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/** + * @returns {string} + */ +function getCurrentScriptSource() { + // `document.currentScript` is the most accurate way to find the current script, + // but is not supported in all browsers. + if (document.currentScript) { + return document.currentScript.getAttribute("src"); + } // Fallback to getting all scripts running in the document. + + + var scriptElements = document.scripts || []; + var scriptElementsWithSrc = Array.prototype.filter.call(scriptElements, function (element) { + return element.getAttribute("src"); + }); + + if (scriptElementsWithSrc.length > 0) { + var currentScript = scriptElementsWithSrc[scriptElementsWithSrc.length - 1]; + return currentScript.getAttribute("src"); + } // Fail as there was no script to use. + + + throw new Error("[webpack-dev-server] Failed to get current script source."); +} + +/* harmony default export */ __webpack_exports__["default"] = (getCurrentScriptSource); + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/utils/log.js": +/*!*************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/utils/log.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "log": function() { return /* binding */ log; }, +/* harmony export */ "setLogLevel": function() { return /* binding */ setLogLevel; } +/* harmony export */ }); +/* harmony import */ var _modules_logger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/logger/index.js */ "./node_modules/webpack-dev-server/client/modules/logger/index.js"); +/* harmony import */ var _modules_logger_index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_modules_logger_index_js__WEBPACK_IMPORTED_MODULE_0__); + +var name = "webpack-dev-server"; // default level is set on the client side, so it does not need +// to be set by the CLI or API + +var defaultLevel = "info"; // options new options, merge with old options + +/** + * @param {false | true | "none" | "error" | "warn" | "info" | "log" | "verbose"} level + * @returns {void} + */ + +function setLogLevel(level) { + _modules_logger_index_js__WEBPACK_IMPORTED_MODULE_0___default().configureDefaultLogger({ + level: level + }); +} + +setLogLevel(defaultLevel); +var log = _modules_logger_index_js__WEBPACK_IMPORTED_MODULE_0___default().getLogger(name); + + +/***/ }), + +/***/ "./node_modules/webpack-dev-server/client/utils/parseURL.js": +/*!******************************************************************!*\ + !*** ./node_modules/webpack-dev-server/client/utils/parseURL.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _getCurrentScriptSource_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getCurrentScriptSource.js */ "./node_modules/webpack-dev-server/client/utils/getCurrentScriptSource.js"); + +/** + * @param {string} resourceQuery + * @returns {{ [key: string]: string | boolean }} + */ + +function parseURL(resourceQuery) { + /** @type {{ [key: string]: string }} */ + var options = {}; + + if (typeof resourceQuery === "string" && resourceQuery !== "") { + var searchParams = resourceQuery.slice(1).split("&"); + + for (var i = 0; i < searchParams.length; i++) { + var pair = searchParams[i].split("="); + options[pair[0]] = decodeURIComponent(pair[1]); + } + } else { + // Else, get the url from the

Images

form.addEventListener('submit', (event) => { event.preventDefault(); const url = input.value.replace('details', 'metadata'); + let splitUrl = url.split('/'); + let detectKey = splitUrl[splitUrl.length - 2]; + console.log("detected key", detectKey); + let fetchedFrom axios.get(url) .then((response) => { if (response.data.files && response.data.files.length != 0) { @@ -103,9 +107,33 @@

Images

let imageRow = document.createElement('div'); let image = new Image(150, 150); let placeButton = document.createElement('a'); + fetchedFrom = document.createElement('p'); + fetchedFromUrl = document.createElement('a'); + fetchedFromUrl.setAttribute('href', input.value); + fetchedFromUrl.setAttribute('target', '_blank'); + fetchedFromUrl.innerHTML = 'this Internet Archive Collection'; + fetchedFrom.appendChild(fetchedFromUrl) placeButton.classList.add('btn', 'btn-sm', 'btn-outline-secondary', 'place-button'); - placeButton.innerHTML = 'Place on map'; + placeButton.innerHTML = 'Place on map '; + + placeButton.addEventListener('click', (event) => { + if(!placeButton.getElementsByClassName('fa-spinner')[0]){ + const spinner = document.createElement('i') + spinner.setAttribute('class', "fa fa-spinner fa-spin") + spinner.setAttribute('font-family', 'font awesome') + + placeButton.appendChild(spinner) + + let imageURL = event.target.previousElementSibling.src; + let image = L.distortableImageOverlay(imageURL); + map.imgGroup.addLayer(image) + + image.addEventListener('load', () => { + placeButton.removeChild(spinner) + }) + } + }) image.src = `${url.replace('metadata', 'download')}/${file.name}`; @@ -116,7 +144,7 @@

Images

imageCount++; } }); - responseText.innerHTML = imageCount ? `${imageCount} image(s) fetched successfully.` : 'No images found in the link provided...' + responseText.innerHTML = imageCount ? `${imageCount} image(s) fetched successfully from ${fetchedFrom.innerHTML}.` : 'No images found in the link provided...' } else { responseText.innerHTML = 'No images found in the link provided...' } @@ -133,13 +161,6 @@

Images

new bootstrap.Offcanvas(sidebar).show(); }); - document.addEventListener("click", (event) => { - if (event.target.classList.contains('place-button')) { - let imageURL = event.target.previousElementSibling.src; - let image = L.distortableImageOverlay(imageURL); - map.imgGroup.addLayer(image); - } - }); diff --git a/examples/index.html b/examples/index.html index 3f22aa681..992286a50 100644 --- a/examples/index.html +++ b/examples/index.html @@ -9,12 +9,15 @@ + + + + -
@@ -39,6 +42,6 @@ }); })(); - + diff --git a/examples/js/index.js b/examples/js/index.js new file mode 100644 index 000000000..bfea75aec --- /dev/null +++ b/examples/js/index.js @@ -0,0 +1,15 @@ +let map; + +(function() { + map = L.map('map').setView([51.505, -0.09], 13); + map.addGoogleMutant(); + + map.whenReady(function() { + img = L.distortableImageOverlay('example.jpg', { + selected: true, + fullResolutionSrc: 'large.jpg', + }).addTo(map); + }); +})(); + +L.Control.geocoder().addTo(map); diff --git a/examples/listeners.html b/examples/listeners.html index 4d99518f4..005aa568c 100644 --- a/examples/listeners.html +++ b/examples/listeners.html @@ -15,7 +15,6 @@ -
@@ -23,9 +22,8 @@
-