From 58c3d7e8b5919fe0e2951882a25ff7e2e7e7f115 Mon Sep 17 00:00:00 2001 From: Trevor Burgoyne Date: Mon, 27 Oct 2025 09:45:22 -0500 Subject: [PATCH 01/18] first stab at annotation list --- .github/tasks.md | 79 ++- demo/multi-class.html | 1 + dist/ulabel.js | 413 ++++++++++++++++ dist/ulabel.min.js | 2 +- src/configuration.ts | 4 + src/toolbox_items/annotation_list.ts | 686 +++++++++++++++++++++++++++ 6 files changed, 1140 insertions(+), 45 deletions(-) create mode 100644 src/toolbox_items/annotation_list.ts diff --git a/.github/tasks.md b/.github/tasks.md index 22b61a96..4d6b1881 100644 --- a/.github/tasks.md +++ b/.github/tasks.md @@ -1,48 +1,39 @@ ## Tasks -- [x] Read the description in [#164](https://github.com/SenteraLLC/ulabel/issues/164) +- [x] Read the description in [#234](https://github.com/SenteraLLC/ulabel/issues/234) - [x] Write a clear summary of the requested change - - [x] Propose some options of how to proceed. Wait for user input to decide which to try first. + - [x] Break the requested feature down into concrete steps. Add the steps to the tasks list, and then start working on then one by one. -### Decision: Proceeding with Option 3 (Webpack modernization + dependency cleanup) +### Summary +Create an annotation list toolbox item that displays all annotations in a list format, similar to other annotation tools. The list should: +- Display each annotation (by ID or index) +- Allow show/hide of deprecated annotations (default: hide) +- Support grouping by class +- Enable clicking to "fly to" the annotation +- Show annotation labels/IDs (on hover or drawn on canvas) +- Display "current idx / total" when navigating through annotations +- Highlight annotations when hovering in the list -#### Step 1: Move dependencies to devDependencies -- [x] Move `@turf/turf` from dependencies to devDependencies -- [x] Move `jquery` from dependencies to devDependencies -- [x] Move `polygon-clipping` from dependencies to devDependencies -- [x] Move `uuidv4` from dependencies to devDependencies -- [x] Test: Run `npm install` and verify it works -- [x] Test: Run `npm run build` and verify output is identical (both files 1039.6 KB) - -#### Step 2: Enable and modernize webpack minification ✅ COMPLETE -- [x] Remove commented-out UglifyJsPlugin code (deprecated) -- [x] Enable webpack 5's built-in TerserPlugin for minification -- [x] Configure it to only minify `ulabel.min.js`, not `ulabel.js` -- [x] Test: Run `npm run build` and verify both files are created -- [x] Test: Verify `ulabel.js` is NOT minified (readable) - 2.33 MB with webpack runtime and formatted code -- [x] Test: Verify `ulabel.min.js` IS minified (smaller size) - 1.02 MB minified -- [x] Test: Run `npm run lint` - No errors -- [x] Note: File size difference (2.33 MB vs 1.02 MB) is expected - readable version includes webpack runtime overhead - -#### Step 3: Verify and document ✅ COMPLETE -- [x] Compare file sizes before/after - - Before: Both files 1039 KB (both minified, minification was disabled) - - After: ulabel.js 2.33 MB (readable), ulabel.min.js 1.02 MB (minified) - - Result: Minification now working correctly, file size increase for non-min version is expected -- [x] Update CHANGELOG.md with changes -- [x] Document any findings or recommendations - -#### Step 4: Security and dependency updates ✅ COMPLETE -- [x] Run `npm audit` to identify vulnerabilities -- [x] Fix 12 vulnerabilities using `npm audit fix` -- [x] Apply breaking changes for remaining issues with `npm audit fix --force` -- [x] Update `typescript-eslint` packages to be compatible with ESLint 9.37.0 -- [x] Fix linting issues in `tests/e2e/fixtures.js` -- [x] Verify all tests still pass (28 unit tests + 36 e2e tests) -- [x] Final audit: 0 vulnerabilities - -#### Step 5: Configure package exports for minified by default ✅ COMPLETE -- [x] Update `main` and `module` fields to point to `dist/ulabel.min.js` -- [x] Add `exports` field with options: `.` (minified), `./min` (minified), `./debug` (unminified) -- [x] Update `unpkg` field to serve minified version by default -- [x] Update README.md with usage examples for both minified and unminified versions -- [x] Document clear import patterns for users \ No newline at end of file +### Implementation Steps +- [x] 1. Research existing toolbox items and understand the toolbox structure + - [x] Read `src/toolbox.ts` to understand how toolbox items work + - [x] Review existing toolbox items in `src/toolbox_items/` + - [x] Understand how annotation data is accessed and structured +- [x] 2. Create the basic annotation list toolbox item + - [x] Create new file `src/toolbox_items/annotation_list.ts` + - [x] Implement basic UI structure (container, list elements) + - [x] Register the toolbox item in the main toolbox +- [x] 3. Implement core list functionality + - [x] Display all annotations with their ID/index + - [x] Add show/hide toggle for deprecated annotations (default: hide) + - [x] Add option to group by class +- [ ] 4. Implement click-to-fly functionality + - [x] Integrate with existing "fly to" functionality from PR #230 + - [x] Add click handlers to list items + - [ ] Display "current idx / total" indicator +- [ ] 5. Implement hover highlighting + - [x] Add hover handlers to list items + - [x] Integrate with existing annotation highlighting system + - [ ] Ensure bidirectional highlighting (list hover → canvas, canvas hover → list) +- [x] 6. Implement annotation label display + - [x] Add option to show labels on annotations + - [ ] Support persistent label display on canvas diff --git a/demo/multi-class.html b/demo/multi-class.html index c66a3ac9..571c5bca 100644 --- a/demo/multi-class.html +++ b/demo/multi-class.html @@ -120,6 +120,7 @@ "toolbox_order": [ AllowedToolboxItem.SubmitButtons, AllowedToolboxItem.ModeSelect, + AllowedToolboxItem.AnnotationList, AllowedToolboxItem.ImageFilters, AllowedToolboxItem.ZoomPan, AllowedToolboxItem.AnnotationID, diff --git a/dist/ulabel.js b/dist/ulabel.js index 9fd89b48..c5f330fb 100644 --- a/dist/ulabel.js +++ b/dist/ulabel.js @@ -810,6 +810,7 @@ exports.Configuration = exports.DEFAULT_IMAGE_FILTERS_CONFIG = exports.DEFAULT_F var toolbox_1 = __webpack_require__(3045); var submit_buttons_1 = __webpack_require__(8035); var image_filters_1 = __webpack_require__(6840); +var annotation_list_1 = __webpack_require__(931); var utilities_1 = __webpack_require__(8286); /* eslint-disable @stylistic/no-multi-spaces */ var AllowedToolboxItem; @@ -825,6 +826,7 @@ var AllowedToolboxItem; AllowedToolboxItem[AllowedToolboxItem["FilterDistance"] = 8] = "FilterDistance"; AllowedToolboxItem[AllowedToolboxItem["Brush"] = 9] = "Brush"; AllowedToolboxItem[AllowedToolboxItem["ImageFilters"] = 10] = "ImageFilters"; + AllowedToolboxItem[AllowedToolboxItem["AnnotationList"] = 11] = "AnnotationList"; })(AllowedToolboxItem || (exports.AllowedToolboxItem = AllowedToolboxItem = {})); /* eslint-enable @stylistic/no-multi-spaces */ exports.DEFAULT_N_ANNOS_PER_CANVAS = 100; @@ -916,6 +918,7 @@ var Configuration = /** @class */ (function () { [AllowedToolboxItem.FilterDistance, toolbox_1.FilterPointDistanceFromRow], [AllowedToolboxItem.Brush, toolbox_1.BrushToolboxItem], [AllowedToolboxItem.ImageFilters, image_filters_1.ImageFiltersToolboxItem], + [AllowedToolboxItem.AnnotationList, annotation_list_1.AnnotationListToolboxItem], ]); // Default toolbox order used when the user doesn't specify one this.toolbox_order = [ @@ -927,6 +930,7 @@ var Configuration = /** @class */ (function () { AllowedToolboxItem.AnnotationID, AllowedToolboxItem.RecolorActive, AllowedToolboxItem.ClassCounter, + AllowedToolboxItem.AnnotationList, AllowedToolboxItem.KeypointSlider, AllowedToolboxItem.SubmitButtons, ]; @@ -1059,6 +1063,415 @@ if ($defineProperty) { module.exports = $defineProperty; +/***/ }), + +/***/ 931: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AnnotationListToolboxItem = void 0; +var toolbox_1 = __webpack_require__(3045); +/** + * Toolbox item for displaying and navigating annotations in a list + */ +var AnnotationListToolboxItem = /** @class */ (function (_super) { + __extends(AnnotationListToolboxItem, _super); + function AnnotationListToolboxItem(ulabel) { + var _this = _super.call(this) || this; + _this.show_deprecated = false; + _this.group_by_class = false; + _this.is_collapsed = false; + _this.show_labels = false; + _this.ulabel = ulabel; + _this.add_styles(); + _this.add_event_listeners(); + return _this; + } + /** + * Create the css for this ToolboxItem and append it to the page. + */ + AnnotationListToolboxItem.prototype.add_styles = function () { + var css = "\n #toolbox .annotation-list-toolbox-item {\n padding: 0.5rem 0;\n }\n\n #toolbox .annotation-list-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 1.5rem;\n cursor: pointer;\n }\n\n #toolbox .annotation-list-title {\n margin: 0.5rem 0;\n font-size: 1rem;\n font-weight: 600;\n }\n\n #toolbox .annotation-list-toggle-btn {\n background: none;\n border: none;\n color: inherit;\n font-size: 1rem;\n cursor: pointer;\n padding: 0.25rem;\n width: 24px;\n height: 24px;\n }\n\n #toolbox .annotation-list-toggle-btn:hover {\n background-color: rgba(0, 128, 255, 0.1);\n }\n\n #toolbox .annotation-list-content {\n display: block;\n padding: 0 1rem;\n }\n\n #toolbox .annotation-list-options {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding: 0.5rem;\n font-size: 0.85rem;\n }\n\n #toolbox .annotation-list-option {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n #toolbox .annotation-list-option input[type=\"checkbox\"] {\n cursor: pointer;\n }\n\n #toolbox .annotation-list-option label {\n cursor: pointer;\n user-select: none;\n }\n\n #toolbox .annotation-list-container {\n max-height: 300px;\n overflow-y: auto;\n border: 1px solid rgba(128, 128, 128, 0.3);\n border-radius: 4px;\n margin: 0.5rem 0;\n }\n\n #toolbox .annotation-list-navigation {\n padding: 0.5rem;\n text-align: center;\n font-size: 0.85rem;\n color: gray;\n border-bottom: 1px solid rgba(128, 128, 128, 0.2);\n }\n\n #toolbox .annotation-list-empty {\n padding: 1rem;\n text-align: center;\n color: gray;\n font-style: italic;\n }\n\n #toolbox .annotation-list-item {\n padding: 0.5rem;\n border-bottom: 1px solid rgba(128, 128, 128, 0.2);\n cursor: pointer;\n transition: background-color 150ms;\n }\n\n #toolbox .annotation-list-item:last-child {\n border-bottom: none;\n }\n\n #toolbox .annotation-list-item:hover {\n background-color: rgba(0, 128, 255, 0.1);\n }\n\n #toolbox .annotation-list-item.highlighted {\n background-color: rgba(0, 128, 255, 0.2);\n }\n\n #toolbox .annotation-list-item-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n #toolbox .annotation-list-item-color {\n width: 12px;\n height: 12px;\n border-radius: 2px;\n flex-shrink: 0;\n }\n\n #toolbox .annotation-list-item-text {\n flex: 1;\n font-size: 0.85rem;\n }\n\n #toolbox .annotation-list-item-class {\n font-weight: 600;\n }\n\n #toolbox .annotation-list-item-id {\n color: gray;\n font-size: 0.75rem;\n }\n\n #toolbox .annotation-list-class-group {\n margin-bottom: 0.5rem;\n }\n\n #toolbox .annotation-list-class-group-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem;\n background-color: rgba(128, 128, 128, 0.1);\n font-weight: 600;\n font-size: 0.9rem;\n }\n\n #toolbox .annotation-list-class-group-color {\n width: 14px;\n height: 14px;\n border-radius: 2px;\n flex-shrink: 0;\n }\n\n #toolbox .annotation-list-class-group-count {\n margin-left: auto;\n color: gray;\n font-size: 0.8rem;\n font-weight: normal;\n }\n\n .annotation-label {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.7);\n color: white;\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 12px;\n font-weight: bold;\n pointer-events: none;\n z-index: 1000;\n white-space: nowrap;\n }\n\n .ulabel-night .annotation-label {\n background-color: rgba(255, 255, 255, 0.8);\n color: black;\n }\n\n .ulabel-night #toolbox .annotation-list-container {\n border-color: rgba(255, 255, 255, 0.3);\n }\n\n .ulabel-night #toolbox .annotation-list-item {\n border-bottom-color: rgba(255, 255, 255, 0.2);\n }\n\n .ulabel-night #toolbox .annotation-list-item:hover {\n background-color: rgba(100, 149, 237, 0.2);\n }\n\n .ulabel-night #toolbox .annotation-list-item.highlighted {\n background-color: rgba(100, 149, 237, 0.3);\n }\n\n .ulabel-night #toolbox .annotation-list-class-group-header {\n background-color: rgba(255, 255, 255, 0.1);\n }\n "; + var style_id = "annotation-list-toolbox-styles"; + if (document.getElementById(style_id)) + return; + var head = document.head || document.querySelector("head"); + var style = document.createElement("style"); + style.appendChild(document.createTextNode(css)); + style.id = style_id; + head.appendChild(style); + }; + /** + * Initialize event listeners for this toolbox item + */ + AnnotationListToolboxItem.prototype.add_event_listeners = function () { + var _this = this; + // Toggle button to show/hide annotation list + $(document).on("click.ulabel", "#annotation-list-toggle", function () { + _this.is_collapsed = !_this.is_collapsed; + _this.update_list(); + }); + // Show/hide deprecated annotations checkbox + $(document).on("change.ulabel", "#annotation-list-show-deprecated", function (e) { + _this.show_deprecated = e.target.checked; + _this.update_list(); + }); + // Group by class checkbox + $(document).on("change.ulabel", "#annotation-list-group-by-class", function (e) { + _this.group_by_class = e.target.checked; + _this.update_list(); + }); + // Show labels checkbox + $(document).on("change.ulabel", "#annotation-list-show-labels", function (e) { + _this.show_labels = e.target.checked; + if (_this.show_labels) { + _this.render_all_labels(); + } + else { + _this.clear_all_labels(); + } + }); + // Click on annotation list item to fly to it + $(document).on("click.ulabel", ".annotation-list-item", function (e) { + var annotation_id = $(e.currentTarget).data("annotation-id"); + var annotation_idx = $(e.currentTarget).data("annotation-idx"); + if (annotation_id) { + _this.ulabel.fly_to_annotation_id(annotation_id, null, _this.ulabel.config.fly_to_max_zoom); + _this.update_navigation_indicator(annotation_idx); + } + }); + // Hover on annotation list item to highlight annotation on canvas + $(document).on("mouseenter.ulabel", ".annotation-list-item", function (e) { + var annotation_id = $(e.currentTarget).data("annotation-id"); + if (annotation_id) { + // Highlight this list item + $(".annotation-list-item").removeClass("highlighted"); + $(e.currentTarget).addClass("highlighted"); + // Show the edit suggestion for this annotation on the canvas + _this.ulabel.suggest_edits(null, annotation_id, true); + } + }); + // Remove highlight when mouse leaves the list item + $(document).on("mouseleave.ulabel", ".annotation-list-item", function () { + $(".annotation-list-item").removeClass("highlighted"); + // Clear the edit suggestion + _this.ulabel.hide_global_edit_suggestion(); + _this.ulabel.hide_edit_suggestion(); + }); + // Listen for canvas hover changes to sync list highlighting + // This creates bidirectional highlighting between canvas and list + $(document).on("mousemove.ulabel", "#".concat(this.ulabel.config.canvas_fid_pfx, "--").concat(this.ulabel.state.current_subtask), function () { + // Delay the sync slightly to allow suggest_edits to update first + setTimeout(function () { + _this.sync_highlight_from_canvas(); + }, 10); + }); + }; + /** + * Update the navigation indicator showing current position + */ + AnnotationListToolboxItem.prototype.update_navigation_indicator = function (current_idx) { + var nav_indicator = document.querySelector("#annotation-list-navigation"); + if (!nav_indicator) + return; + var current_subtask = this.ulabel.get_current_subtask(); + if (!current_subtask) + return; + var annotations = this.get_filtered_annotations(current_subtask); + var total = annotations.length; + if (total === 0) { + nav_indicator.style.display = "none"; + return; + } + nav_indicator.style.display = "block"; + nav_indicator.textContent = "".concat(current_idx + 1, " / ").concat(total); + // Hide the indicator after 2 seconds + setTimeout(function () { + nav_indicator.style.display = "none"; + }, 2000); + }; + /** + * Render labels on all annotations + */ + AnnotationListToolboxItem.prototype.render_all_labels = function () { + // Clear existing labels first + this.clear_all_labels(); + var current_subtask = this.ulabel.get_current_subtask(); + if (!current_subtask) + return; + var annotations = this.get_filtered_annotations(current_subtask); + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + this.render_annotation_label(annotation, i + 1); + } + }; + /** + * Render a label for a single annotation + */ + AnnotationListToolboxItem.prototype.render_annotation_label = function (annotation, display_idx) { + // Skip if annotation doesn't have a containing box + if (!annotation.containing_box) + return; + var bbox = annotation.containing_box; + var class_id = this.get_annotation_class_id(annotation); + var current_subtask = this.ulabel.get_current_subtask(); + var class_def = current_subtask.class_defs.find(function (def) { return def.id === class_id; }); + var class_name = class_def ? class_def.name : "Unknown"; + // Calculate scale using the same method as get_empirical_scale + var imwrap_width = $("#" + this.ulabel.config.imwrap_id).width(); + var scale = imwrap_width / this.ulabel.config.image_width; + var annbox = $("#" + this.ulabel.config.annbox_id); + var x = bbox.tlx * scale - annbox.scrollLeft(); + var y = bbox.tly * scale - annbox.scrollTop(); + // Create label element + var label = document.createElement("div"); + label.className = "annotation-label"; + label.id = "annotation-label-".concat(annotation.id); + label.textContent = "".concat(class_name, " #").concat(display_idx); + label.style.left = "".concat(x, "px"); + label.style.top = "".concat(y - 20, "px"); // Position above the annotation + // Add to annbox + annbox.append(label); + }; + /** + * Clear all annotation labels + */ + AnnotationListToolboxItem.prototype.clear_all_labels = function () { + $(".annotation-label").remove(); + }; + /** + * Update labels when zooming/panning + */ + AnnotationListToolboxItem.prototype.update_label_positions = function () { + if (!this.show_labels) + return; + var current_subtask = this.ulabel.get_current_subtask(); + if (!current_subtask) + return; + var annotations = this.get_filtered_annotations(current_subtask); + // Calculate scale using the same method as get_empirical_scale + var imwrap_width = $("#" + this.ulabel.config.imwrap_id).width(); + var scale = imwrap_width / this.ulabel.config.image_width; + var annbox = $("#" + this.ulabel.config.annbox_id); + for (var i = 0; i < annotations.length; i++) { + var annotation = annotations[i]; + if (!annotation.containing_box) + continue; + var bbox = annotation.containing_box; + var x = bbox.tlx * scale - annbox.scrollLeft(); + var y = bbox.tly * scale - annbox.scrollTop(); + var label = document.getElementById("annotation-label-".concat(annotation.id)); + if (label) { + label.style.left = "".concat(x, "px"); + label.style.top = "".concat(y - 20, "px"); + } + } + }; + /** + * Build and update the annotation list display + */ + AnnotationListToolboxItem.prototype.update_list = function () { + var content = document.querySelector("#annotation-list-content"); + var toggle_btn = document.querySelector("#annotation-list-toggle"); + if (!content || !toggle_btn) + return; + // Update toggle button + toggle_btn.innerText = this.is_collapsed ? "▼" : "▲"; + content.style.display = this.is_collapsed ? "none" : "block"; + if (this.is_collapsed) + return; + // Get current subtask + var current_subtask = this.ulabel.get_current_subtask(); + if (!current_subtask) + return; + // Build the list HTML + var list_container = document.querySelector("#annotation-list-container"); + if (!list_container) + return; + var annotations = this.get_filtered_annotations(current_subtask); + if (annotations.length === 0) { + list_container.innerHTML = "
No annotations
"; + return; + } + if (this.group_by_class) { + list_container.innerHTML = this.build_grouped_list_html(annotations, current_subtask); + } + else { + list_container.innerHTML = this.build_flat_list_html(annotations, current_subtask); + } + }; + /** + * Get filtered annotations based on current options + */ + AnnotationListToolboxItem.prototype.get_filtered_annotations = function (subtask) { + var annotations = []; + for (var _i = 0, _a = subtask.annotations.ordering; _i < _a.length; _i++) { + var annotation_id = _a[_i]; + var annotation = subtask.annotations.access[annotation_id]; + // Skip deprecated if option is disabled + if (!this.show_deprecated && annotation.deprecated) { + continue; + } + annotations.push(annotation); + } + return annotations; + }; + /** + * Build HTML for flat (non-grouped) list + */ + AnnotationListToolboxItem.prototype.build_flat_list_html = function (annotations, subtask) { + var html = ""; + var _loop_1 = function (i) { + var annotation = annotations[i]; + var class_id = this_1.get_annotation_class_id(annotation); + var class_def = subtask.class_defs.find(function (def) { return def.id === class_id; }); + var class_name = class_def ? class_def.name : "Unknown"; + var color = this_1.ulabel.color_info[class_id] || "#cccccc"; + html += "\n
\n
\n
\n
\n ").concat(class_name, "\n #").concat(i + 1, "\n
\n
\n
\n "); + }; + var this_1 = this; + for (var i = 0; i < annotations.length; i++) { + _loop_1(i); + } + return html; + }; + /** + * Build HTML for grouped (by class) list + */ + AnnotationListToolboxItem.prototype.build_grouped_list_html = function (annotations, subtask) { + // Group annotations by class + var groups = {}; + for (var _i = 0, annotations_1 = annotations; _i < annotations_1.length; _i++) { + var annotation = annotations_1[_i]; + var class_id = this.get_annotation_class_id(annotation); + if (!groups[class_id]) { + groups[class_id] = []; + } + groups[class_id].push(annotation); + } + // Build HTML for each group + var html = ""; + var _loop_2 = function (class_id_str) { + var class_id = parseInt(class_id_str); + var group_annotations = groups[class_id]; + var class_def = subtask.class_defs.find(function (def) { return def.id === class_id; }); + var class_name = class_def ? class_def.name : "Unknown"; + var color = this_2.ulabel.color_info[class_id] || "#cccccc"; + html += "\n
\n
\n
\n ").concat(class_name, "\n (").concat(group_annotations.length, ")\n
\n "); + for (var i = 0; i < group_annotations.length; i++) { + var annotation = group_annotations[i]; + var overall_idx = annotations.indexOf(annotation); + html += "\n
\n
\n
\n #").concat(i + 1, "\n
\n
\n
\n "); + } + html += "
"; + }; + var this_2 = this; + for (var class_id_str in groups) { + _loop_2(class_id_str); + } + return html; + }; + /** + * Get the primary class ID for an annotation + */ + AnnotationListToolboxItem.prototype.get_annotation_class_id = function (annotation) { + if (!annotation.classification_payloads || annotation.classification_payloads.length === 0) { + return 0; + } + // Find the classification payload with the highest confidence + var max_confidence = -1; + var class_id = annotation.classification_payloads[0].class_id; + for (var _i = 0, _a = annotation.classification_payloads; _i < _a.length; _i++) { + var payload = _a[_i]; + if (payload.confidence > max_confidence) { + max_confidence = payload.confidence; + class_id = payload.class_id; + } + } + return class_id; + }; + /** + * Get the HTML for this toolbox item + */ + AnnotationListToolboxItem.prototype.get_html = function () { + return "\n
\n
\n
\n

Annotation List

\n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
No annotations
\n
\n
\n
\n "; + }; + /** + * Returns a unique string for this toolbox item + */ + AnnotationListToolboxItem.prototype.get_toolbox_item_type = function () { + return "AnnotationList"; + }; + /** + * Code called after all of ULabel's constructor and initialization code is called + */ + AnnotationListToolboxItem.prototype.after_init = function () { + // Initial list update + this.update_list(); + }; + /** + * Update the list when annotations change + */ + AnnotationListToolboxItem.prototype.redraw_update = function () { + this.update_list(); + this.sync_highlight_from_canvas(); + if (this.show_labels) { + this.render_all_labels(); + } + }; + /** + * Update the list when frame changes + */ + AnnotationListToolboxItem.prototype.frame_update = function () { + this.update_list(); + this.sync_highlight_from_canvas(); + if (this.show_labels) { + this.render_all_labels(); + } + }; + /** + * Sync highlighting from canvas hover to list + * Called when the edit_candidate changes on the canvas + */ + AnnotationListToolboxItem.prototype.sync_highlight_from_canvas = function () { + var current_subtask = this.ulabel.get_current_subtask(); + if (!current_subtask) + return; + var edit_candidate = current_subtask.state.edit_candidate; + // Remove all highlights first + $(".annotation-list-item").removeClass("highlighted"); + // If there's an edit candidate, highlight its list item + if (edit_candidate && edit_candidate.annid) { + var list_item = $(".annotation-list-item[data-annotation-id=\"".concat(edit_candidate.annid, "\"]")); + if (list_item.length > 0) { + list_item.addClass("highlighted"); + // Optionally scroll the item into view + list_item[0].scrollIntoView({ block: "nearest", behavior: "smooth" }); + } + } + }; + return AnnotationListToolboxItem; +}(toolbox_1.ToolboxItem)); +exports.AnnotationListToolboxItem = AnnotationListToolboxItem; + + /***/ }), /***/ 1002: diff --git a/dist/ulabel.min.js b/dist/ulabel.min.js index 80a413a8..5f8854bf 100644 --- a/dist/ulabel.min.js +++ b/dist/ulabel.min.js @@ -1,2 +1,2 @@ /*! For license information please see ulabel.min.js.LICENSE.txt */ -(()=>{var t={39:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function i(t){this.message=t||""}function r(t){this.message=t||""}function o(){}function s(t){return null===t?At:t.color}function a(t){return null===t?null:t.parent}function l(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function f(){}function h(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);ie.x?1:this.ye.y?1:0},k.prototype.clone=function(){},k.prototype.copy=function(){return new k(this)},k.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},k.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},k.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},k.prototype.hashCode=function(){var t=17;return 37*(t=37*t+k.hashCode(this.x))+k.hashCode(this.y)},k.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},k.prototype.interfaces_=function(){return[x,w,e]},k.prototype.getClass=function(){return k},k.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=v.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return C},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return v.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(k,S);var C=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new m("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};C.prototype.compare=function(t,e){var n=t,i=e,r=C.compare(n.x,i.x);if(0!==r)return r;var o=C.compare(n.y,i.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(n.z,i.z)},C.prototype.interfaces_=function(){return[E]},C.prototype.getClass=function(){return C},C.compare=function(t,e){return te?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0};var I=function(){};I.prototype.create=function(){},I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I};var N=function(){},M={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.toLocationSymbol=function(t){switch(t){case N.EXTERIOR:return"e";case N.BOUNDARY:return"b";case N.INTERIOR:return"i";case N.NONE:return"-"}throw new m("Unknown location value: "+t)},M.INTERIOR.get=function(){return 0},M.BOUNDARY.get=function(){return 1},M.EXTERIOR.get=function(){return 2},M.NONE.get=function(){return-1},Object.defineProperties(N,M);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},O=function(){},P={LOG_10:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/O.LOG_10},O.min=function(t,e,n,i){var r=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return io?o:i}},O.wrap=function(t,e){return t<0?e- -t%e:t%e},O.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var i=arguments[1],r=arguments[2],o=arguments[3],s=arguments[0];return i>s&&(s=i),r>s&&(s=r),o>s&&(s=o),s}},O.average=function(t,e){return(t+e)/2},P.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(O,P);var T=function(t){this.str=t};T.prototype.append=function(t){this.str+=t},T.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},T.prototype.toString=function(t){return this.str};var A=function(t){this.value=t};A.prototype.intValue=function(){return this.value},A.prototype.compareTo=function(t){return this.valuet?1:0},A.isNaN=function(t){return Number.isNaN(t)};var R=function(){};R.isWhitespace=function(t){return t<=32&&t>=0||127===t},R.toUpperCase=function(t){return t.toUpperCase()};var D=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}},j={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};D.prototype.le=function(t){return(this._hi9?(c=!0,p="9"):p="0"+u,s.append(p),n=n.subtract(D.valueOf(u)).multiply(D.TEN),c&&n.selfAdd(D.TEN);var f=!0,h=D.magnitude(n._hi);if(h<0&&Math.abs(h)>=a-l&&(f=!1),!f)break}return e[0]=i,s.toString()},D.prototype.sqr=function(){return this.multiply(this)},D.prototype.doubleValue=function(){return this._hi+this._lo},D.prototype.subtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},D.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},D.prototype.isZero=function(){return 0===this._hi&&0===this._lo},D.prototype.selfSubtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},D.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},D.prototype.min=function(t){return this.le(t)?this:t},D.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,l=null,u=null,c=null,p=null;return l=this._hi/n,p=(r=(u=D.SPLIT*l)-(r=u-l))*(s=(p=D.SPLIT*n)-(s=p-n))-(c=l*n)+r*(a=n-s)+(o=l-r)*s+o*a,p=l+(u=(this._hi-c-p+this._lo-l*i)/n),this._hi=p,this._lo=l-p+u,this}},D.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},D.prototype.divide=function(){if(arguments[0]instanceof D){var t=arguments[0],e=null,n=null,i=null,r=null,o=null,s=null,a=null,l=null;return n=(o=this._hi/t._hi)-(e=(s=D.SPLIT*o)-(e=s-o)),l=e*(i=(l=D.SPLIT*t._hi)-(i=l-t._hi))-(a=o*t._hi)+e*(r=t._hi-i)+n*i+n*r,s=(this._hi-a-l+this._lo-o*t._lo)/t._hi,new D(l=o+s,o-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return v.isNaN(u)?D.createNaN():D.copy(this).selfDivide(u,0)}},D.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},D.prototype.pow=function(t){if(0===t)return D.valueOf(1);var e=new D(this),n=D.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},D.prototype.ceil=function(){if(this.isNaN())return D.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new D(t,e)},D.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},D.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},D.prototype.setValue=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},D.prototype.max=function(t){return this.ge(t)?this:t},D.prototype.sqrt=function(){if(this.isZero())return D.valueOf(0);if(this.isNegative())return D.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=D.valueOf(e),i=this.subtract(n.sqr())._hi*(.5*t);return n.add(i)},D.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,o=null,s=null,a=null;return o=(r=this._hi+e)-(s=r-this._hi),i=(a=(o=e-s+(this._hi-o))+this._lo)+(r-(n=r+a)),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(2===arguments.length){var l=arguments[0],u=arguments[1],c=null,p=null,f=null,h=null,d=null,g=null,_=null;h=this._hi+l,p=this._lo+u,d=h-(g=h-this._hi),f=p-(_=p-this._lo);var y=(c=h+(g=(d=l-g+(this._hi-d))+p))+(g=(f=u-_+(this._lo-f))+(g+(h-c))),m=g+(c-y);return this._hi=y,this._lo=m,this}},D.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,l=null,u=null;r=(l=D.SPLIT*this._hi)-this._hi,u=D.SPLIT*n,r=l-r,o=this._hi-r,s=u-n;var c=(l=this._hi*n)+(u=r*(s=u-s)-l+r*(a=n-s)+o*s+o*a+(this._hi*i+this._lo*n)),p=u+(r=l-c);return this._hi=c,this._lo=p,this}},D.prototype.selfSqr=function(){return this.selfMultiply(this)},D.prototype.floor=function(){if(this.isNaN())return D.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new D(t,e)},D.prototype.negate=function(){return this.isNaN()?this:new D(-this._hi,-this._lo)},D.prototype.clone=function(){},D.prototype.multiply=function(){if(arguments[0]instanceof D){var t=arguments[0];return t.isNaN()?D.createNaN():D.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return v.isNaN(e)?D.createNaN():D.copy(this).selfMultiply(e,0)}},D.prototype.isNaN=function(){return v.isNaN(this._hi)},D.prototype.intValue=function(){return Math.trunc(this._hi)},D.prototype.toString=function(){var t=D.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},D.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+D.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length;r=n+D.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+r:r},D.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;e=(r=1/this._hi)-(t=(o=D.SPLIT*r)-(t=o-r)),n=(a=D.SPLIT*this._hi)-this._hi;var l=r+(o=(1-(s=r*this._hi)-(a=t*(n=a-n)-s+t*(i=this._hi-n)+e*n+e*i)-r*this._lo)/this._hi);return new D(l,r-l+o)},D.prototype.toSciNotation=function(){if(this.isZero())return D.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=D.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},D.prototype.abs=function(){return this.isNaN()?D.NaN:this.isNegative()?this.negate():new D(this)},D.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},D.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},D.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},D.prototype.trunc=function(){return this.isNaN()?D.NaN:this.isPositive()?this.floor():this.ceil()},D.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},D.prototype.interfaces_=function(){return[e,x,w]},D.prototype.getClass=function(){return D},D.sqr=function(t){return D.valueOf(t).selfMultiply(t)},D.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return D.parse(t)}if("number"==typeof arguments[0])return new D(arguments[0])},D.sqrt=function(t){return D.valueOf(t).sqrt()},D.parse=function(t){for(var e=0,n=t.length;R.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n);){var u=t.charAt(e);if(e++,R.isDigit(u)){var c=u-"0";o.selfMultiply(D.TEN),o.selfAdd(c),s++}else{if("."!==u){if("e"===u||"E"===u){var p=t.substring(e);try{l=A.parseInt(p)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+p+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}a=s}}var f=o,h=s-a-l;if(0===h)f=o;else if(h>0){var d=D.TEN.pow(h);f=o.divide(d)}else if(h<0){var g=D.TEN.pow(-h);f=o.multiply(g)}return i?f.negate():f},D.createNaN=function(){return new D(v.NaN,v.NaN)},D.copy=function(t){return new D(t)},D.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},D.stringOfChar=function(t,e){for(var n=new T,i=0;i0){if(o<=0)return F.signum(s);i=r+o}else{if(!(r<0))return F.signum(s);if(o>=0)return F.signum(s);i=-r-o}var a=F.DP_SAFE_EPSILON*i;return s>=a||-s>=a?F.signum(s):2},F.signum=function(t){return t>0?1:t<0?-1:0},z.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,z);var B=function(){},G={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};G.X.get=function(){return 0},G.Y.get=function(){return 1},G.Z.get=function(){return 2},G.M.get=function(){return 3},B.prototype.setOrdinate=function(t,e,n){},B.prototype.size=function(){},B.prototype.getOrdinate=function(t,e){},B.prototype.getCoordinate=function(){},B.prototype.getCoordinateCopy=function(t){},B.prototype.getDimension=function(){},B.prototype.getX=function(t){},B.prototype.clone=function(){},B.prototype.expandEnvelope=function(t){},B.prototype.copy=function(){},B.prototype.getY=function(t){},B.prototype.toCoordinateArray=function(){},B.prototype.interfaces_=function(){return[w]},B.prototype.getClass=function(){return B},Object.defineProperties(B,G);var q=function(){},U=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(q),X=function(){};X.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;st._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},$.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof $){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||ithis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(nthis._maxx&&(this._maxx=n),ithis._maxy&&(this._maxy=i))}},$.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},$.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},$.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},$.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},$.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},$.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},$.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},$.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof $){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof k){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},$.prototype.centre=function(){return this.isNull()?null:new k((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},$.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof $){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];rt._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},$.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+k.hashCode(this._minx))+k.hashCode(this._maxx))+k.hashCode(this._miny))+k.hashCode(this._maxy)},$.prototype.interfaces_=function(){return[x,e]},$.prototype.getClass=function(){return $},$.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),l=Math.max(o.x,s.x),u=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(u>l||cl||cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;er?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},it.DONT_INTERSECT.get=function(){return 0},it.DO_INTERSECT.get=function(){return 1},it.COLLINEAR.get=function(){return 2},it.NO_INTERSECTION.get=function(){return 0},it.POINT_INTERSECTION.get=function(){return 1},it.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,it);var rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new $(this._inputLines[0][0],this._inputLines[0][1]),n=new $(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],i=arguments[2];if(this._isProper=!1,$.intersects(n,i,e)&&0===at.orientationIndex(n,i,e)&&0===at.orientationIndex(i,n,e))return this._isProper=!0,(e.equals(n)||e.equals(i))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},e.prototype.safeHCoordinateIntersection=function(t,n,i,r){var o=null;try{o=Y.intersection(t,n,i,r)}catch(s){if(!(s instanceof U))throw s;o=e.nearestEndpoint(t,n,i,r)}return o},e.prototype.intersection=function(t,n,i,r){var o=this.intersectionWithNormalization(t,n,i,r);return this.isInSegmentEnvelopes(o)||(o=new k(e.nearestEndpoint(t,n,i,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)1e-4&&X.out.println("Distance = "+r.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,i){var r=new k(t),o=new k(e),s=new k(n),a=new k(i),l=new k;this.normalizeToEnvCentre(r,o,s,a,l);var u=this.safeHCoordinateIntersection(r,o,s,a);return u.x+=l.x,u.y+=l.y,u},e.prototype.computeCollinearIntersection=function(e,n,i,r){var o=$.intersects(e,n,i),s=$.intersects(e,n,r),a=$.intersects(i,r,e),l=$.intersects(i,r,n);return o&&s?(this._intPt[0]=i,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||s||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&l?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&l?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,i,r){var o=t.xe.x?t.x:e.x,l=t.y>e.y?t.y:e.y,u=n.xi.x?n.x:i.x,f=n.y>i.y?n.y:i.y,h=((o>u?o:u)+(ac?s:c)+(l0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(i,r,e),l=at.orientationIndex(i,r,n);return a>0&&l>0||a<0&&l<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===l?this.computeCollinearIntersection(e,n,i,r):(0===o||0===s||0===a||0===l?(this._isProper=!1,e.equals2D(i)||e.equals2D(r)?this._intPt[0]=e:n.equals2D(i)||n.equals2D(r)?this._intPt[0]=n:0===o?this._intPt[0]=new k(i):0===s?this._intPt[0]=new k(r):0===a?this._intPt[0]=new k(e):0===l&&(this._intPt[0]=new k(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,i,r)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,i){var r=t,o=at.distancePointLine(t,n,i),s=at.distancePointLine(e,n,i);return s0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(e>0?i>0?e<=i||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?-e<=i?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0){if(!(n>0))return r;if(!(t<=n))return r}else{if(n>0)return-r;if(!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if((i-=(s=Math.floor(n/t))*e)<0)return-r;if(i>e)return r;if(t>(n-=s*t)+n){if(ei+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if((e-=(s=Math.floor(t/n))*i)<0)return r;if(e>i)return-r;if(n>(t-=s*n)+t){if(ie+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.prototype.countSegment=function(t,e){if(t.xi&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var r=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,l=ot.signOfDet2x2(r,o,s,a);if(0===l)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==N.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?N.BOUNDARY:this._crossingCount%2==1?N.INTERIOR:N.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof k&&L(arguments[1],B)){for(var t=arguments[1],e=new st(arguments[0]),n=new k,i=new k,r=1;r1||a<0||a>1)&&(r=!0)}}else r=!0;return r?O.min(at.distancePointLine(t,n,i),at.distancePointLine(e,n,i),at.distancePointLine(n,t,e),at.distancePointLine(i,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==N.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new k;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;sn.y&&(n=o,i=r)}var s=i;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==i);var a=i;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==i);var l=t[s],u=t[a];if(l.equals2D(n)||u.equals2D(n)||l.equals2D(u))return!1;var c=at.computeOrientation(l,n,u);return 0===c?l.x>u.x:c>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new m("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/l;return Math.abs(c)*Math.sqrt(l)}},at.isOnLine=function(t,e){for(var n=new rt,i=1;i0},yt.prototype.interfaces_=function(){return[dt]},yt.prototype.getClass=function(){return yt};var mt=function(){};mt.prototype.isInBoundary=function(t){return t>1},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var xt=function(){};xt.prototype.hasNext=function(){},xt.prototype.next=function(){},xt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(bt);(i.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,bt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new kt(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1&&this.get(this.size()-1).equals2D(r))return null;t.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],l=arguments[1];if(arguments[2])for(var u=0;u=0;c--)this.add(a[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof k){var p=arguments[0],f=arguments[1];if(!arguments[2]){var h=this.size();if(h>0){if(p>0&&this.get(p-1).equals2D(f))return null;if(py&&(m=-1);for(var v=_;v!==y;v+=m)this.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new k(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),Ct=function(){},It={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};It.ForwardComparator.get=function(){return Nt},It.BidirectionalComparator.get=function(){return Mt},It.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},Ct.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},Ct.extract=function(t,e,n){e=O.clamp(e,0,t.length);var i=(n=O.clamp(n,-1,t.length))-e+1;n<0&&(i=0),e>=t.length&&(i=0),ni.length)return 1;if(0===n.length)return 0;var r=Ct.compare(n,i);return Ct.isEqualReversed(n,i)?0:r},Mt.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.lengthi.length)return 1;if(0===n.length)return 0;for(var r=Ct.increasingDirection(n),o=Ct.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,l=0;l0))return e.value;e=e.right}}return null},p.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:At,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:At,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===u(a(a(t)))){var e=c(a(a(t)));1===s(e)?(l(a(t),At),l(e,At),l(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),l(a(t),At),l(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=u(a(a(t)));1===s(n)?(l(a(t),At),l(n,At),l(a(a(t)),1),t=a(a(t))):(t===u(a(t))&&(t=a(t),this.rotateRight(t)),l(a(t),At),l(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=At},p.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new Pt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},p.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,i=t;null!==n&&i===n.right;)i=n,n=n.parent;return n},p.prototype.size=function(){return this.size_};var Rt=function(){};Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},f.prototype=new o,(h.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=r.substring(0,o);i.add(s),o=(r=r.substring(o+n)).indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),l=0;l0)for(var o=r;o0&&i.append(" ");for(var o=0;o0&&i.append(","),i.append($t.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,B.X)===e.getOrdinate(n-1,B.X)&&e.getOrdinate(0,B.Y)===e.getOrdinate(n-1,B.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();Ht.copy(e,0,i,0,r);for(var o=r;o0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Wt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var le=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new T(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new le(t):new le(t,e)}},ce.prototype.interfaces_=function(){return[I,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},pe.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pe.instanceObject.get=function(){return new ce},Object.defineProperties(ce,pe);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Pt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),he=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};he.prototype.equals=function(t){if(!(t instanceof he))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},he.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new A(n).compareTo(new A(i))},he.prototype.getScale=function(){return this._scale},he.prototype.isFloating=function(){return this._modelType===he.FLOATING||this._modelType===he.FLOATING_SINGLE},he.prototype.getType=function(){return this._modelType},he.prototype.toString=function(){var t="UNKNOWN";return this._modelType===he.FLOATING?t="Floating":this._modelType===he.FLOATING_SINGLE?t="Floating-Single":this._modelType===he.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},he.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return v.isNaN(t)||this._modelType===he.FLOATING_SINGLE?t:this._modelType===he.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof k){var e=arguments[0];if(this._modelType===he.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},he.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===he.FLOATING?t=16:this._modelType===he.FLOATING_SINGLE?t=6:this._modelType===he.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},he.prototype.setScale=function(t){this._scale=Math.abs(t)},he.prototype.interfaces_=function(){return[e,x]},he.prototype.getClass=function(){return he},he.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(he,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},_e={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},_e.serialVersionUID.get=function(){return-552860263173159e4},_e.nameToTypeMap.get=function(){return new fe},Object.defineProperties(ge,_e),he.Type=ge,he.FIXED=new ge("FIXED"),he.FLOATING=new ge("FLOATING"),he.FLOATING_SINGLE=new ge("FLOATING SINGLE");var ye=function t(){this._precisionModel=new he,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],I)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof he&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},me={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new k(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new k(t.getMinX(),t.getMinY()),new k(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new k(t.getMinX(),t.getMinY()),new k(t.getMinX(),t.getMaxY()),new k(t.getMaxX(),t.getMaxY()),new k(t.getMaxX(),t.getMinY()),new k(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new Wt(this.getCoordinateSequenceFactory().create(t),this):L(t,B)?new Wt(t,this):void 0:new Wt(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new Ut(null,this):1===arguments.length?new Ut(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(ye.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(ye.toPolygonArray(t));if(a instanceof Wt)return this.createMultiLineString(ye.toLineStringArray(t));if(a instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],B))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(L(arguments[0],B)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Qt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new qt(null,this):1===arguments.length?new qt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new ie(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],B)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[t]},_.prototype.push=function(t){return this.array_.push(t),t},_.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},_.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},_.prototype.empty=function(){return 0===this.array_.length},_.prototype.isEmpty=function(){return this.empty()},_.prototype.search=function(t){return this.array_.indexOf(t)},_.prototype.size=function(){return this.array_.length},_.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&i===at.CLOCKWISE)&&(r=!0),r&&(this._minIndex=this._minIndex-1)},Ie.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var i=Se.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ie.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ie.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var Ne=function(t){function e(n,i){t.call(this,e.msgWithCoord(n,i)),this.pt=i?new k(i):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Me=function(){this.array_=[]};Me.prototype.addLast=function(t){this.array_.push(t)},Me.prototype.removeFirst=function(){return this.array_.shift()},Me.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Ie};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new Ne("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var r=t.getEdges().iterator();r.hasNext();){var o=r.next();o.setVisited(!0),this.copySymDepths(o)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new Pt,n=new Me,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new $,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),i=0;ithis.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=N.NONE,e[Se.RIGHT]=N.NONE,this.location=e}for(var n=0;n1&&t.append(N.toLocationSymbol(this.location[Se.LEFT])),t.append(N.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(N.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Oe.prototype.setLocations=function(t,e,n){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=n},Oe.prototype.get=function(t){return t1},Oe.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Te.prototype.addPoints=function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o=0;a--)this._pts.add(i[a])}},Te.prototype.isHole=function(){return this._isHole},Te.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Te.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Te.prototype.addHole=function(t){this._holes.add(t)},Te.prototype.isShell=function(){return null===this._shell},Te.prototype.getLabel=function(){return this._label},Te.prototype.getEdges=function(){return this._edges},Te.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Te.prototype.getShell=function(){return this._shell},Te.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Se.RIGHT);if(n===N.NONE)return null;if(this._label.getLocation(e)===N.NONE)return this._label.setLocation(e,n),null}},Te.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Te.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},De.prototype.isInResult=function(){return this._isInResult},De.prototype.isVisited=function(){return this._isVisited},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var je=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Pe(0,N.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=N.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==N.BOUNDARY&&(n=i)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Pe(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Pe)for(var n=arguments[0],i=0;i<2;i++){var r=this.computeMergedLocation(n,i);this._label.getLocation(i)===N.NONE&&this._label.setLocation(i,r)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=N.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case N.BOUNDARY:n=N.INTERIOR;break;case N.INTERIOR:default:n=N.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(De),Fe=function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof k){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof je){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return null===i?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===N.BOUNDARY&&e.add(i)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var ze=function(){},Be={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.isNorthern=function(t){return t===ze.NE||t===ze.NW},ze.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},ze.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=te?t:e)?3:n},ze.isInHalfPlane=function(t,e){return e===ze.SE?t===ze.SE||t===ze.SW:t===e||t===e+1},ze.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new m("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ze.NE:ze.SE:e>=0?ze.NW:ze.SW}if(arguments[0]instanceof k&&arguments[1]instanceof k){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new m("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?ze.NE:ze.SE:i.y>=n.y?ze.NW:ze.SW}},Be.NE.get=function(){return 0},Be.NW.get=function(){return 1},Be.SW.get=function(){return 2},Be.SE.get=function(){return 3},Object.defineProperties(ze,Be);var Ge=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this._edge=e,this.init(n,i),this._label=null}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=r,this.init(o,s),this._label=a}};Ge.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new Re(i,this._geometryFactory);e.add(r),r.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var p=!1;c.contains(i)&&at.isPointInRing(r,u.getCoordinates())&&(p=!0),p&&(null===o||s.contains(c))&&(o=l)}return o},Ye.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Xe.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new Et,o=this.buildMinimalEdgeRings(i,this._shellList,r);this.sortShellsAndHoles(o,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var $e=function(){};$e.prototype.getBounds=function(){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ve=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ve.prototype.getItem=function(){return this._item},Ve.prototype.getBounds=function(){return this._bounds},Ve.prototype.interfaces_=function(){return[$e,e]},Ve.prototype.getClass=function(){return Ve};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};He.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var We=function(){};We.prototype.visitItem=function(t){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Je=function(){};Je.prototype.insert=function(t,e){},Je.prototype.remove=function(t,e){},Je.prototype.query=function(){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Ke=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ze={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[$e,e]},Ke.prototype.getClass=function(){return Ke},Ze.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Ze);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?jt.sort(n,e):jt.sort(n);for(var i=t.iterator(),r=0,o=n.length;rtn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new m("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tn.prototype.expand=function(t,e,n,i){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=r.next(),s=new tn(o,e,this._itemDistance);s.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof Ve&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof Ve&&r.getItem()===e&&(n=r)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof Ke){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof Ve?n.add(r.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ve(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(et.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Ke?this.boundablesAtLevel(n,s,r):(et.isTrue(s instanceof Ve),-1===n&&r.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i)}else if(3===arguments.length)if(L(arguments[2],We)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var r=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;at&&(t=i)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var i=new Et(t);Qe.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new Et,i=0;i0;){var p=c.poll(),f=p.getDistance();if(f>=l)break;p.isLeaves()?(l=f,u=p):p.expandToQueue(c,l)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[2],d=new Ve(arguments[0],arguments[1]),g=new tn(this.getRoot(),d,h);return this.nearestNeighbour(g)[0]}},n.prototype.interfaces_=function(){return[Je,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},i.STRtreeNode.get=function(){return an},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,i){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(i.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,i){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(i.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,i),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new $(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.relativeSign=function(t,e){return te?1:0},ln.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=ln.relativeSign(e.x,n.x),r=ln.relativeSign(e.y,n.y);switch(t){case 0:return ln.compareValue(i,r);case 1:return ln.compareValue(r,i);case 2:return ln.compareValue(r,-i);case 3:return ln.compareValue(-i,r);case 4:return ln.compareValue(-i,-r);case 5:return ln.compareValue(-r,-i);case 6:return ln.compareValue(-r,i);case 7:return ln.compareValue(i,-r)}return et.shouldNeverReachHere("invalid octant value"),0},ln.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new k(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:ln.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[x]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new St;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof k&&arguments[1]instanceof k){var r=arguments[0],o=arguments[1],s=o.x-r.x,a=o.y-r.y;if(0===s&&0===a)throw new m("Cannot compute the octant for two identical points "+r);return pn.octant(s,a)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var hn=function(){};hn.prototype.addIntersection=function(t,e){},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn};var dn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:pn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],i=arguments[3],r=new k(arguments[0].getIntersection(i));this.addIntersection(r,n)}},dn.prototype.toString=function(){return Z.toLineString(new le(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof k){var i=arguments[0];return at.orientationIndex(this.p0,this.p1,i)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new rt;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof k){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new k(t);var e=this.projectionFactor(t),n=new k;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gn){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gn(s,a)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;return i<=0?v.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=v.MAX_VALUE,r=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(r=s.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||v.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof k){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new k;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gn.prototype.hashCode=function(){var t=v.doubleToLongBits(this.p0.x);t^=31*v.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return n^=31*v.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gn.prototype.interfaces_=function(){return[x,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new k((t.x+e.x)/2,(t.y+e.y)/2)},_n.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,_n);var yn=function(){this.tempEnv1=new $,this.tempEnv2=new $,this._overlapSeg1=new gn,this._overlapSeg2=new gn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var mn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};mn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mn.prototype.computeSelect=function(t,e,n,i){var r=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var i=ze.quadrant(t[n],t[n+1]),r=e+1;rn.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(xn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],i=arguments[3],r=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(r,e,o,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),kn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(i)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Sn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};kn.prototype.getEndCapStyle=function(){return this._endCapStyle},kn.prototype.isSingleSided=function(){return this._isSingleSided},kn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=kn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=kn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==kn.JOIN_ROUND&&(this._quadrantSegments=kn.DEFAULT_QUADRANT_SEGMENTS)},kn.prototype.getJoinStyle=function(){return this._joinStyle},kn.prototype.setJoinStyle=function(t){this._joinStyle=t},kn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},kn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},kn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},kn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},kn.prototype.getMitreLimit=function(){return this._mitreLimit},kn.prototype.setMitreLimit=function(t){this._mitreLimit=t},kn.prototype.setSingleSided=function(t){this._isSingleSided=t},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Sn.CAP_ROUND.get=function(){return 1},Sn.CAP_FLAT.get=function(){return 2},Sn.CAP_SQUARE.get=function(){return 3},Sn.JOIN_ROUND.get=function(){return 1},Sn.JOIN_MITRE.get=function(){return 2},Sn.JOIN_BEVEL.get=function(){return 3},Sn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Sn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Sn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(kn,Sn);var Cn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},In={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Cn.prototype.isDeletable=function(t,e,n,i){var r=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(r,o,s)&&!!this.isShallow(r,o,s,i)&&this.isShallowSampled(r,o,t,n,i)},Cn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),i=!1;n=0;i--)this.addPt(t[i])},Nn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},Ln.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var i=Ln.angle(e,t),r=Ln.angle(e,n);return Math.abs(r-i)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var i=Ln.angle(e,t),r=Ln.angle(e,n);return Ln.diff(i,r)},Ln.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var i=Ln.angle(e,t),r=Ln.angle(e,n)-i;return r<=-Math.PI?r+Ln.PI_TIMES_2:r>Math.PI?r-Ln.PI_TIMES_2:r},On.PI_TIMES_2.get=function(){return 2*Math.PI},On.PI_OVER_2.get=function(){return Math.PI/2},On.PI_OVER_4.get=function(){return Math.PI/4},On.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},On.CLOCKWISE.get=function(){return at.CLOCKWISE},On.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Ln,On);var Pn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new rt,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===kn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Tn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Pn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=at.computeOrientation(this._s0,this._s1,this._s2),i=n===at.CLOCKWISE&&this._side===Se.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Se.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Pn.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),i=new gn;this.computeOffsetSegment(n,Se.LEFT,this._distance,i);var r=new gn;this.computeOffsetSegment(n,Se.RIGHT,this._distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case kn.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case kn.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case kn.CAP_SQUARE:var l=new k;l.x=Math.abs(this._distance)*Math.cos(a),l.y=Math.abs(this._distance)*Math.sin(a);var u=new k(i.p1.x+l.x,i.p1.y+l.y),c=new k(r.p1.x+l.x,r.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},Pn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Pn.prototype.addMitreJoin=function(t,e,n,i){var r=!0,o=null;try{o=Y.intersection(e.p0,e.p1,n.p0,n.p1),(i<=0?1:o.distance(t)/Math.abs(i))>this._bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof U))throw t;o=new k(0,0),r=!1}r?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},Pn.prototype.addFilletCorner=function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),l=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,l);i===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,i,r),this._segList.addPt(n)},Pn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new k((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new k((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Pn.prototype.createCircle=function(t){var e=new k(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Pn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Pn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Nn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Pn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Pn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===kn.JOIN_BEVEL||this._bufParams.getJoinStyle()===kn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,at.CLOCKWISE,this._distance))},Pn.prototype.closeRing=function(){this._segList.closeRing()},Pn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Tn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Tn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Tn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Pn,Tn);var An=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};An.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&Ct.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var r=Cn.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,i),l=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment(),n.closeRing()},An.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===Se.RIGHT&&(i=-i);var r=Cn.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},An.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=Cn.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],Se.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Se.LEFT);for(var l=a-2;l>=0;l--)e.addNextSegment(s[l],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},An.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case kn.CAP_ROUND:e.createCircle(t);break;case kn.CAP_SQUARE:e.createSquare(t)}},An.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},An.prototype.getBufferParameters=function(){return this._bufParams},An.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},An.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return An.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},An.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var r=Cn.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=Cn.simplify(t,i),l=a.length-1;n.initSideSegments(a[0],a[1],Se.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Pn(this._precisionModel,this._bufParams,t)},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nr.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof k&&arguments[1]instanceof qe){for(var o=arguments[0],s=arguments[1],a=arguments[2],l=s.getEdge().getCoordinates(),u=0;uthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var c=s.getDepth(Se.LEFT);this._seg.p0.equals(l[u])||(c=s.getDepth(Se.RIGHT));var p=new jn(this._seg,c);a.add(p)}}else if(L(arguments[2],wt)&&arguments[0]instanceof k&&L(arguments[1],wt))for(var f=arguments[0],h=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(f,g,h)}},Rn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Dn.DepthSegment.get=function(){return jn},Object.defineProperties(Rn,Dn);var jn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};jn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},jn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},jn.prototype.toString=function(){return this._upwardSeg.toString()},jn.prototype.interfaces_=function(){return[x]},jn.prototype.getClass=function(){return jn};var Fn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Fn.prototype.area=function(){return Fn.area(this.p0,this.p1,this.p2)},Fn.prototype.signedArea=function(){return Fn.signedArea(this.p0,this.p1,this.p2)},Fn.prototype.interpolateZ=function(t){if(null===t)throw new m("Supplied point is null.");return Fn.interpolateZ(t,this.p0,this.p1,this.p2)},Fn.prototype.longestSideLength=function(){return Fn.longestSideLength(this.p0,this.p1,this.p2)},Fn.prototype.isAcute=function(){return Fn.isAcute(this.p0,this.p1,this.p2)},Fn.prototype.circumcentre=function(){return Fn.circumcentre(this.p0,this.p1,this.p2)},Fn.prototype.area3D=function(){return Fn.area3D(this.p0,this.p1,this.p2)},Fn.prototype.centroid=function(){return Fn.centroid(this.p0,this.p1,this.p2)},Fn.prototype.inCentre=function(){return Fn.inCentre(this.p0,this.p1,this.p2)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Fn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Fn.det=function(t,e,n,i){return t*i-e*n},Fn.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,l=n.y-o,u=i.y-o,c=s*u-a*l,p=t.x-r,f=t.y-o,h=(u*p-a*f)/c,d=(-l*p+s*f)/c;return e.z+h*(n.z-e.z)+d*(i.z-e.z)},Fn.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},Fn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},Fn.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,l=e.y-r,u=2*Fn.det(o,s,a,l),c=Fn.det(s,o*o+s*s,l,a*a+l*l),p=Fn.det(o,o*o+s*s,a,a*a+l*l);return new k(i-c/u,r+p/u)},Fn.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=new Y(t.x+n/2,t.y+i/2,1),o=new Y(t.x-i+n/2,t.y+n+i/2,1);return new Y(r,o)},Fn.angleBisector=function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new k(t.x+r*o,t.y+r*s)},Fn.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,l=n.z-t.z,u=r*l-o*a,c=o*s-i*l,p=i*a-r*s,f=u*u+c*c+p*p;return Math.sqrt(f)/2},Fn.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,r=(t.y+e.y+n.y)/3;return new k(i,r)},Fn.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o,a=(i*t.x+r*e.x+o*n.x)/s,l=(i*t.y+r*e.y+o*n.y)/s;return new k(a,l)};var zn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};zn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},zn.prototype.addPolygon=function(t){var e=this._distance,n=Se.LEFT;this._distance<0&&(e=-this._distance,n=Se.RIGHT);var i=t.getExteriorRing(),r=Ct.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance))return null;if(this._distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,N.EXTERIOR,N.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Se.opposite(n),N.INTERIOR,N.EXTERIOR)}},zn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Fn(t[0],t[1],t[2]),i=n.inCentre();return at.distancePointLine(i,n.p0,n.p1)=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=r,s=i,n=Se.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},zn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Ut||t instanceof ne||t instanceof qt)&&this.addCollection(t)},zn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},zn.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new i;var t=this._parent.getGeometryN(this._index++);return t instanceof qt?(this._subcollectionIterator=new Gn(t),this._subcollectionIterator.next()):t},Gn.prototype.remove=function(){throw new Error(this.getClass().getName())},Gn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Gn.prototype.interfaces_=function(){return[xt]},Gn.prototype.getClass=function(){return Gn},Gn.isAtomic=function(t){return!(t instanceof qt)};var qn=function(){this._geom=null;var t=arguments[0];this._geom=t};qn.prototype.locate=function(t){return qn.locate(t,this._geom)},qn.prototype.interfaces_=function(){return[Bn]},qn.prototype.getClass=function(){return qn},qn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},qn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!qn.isPointInRing(t,n))return!1;for(var i=0;i=0;n--){var i=this._edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Se.LEFT),i=t.getDepth(Se.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new Ne("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a=0;r--){var o=this._resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this._SCANNING_FOR_INCOMING}}i===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],i=0,r=this.iterator();r.hasNext();)r.next().getEdgeRing()===n&&i++;return i}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=N.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=N.INTERIOR;break}if(i.isInResult()){t=N.EXTERIOR;break}}}if(t===N.NONE)return null;for(var r=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(r===N.INTERIOR):(s.isInResult()&&(r=N.EXTERIOR),a.isInResult()&&(r=N.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Pe(N.NONE);for(var n=this.iterator();n.hasNext();)for(var i=n.next().getEdge().getLabel(),r=0;r<2;r++){var o=i.getLocation(r);o!==N.INTERIOR&&o!==N.BOUNDARY||this._label.setLocation(r,N.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Un),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new je(t,new Xn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ue),$n=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};$n.prototype.compareTo=function(t){var e=t;return $n.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},$n.prototype.interfaces_=function(){return[x]},$n.prototype.getClass=function(){return $n},$n.orientation=function(t){return 1===Ct.increasingDirection(t)},$n.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,l=e?0:t.length-1,u=i?0:n.length-1;;){var c=t[l].compareTo(n[u]);if(0!==c)return c;var p=(l+=r)===s,f=(u+=o)===a;if(p&&!f)return-1;if(!p&&f)return 1;if(p&&f)return 0}};var Vn=function(){this._edges=new Et,this._ocaMap=new p};Vn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},Vn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Vn.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new k(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new ni(o,new Pe(this.edge._label))},Kn.prototype.add=function(t,e,n){var i=new Jn(t,e,n),r=this._nodeMap.get(i);return null!==r?r:(this._nodeMap.put(i,i),i)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Zn=function(){};Zn.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new A(e));do{var i=this.findChainEnd(t,e);n.add(new A(i)),e=i}while(en?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(i=1),this._depth[t][n]=i}}},ti.prototype.getDelta=function(t){return this._depth[t][Se.RIGHT]-this._depth[t][Se.LEFT]},ti.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?N.EXTERIOR:N.INTERIOR},ti.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},ti.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);i!==N.EXTERIOR&&i!==N.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=ti.depthAtLocation(i):this._depth[e][n]+=ti.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1];arguments[2]===N.INTERIOR&&this._depth[r][o]++}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.depthAtLocation=function(t){return t===N.EXTERIOR?0:t===N.INTERIOR?1:ti.NULL_VALUE},ei.NULL_VALUE.get=function(){return-1},Object.defineProperties(ti,ei);var ni=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ti,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.pts=i,this._label=r}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Pe.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var i=!0,r=!0,o=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new $;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;ei||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ai.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new k(this._maxx,this._maxy),this._corner[1]=new k(this._minx,this._maxy),this._corner[2]=new k(this._minx,this._miny),this._corner[3]=new k(this._maxx,this._miny)},ai.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ai.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ai.prototype.getCoordinate=function(){return this._originalPt},ai.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ai.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ai.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new $(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ai.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},ai.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&i||t.equals(this._pt)||e.equals(this._pt)))))},ai.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},li.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ai,li);var ui=function(){this.tempEnv1=new $,this.selectedSegment=new gn};ui.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var ci=function(){this._index=null;var t=arguments[0];this._index=t},pi={HotPixelSnapAction:{configurable:!0}};ci.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=e.getSafeEnvelope(),o=new fi(e,n,i);return this._index.query(r,{interfaces_:function(){return[We]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},pi.HotPixelSnapAction.get=function(){return fi},Object.defineProperties(ci,pi);var fi=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ui),hi=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};hi.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ne))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],i=gi.precisionScaleFactor(this._argGeom,this._distance,n),r=new he(i);this.bufferFixedPrecision(r)}},gi.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===he.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gi.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gi.prototype.bufferOriginalPrecision=function(){try{var t=new ii(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},gi.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gi.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},gi.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gi(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],i=new gi(arguments[0]);return i.setQuadrantSegments(n),i.getResultGeometry(e)}if(arguments[2]instanceof kn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var r=arguments[1];return new gi(arguments[0],arguments[2]).getResultGeometry(r)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],l=new gi(arguments[0]);return l.setQuadrantSegments(s),l.setEndCapStyle(a),l.getResultGeometry(o)}},gi.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=O.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(r)/Math.log(10)+1);return Math.pow(10,o)},_i.CAP_ROUND.get=function(){return kn.CAP_ROUND},_i.CAP_BUTT.get=function(){return kn.CAP_FLAT},_i.CAP_FLAT.get=function(){return kn.CAP_FLAT},_i.CAP_SQUARE.get=function(){return kn.CAP_SQUARE},_i.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gi,_i);var yi=function(){this._pt=[new k,new k],this._distance=v.NaN,this._isNull=!0};yi.prototype.getCoordinates=function(){return this._pt},yi.prototype.getCoordinate=function(t){return this._pt[t]},yi.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);ithis._distance&&this.initialize(e,n,i)}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var mi=function(){};mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},mi.computeDistance=function(){if(arguments[2]instanceof yi&&arguments[0]instanceof Wt&&arguments[1]instanceof k)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),i=new gn,r=0;r0||this._isIn?N.INTERIOR:N.EXTERIOR)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Ci=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this._component=e,this._segIndex=n,this._pt=i}},Ii={INSIDE_AREA:{configurable:!0}};Ci.prototype.isInsideArea=function(){return this._segIndex===Ci.INSIDE_AREA},Ci.prototype.getCoordinate=function(){return this._pt},Ci.prototype.getGeometryComponent=function(){return this._component},Ci.prototype.getSegmentIndex=function(){return this._segIndex},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci},Ii.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ci,Ii);var Ni=function(t){this._pts=t||null};Ni.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Ni.prototype.interfaces_=function(){return[Bt]},Ni.prototype.getClass=function(){return Ni},Ni.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Qe.singletonList(t):Ni.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof qt&&e.apply(new Ni(n)),n}};var Mi=function(){this._locations=null;var t=arguments[0];this._locations=t};Mi.prototype.filter=function(t){(t instanceof Kt||t instanceof Wt||t instanceof Qt)&&this._locations.add(new Ci(t,0,t.getCoordinate()))},Mi.prototype.interfaces_=function(){return[Bt]},Mi.prototype.getClass=function(){return Mi},Mi.getLocations=function(t){var e=new Et;return t.apply(new Mi(e)),e};var Li=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Si,this._minDistanceLocation=null,this._minDistance=v.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=r}};Li.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=Ei.getPolygons(this._geom[e]);if(r.size()>0){var o=Mi.getLocations(this._geom[i]);if(this.computeContainmentDistance(o,r,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var s=arguments[0],a=arguments[1],l=arguments[2],u=0;uthis._minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;othis._minDistance)return null;for(var p=l.getCoordinates(),f=u.getCoordinates(),h=0;hthis._distance&&this.initialize(e,n,i)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var Pi=function(){};Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},Pi.computeDistance=function(){if(arguments[2]instanceof Oi&&arguments[0]instanceof Wt&&arguments[1]instanceof k)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new gn,r=t.getCoordinates(),o=0;o1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ti.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ti.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ti.prototype.computeOrientedDistance=function(t,e,n){var i=new Ri(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var r=new Di(e,this._densifyFrac);t.apply(r),n.setMaximum(r.getMaxPointDistance())}},Ti.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.distance=function(){if(2===arguments.length)return new Ti(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Ti(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Ai.MaxPointDistanceFilter.get=function(){return Ri},Ai.MaxDensifiedByFractionDistanceFilter.get=function(){return Di},Object.defineProperties(Ti,Ai);var Ri=function(){this._maxPtDist=new Oi,this._minPtDist=new Oi,this._euclideanDist=new Pi,this._geom=null;var t=arguments[0];this._geom=t};Ri.prototype.filter=function(t){this._minPtDist.initialize(),Pi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ri.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ri.prototype.interfaces_=function(){return[ht]},Ri.prototype.getClass=function(){return Ri};var Di=function(){this._maxPtDist=new Oi,this._minPtDist=new Oi,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Di.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),i=t.getCoordinate(e),r=(i.x-n.x)/this._numSubSegs,o=(i.y-n.y)/this._numSubSegs,s=0;sn){this._isValid=!1;var r=i.getCoordinates();this._errorLocation=r[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Z.toLineString(r[0],r[1])+")"}},ji.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=ji.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),ji.VERBOSE&&X.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},ji.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof qt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},ji.prototype.getErrorIndicator=function(){return this._errorIndicator},ji.prototype.checkMinimumDistance=function(t,e,n){var i=new Li(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},zi.prototype.report=function(t){if(!zi.VERBOSE)return null;X.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},zi.prototype.getErrorMessage=function(){return this._errorMsg},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi},zi.isValidMsg=function(t,e,n){var i=new zi(t,e,n);return i.isValid()?null:i.getErrorMessage()},zi.isValid=function(t,e,n){return!!new zi(t,e,n).isValid()},Bi.VERBOSE.get=function(){return!1},Bi.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(zi,Bi);var Gi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Gi.prototype.getCoordinates=function(){return this._pts},Gi.prototype.size=function(){return this._pts.length},Gi.prototype.getCoordinate=function(t){return this._pts[t]},Gi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Gi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Gi.prototype.setData=function(t){this._data=t},Gi.prototype.getData=function(){return this._data},Gi.prototype.toString=function(){return Z.toLineString(new le(this._pts))},Gi.prototype.interfaces_=function(){return[fn]},Gi.prototype.getClass=function(){return Gi};var qi=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qi.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qi.prototype.getIntersectionSegments=function(){return this._intSegments},qi.prototype.count=function(){return this._intersectionCount},qi.prototype.getIntersections=function(){return this._intersections},qi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qi.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qi.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,i))return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=r,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qi.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qi.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qi.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qi.prototype.interfaces_=function(){return[Hn]},qi.prototype.getClass=function(){return qi},qi.createAllIntersectionsFinder=function(t){var e=new qi(t);return e.setFindAllIntersections(!0),e},qi.createAnyIntersectionFinder=function(t){return new qi(t)},qi.createIntersectionCounter=function(t){var e=new qi(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ui=function(){this._li=new rt,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ui.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Ui.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ui.prototype.isValid=function(){return this.execute(),this._isValid},Ui.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ui.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ui.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ne(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ui.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Z.toLineString(t[0],t[1])+" and "+Z.toLineString(t[2],t[3])},Ui.prototype.interfaces_=function(){return[]},Ui.prototype.getClass=function(){return Ui},Ui.computeIntersections=function(t){var e=new Ui(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Xi=function t(){this._nv=null;var e=arguments[0];this._nv=new Ui(t.toSegmentStrings(e))};Xi.prototype.checkValid=function(){this._nv.checkValid()},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi},Xi.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Gi(i.getCoordinates(),i))}return e},Xi.checkValid=function(t){new Xi(t).checkValid()};var Yi=function(t){this._mapOp=t};Yi.prototype.map=function(t){for(var e=new Et,n=0;n0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var Wi=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Wt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=i}};Wi.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i=0&&t.add(o+1,new k(r),!1)}},Wi.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.MAX_VALUE,i=-1,r=0;re&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(Ji.computeOverlaySnapTolerance(r),Ji.computeOverlaySnapTolerance(o))}},Ji.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Ji.SNAP_PRECISION_FACTOR},Ji.snapToSelf=function(t,e,n){return new Ji(t).snapToSelf(e,n)},Ki.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ji,Ki);var Zi=function(t){function e(e,n,i){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==i&&i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wi(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hi),Qi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qi.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Qi.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qi.signExpBits(this._commonBits),this._isFirst=!1,null):Qi.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qi.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qi.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),i=n.substring(n.length-64);return i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]"}},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi},Qi.getBit=function(t,e){return t&1<>52},Qi.zeroLowerBits=function(t,e){return t&~((1<=0;i--){if(Qi.getBit(t,i)!==Qi.getBit(e,i))return n;n++}return 52};var tr=function(){this._commonCoord=null,this._ccFilter=new nr},er={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};tr.prototype.addCommonBits=function(t){var e=new ir(this._commonCoord);t.apply(e),t.geometryChanged()},tr.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new k(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ir(e);return t.apply(n),t.geometryChanged(),t},tr.prototype.getCommonCoordinate=function(){return this._commonCoord},tr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},er.CommonCoordinateFilter.get=function(){return nr},er.Translater.get=function(){return ir},Object.defineProperties(tr,er);var nr=function(){this._commonBitsX=new Qi,this._commonBitsY=new Qi};nr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},nr.prototype.getCommonCoordinate=function(){return new k(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},nr.prototype.interfaces_=function(){return[ht]},nr.prototype.getClass=function(){return nr};var ir=function(){this.trans=null;var t=arguments[0];this.trans=t};ir.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},ir.prototype.isDone=function(){return!1},ir.prototype.isGeometryChanged=function(){return!0},ir.prototype.interfaces_=function(){return[Gt]},ir.prototype.getClass=function(){return ir};var rr=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};rr.prototype.selfSnap=function(t){return new Ji(t).snapTo(t,this._snapTolerance)},rr.prototype.removeCommonBits=function(t){this._cbr=new tr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},rr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Cr.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rr.prototype.checkValid=function(t){t.isValid()||X.out.println("Snapped geometry is invalid")},rr.prototype.computeSnapTolerance=function(){this._snapTolerance=Ji.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rr.prototype.snap=function(t){var e=this.removeCommonBits(t);return Ji.snap(e[0],e[1],this._snapTolerance)},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.overlayOp=function(t,e,n){return new rr(t,e).getResultGeometry(n)},rr.union=function(t,e){return rr.overlayOp(t,e,Cr.UNION)},rr.intersection=function(t,e){return rr.overlayOp(t,e,Cr.INTERSECTION)},rr.symDifference=function(t,e){return rr.overlayOp(t,e,Cr.SYMDIFFERENCE)},rr.difference=function(t,e){return rr.overlayOp(t,e,Cr.DIFFERENCE)};var or=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};or.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=Cr.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;i=t}if(!n)try{e=rr.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?i:t}return e},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},or.overlayOp=function(t,e,n){return new or(t,e).getResultGeometry(n)},or.union=function(t,e){return or.overlayOp(t,e,Cr.UNION)},or.intersection=function(t,e){return or.overlayOp(t,e,Cr.INTERSECTION)},or.symDifference=function(t,e){return or.overlayOp(t,e,Cr.SYMDIFFERENCE)},or.difference=function(t,e){return or.overlayOp(t,e,Cr.DIFFERENCE)};var sr=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};sr.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var ar=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=i,this._xValue=r,this._obj=o}},lr={INSERT:{configurable:!0},DELETE:{configurable:!0}};ar.prototype.isDelete=function(){return this._eventType===ar.DELETE},ar.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ar.prototype.getObject=function(){return this._obj},ar.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},ar.prototype.getInsertEvent=function(){return this._insertEvent},ar.prototype.isInsert=function(){return this._eventType===ar.INSERT},ar.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ar.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ar.prototype.interfaces_=function(){return[x]},ar.prototype.getClass=function(){return ar},lr.INSERT.get=function(){return 1},lr.DELETE.get=function(){return 2},Object.defineProperties(ar,lr);var ur=function(){};ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};cr.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(cr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},cr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cr.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},cr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cr.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next().getCoordinate();if(t.isIntersection(i))return!0}return!1},cr.prototype.hasProperIntersection=function(){return this._hasProper},cr.prototype.hasIntersection=function(){return this._hasIntersection},cr.prototype.isDone=function(){return this._isDone},cr.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},cr.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},cr.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},cr.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pr=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.sort(this.events);for(var t=0;te||this._maxo?1:0},dr.prototype.interfaces_=function(){return[E]},dr.prototype.getClass=function(){return dr};var gr=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fr),_r=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fr),yr=function(){this._leaves=new Et,this._root=null,this._level=0};yr.prototype.buildTree=function(){Qe.sort(this._leaves,new fr.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yr.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gr(t,e,n))},yr.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yr.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yr.prototype.printNode=function(t){X.out.println(Z.toLineString(new k(t._min,this._level),new k(t._max,this._level)))},yr.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===N.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var i=Ct.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var r=e,o=n;at.isCCW(i)&&(r=n,o=e);var s=new ni(i,new Pe(this._argIndex,N.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,i[0],N.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var i=this._nodes.addNode(e),r=i.getLabel();null===r?i._label=new Pe(t,n):r.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pr},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Qt)this.addPolygon(e);else if(e instanceof Wt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Ut)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof qt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new vr(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?N.BOUNDARY:N.INTERIOR},e}(Xe),kr=function(){if(this._li=new rt,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Er(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Er(0,e,i),this._arg[1]=new Er(1,n,i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];r.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Er(0,r,s),this._arg[1]=new Er(1,o,s)}};kr.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},kr.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr};var Sr=function(){};Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Sr.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],Sr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,i=0;i=t.size()?null:t.get(e)},Tr.union=function(t){return new Tr(t).union()},Ar.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Tr,Ar);var Rr=function(){};Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cr.createEmptyResult(Cr.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),or.overlayOp(t,e,Cr.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=ke,t.OverlayOp=Cr,t.UnionOp=Rr,t.BufferOp=gi,Object.defineProperty(t,"__esModule",{value:!0})}(e)},41:(t,e,n)=>{"use strict";var i=n(592)(),r=n(453),o=i&&r("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(t){o=!1}var s=r("%SyntaxError%"),a=r("%TypeError%"),l=n(5795);t.exports=function(t,e,n){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],p=!!l&&l(t,e);if(o)o(t,e,{configurable:null===u&&p?p.configurable:!u,enumerable:null===i&&p?p.enumerable:!i,value:n,writable:null===r&&p?p.writable:!r});else{if(!c&&(i||r||u))throw new s("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=n}}},76:t=>{"use strict";t.exports=Function.prototype.call},301:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(8967),o=n(8506),s=i(n(9164));e.default=function(t,e){void 0===e&&(e={});for(var n=e.resolution||1e4,i=e.sharpness||.85,a=[],l=o.getGeom(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),u=new s.default({duration:n,points:l,sharpness:i}),c=function(t){var e=u.pos(t);Math.floor(t/100)%2==0&&a.push([e.x,e.y])},p=0;pd&&_.push(o.default(t,e,d,l).geometry.coordinates),s.lineString(_,f)}},414:t=>{"use strict";t.exports=Math.round},453:(t,e,n)=>{"use strict";var i,r=n(9612),o=n(9383),s=n(1237),a=n(9290),l=n(9538),u=n(8068),c=n(9675),p=n(5345),f=n(1514),h=n(8968),d=n(6188),g=n(8002),_=n(5880),y=n(414),m=n(3093),v=Function,b=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},x=n(5795),w=n(655),E=function(){throw new c},k=x?function(){try{return E}catch(t){try{return x(arguments,"callee").get}catch(t){return E}}}():E,S=n(4039)(),C=n(3628),I=n(1064),N=n(8648),M=n(1002),L=n(76),O={},P="undefined"!=typeof Uint8Array&&C?C(Uint8Array):i,T={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":S&&C?C([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":O,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&C?C(C([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&S&&C?C((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&S&&C?C((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&C?C(""[Symbol.iterator]()):i,"%Symbol%":S?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":k,"%TypedArray%":P,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":M,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":I,"%Math.abs%":f,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":g,"%Math.pow%":_,"%Math.round%":y,"%Math.sign%":m,"%Reflect.getPrototypeOf%":N};if(C)try{null.error}catch(t){var A=C(C(t));T["%Error.prototype%"]=A}var R=function t(e){var n;if("%AsyncFunction%"===e)n=b("async function () {}");else if("%GeneratorFunction%"===e)n=b("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=b("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(n=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&C&&(n=C(r.prototype))}return T[e]=n,n},D={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},j=n(6743),F=n(9957),z=j.call(L,Array.prototype.concat),B=j.call(M,Array.prototype.splice),G=j.call(L,String.prototype.replace),q=j.call(L,String.prototype.slice),U=j.call(L,RegExp.prototype.exec),X=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,$=function(t,e){var n,i=t;if(F(D,i)&&(i="%"+(n=D[i])[0]+"%"),F(T,i)){var r=T[i];if(r===O&&(r=R(i)),void 0===r&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:r}}throw new u("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=q(t,0,1),n=q(t,-1);if("%"===e&&"%"!==n)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var i=[];return G(t,X,function(t,e,n,r){i[i.length]=n?G(r,Y,"$1"):e||t}),i}(t),i=n.length>0?n[0]:"",r=$("%"+i+"%",e),o=r.name,s=r.value,a=!1,l=r.alias;l&&(i=l[0],B(n,z([0,1],l)));for(var p=1,f=!0;p=n.length){var _=x(s,h);s=(f=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:s[h]}else f=F(s,h),s=s[h];f&&!a&&(T[o]=s)}}return s}},487:(t,e,n)=>{"use strict";var i=n(6743),r=n(453),o=n(6897),s=r("%TypeError%"),a=r("%Function.prototype.apply%"),l=r("%Function.prototype.call%"),u=r("%Reflect.apply%",!0)||i.call(l,a),c=r("%Object.defineProperty%",!0),p=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(i,l,arguments);return o(e,1+p(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(i,a,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},496:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=e.DEFAULT_IMAGE_FILTERS_CONFIG=e.DEFAULT_FILTER_DISTANCE_CONFIG=e.TARGET_MAX_N_CANVASES_PER_SUBTASK=e.DEFAULT_N_ANNOS_PER_CANVAS=e.AllowedToolboxItem=void 0;var i,r=n(3045),o=n(8035),s=n(6840),a=n(8286);!function(t){t[t.ModeSelect=0]="ModeSelect",t[t.ZoomPan=1]="ZoomPan",t[t.AnnotationResize=2]="AnnotationResize",t[t.AnnotationID=3]="AnnotationID",t[t.RecolorActive=4]="RecolorActive",t[t.ClassCounter=5]="ClassCounter",t[t.KeypointSlider=6]="KeypointSlider",t[t.SubmitButtons=7]="SubmitButtons",t[t.FilterDistance=8]="FilterDistance",t[t.Brush=9]="Brush",t[t.ImageFilters=10]="ImageFilters"}(i||(e.AllowedToolboxItem=i={})),e.DEFAULT_N_ANNOS_PER_CANVAS=100,e.TARGET_MAX_N_CANVASES_PER_SUBTASK=8,e.DEFAULT_FILTER_DISTANCE_CONFIG={name:"Filter Distance From Row",component_name:"filter-distance-from-row",filter_min:0,filter_max:400,default_values:{closest_row:{distance:40}},step_value:2,multi_class_mode:!1,disable_multi_class_mode:!1,filter_on_load:!0,show_options:!0,show_overlay:!1,toggle_overlay_keybind:"p",filter_during_polyline_move:!0},e.DEFAULT_IMAGE_FILTERS_CONFIG={default_values:{brightness:100,contrast:100,hueRotate:0,invert:0,saturate:100}};var l=function(){function t(){for(var t=[],n=0;n{"use strict";var i=n(453)("%Object.defineProperty%",!0),r=function(){if(i)try{return i({},"a",{value:1}),!0}catch(t){return!1}return!1};r.hasArrayLengthDefineBug=function(){if(!r())return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=r},655:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},1002:t=>{"use strict";t.exports=Function.prototype.apply},1064:(t,e,n)=>{"use strict";var i=n(9612);t.exports=i.getPrototypeOf||null},1093:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var n=e.call(t),i="[object Arguments]"===n;return i||(i="[object Array]"!==n&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),i}},1101:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(8421),o=n(8967),s=i(n(3711));function a(t,e,n){void 0===n&&(n={});var i=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&o.isNumber(t[0])?t="mercator"===e?l(t):u(t):(!0!==i&&(t=s.default(t)),r.coordEach(t,function(t){var n="mercator"===e?l(t):u(t);t[0]=n[0],t[1]=n[1]})),t}function l(t){var e,n=Math.PI/180,i=6378137,r=20037508.342789244,o=[i*(Math.abs(t[0])<=180?t[0]:t[0]-360*((e=t[0])<0?-1:e>0?1:0))*n,i*Math.log(Math.tan(.25*Math.PI+.5*t[1]*n))];return o[0]>r&&(o[0]=r),o[0]<-r&&(o[0]=-r),o[1]>r&&(o[1]=r),o[1]<-r&&(o[1]=-r),o}function u(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}e.toMercator=function(t,e){return void 0===e&&(e={}),a(t,"mercator",e)},e.toWgs84=function(t,e){return void 0===e&&(e={}),a(t,"wgs84",e)}},1111:(t,e,n)=>{"use strict";var i=n(2086),r=n(3711),o=n(8421),s=n(8967);function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l=a(i),u=a(r);function c(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function p(t,e,n){var i=e.x,r=e.y,o=n.x-i,s=n.y-r;if(0!==o||0!==s){var a=((t.x-i)*o+(t.y-r)*s)/(o*o+s*s);a>1?(i=n.x,r=n.y):a>0&&(i+=o*a,r+=s*a)}return(o=t.x-i)*o+(s=t.y-r)*s}function f(t,e,n,i,r){for(var o,s=i,a=e+1;as&&(o=a,s=l)}s>i&&(o-e>1&&f(t,e,o,i,r),r.push(t[o]),n-o>1&&f(t,o,n,i,r))}function h(t,e){var n=t.length-1,i=[t[0]];return f(t,0,n,e,i),i.push(t[n]),i}function d(t,e,n){if(t.length<=2)return t;var i=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,i=t[0],r=[i],o=1,s=t.length;oe&&(r.push(n),i=n);return i!==n&&r.push(n),r}(t,i),t=h(t,i)}function g(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");var n=void 0!==e.tolerance?e.tolerance:1,i=e.highQuality||!1,r=e.mutate||!1;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==r&&(t=u.default(t)),o.geomEach(t,function(t){!function(t,e,n){var i=t.type;if("Point"===i||"MultiPoint"===i)return t;l.default(t,!0);var r=t.coordinates;switch(i){case"LineString":t.coordinates=_(r,e,n);break;case"MultiLineString":t.coordinates=r.map(function(t){return _(t,e,n)});break;case"Polygon":t.coordinates=y(r,e,n);break;case"MultiPolygon":t.coordinates=r.map(function(t){return y(t,e,n)})}}(t,n,i)}),t}function _(t,e,n){return d(t.map(function(t){return{x:t[0],y:t[1],z:t[2]}}),e,n).map(function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]})}function y(t,e,n){return t.map(function(t){var i=t.map(function(t){return{x:t[0],y:t[1]}});if(i.length<4)throw new Error("invalid polygon");for(var r=d(i,e,n).map(function(t){return[t.x,t.y]});!m(r);)r=d(i,e-=.01*e,n).map(function(t){return[t.x,t.y]});return r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),r})}function m(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}t.exports=g,t.exports.default=g},1137:t=>{t.exports=function(t,e,n,i){var r=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);for(var a=i-n,l=0,u=a-1;lo!=h>o&&r<(f-c)*(o-p)/(h-p)+c&&(s=!s)}return s}},1189:(t,e,n)=>{"use strict";var i=Array.prototype.slice,r=n(1093),o=Object.keys,s=o?function(t){return o(t)}:n(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return r(t)?a(i.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},1207:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(8967),o=n(8421),s=i(n(1582));e.default=function(t,e){void 0===e&&(e={}),e.concavity=e.concavity||1/0;var n=[];if(o.coordEach(t,function(t){n.push([t[0],t[1]])}),!n.length)return null;var i=s.default(n,e.concavity);return i.length>3?r.polygon([i]):null}},1237:t=>{"use strict";t.exports=EvalError},1279:(t,e,n)=>{"use strict";var i=n(4383),r=n(7849),o=n(2446),s=n(3707),a=n(8506),l=n(8967),u=n(5228),c=n(8421);function p(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var f=p(i),h=p(r),d=p(o),g=p(s),_=p(u);function y(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.zProperty||"elevation",i=e.flip,r=e.flags;a.collectionOf(t,"Point","input must contain Points");for(var o=function(t,e){var n={};c.featureEach(t,function(t){var e=a.getCoords(t)[1];n[e]||(n[e]=[]),n[e].push(t)});var i=Object.keys(n).map(function(t){return n[t].sort(function(t,e){return a.getCoords(t)[0]-a.getCoords(e)[0]})}),r=i.sort(function(t,n){return e?a.getCoords(t[0])[1]-a.getCoords(n[0])[1]:a.getCoords(n[0])[1]-a.getCoords(t[0])[1]});return r}(t,i),s=[],u=0;us?128:64,u|=ps?32:16,u|=fs?8:4;var d=+(u|=hs?2:1),g=0;if(17===u||18===u||33===u||34===u||38===u||68===u||72===u||98===u||102===u||132===u||136===u||137===u||152===u||153===u){var _=(c+p+f+h)/4;g=_>s?2:_0?(u=156,g=4):u=152:33===u?g>0?(u=139,g=4):u=137:72===u?g>0?(u=99,g=4):u=98:132===u&&(g>0?(u=39,g=4):u=38)}if(0!=u&&170!=u){var y,m,v,b,x,w,E,k;y=m=v=b=x=w=E=k=.5;var S=[];1===u?(v=1-ft(e,f,h),k=1-ft(e,c,h),S.push(st[u])):169===u?(v=ft(s,h,f),k=ft(s,h,c),S.push(st[u])):4===u?(w=1-ft(e,p,f),b=ft(e,h,f),S.push(rt[u])):166===u?(w=ft(s,f,p),b=1-ft(s,f,h),S.push(rt[u])):16===u?(x=ft(e,f,p),m=ft(e,c,p),S.push(it[u])):154===u?(x=1-ft(s,p,f),m=1-ft(s,p,c),S.push(it[u])):64===u?(E=ft(e,h,c),y=1-ft(e,p,c),S.push(lt[u])):106===u?(E=1-ft(s,c,h),y=ft(s,c,p),S.push(lt[u])):168===u?(b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),S.push(ot[u]),S.push(st[u])):2===u?(b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),S.push(ot[u]),S.push(st[u])):162===u?(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),S.push(ot[u]),S.push(st[u])):8===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),S.push(it[u]),S.push(rt[u])):138===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(it[u]),S.push(rt[u])):32===u?(x=ft(s,f,p),w=ft(e,f,p),y=ft(e,c,p),m=ft(s,c,p),S.push(it[u]),S.push(rt[u])):42===u?(k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p),S.push(at[u]),S.push(lt[u])):128===u&&(k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(at[u]),S.push(lt[u])),5===u?(w=1-ft(e,p,f),k=1-ft(e,c,h),S.push(rt[u])):165===u?(w=ft(s,f,p),k=ft(s,h,c),S.push(rt[u])):20===u?(b=ft(e,h,f),m=ft(e,c,p),S.push(ot[u])):150===u?(b=1-ft(s,f,h),m=1-ft(s,p,c),S.push(ot[u])):80===u?(x=ft(e,f,p),E=ft(e,h,c),S.push(it[u])):90===u?(x=1-ft(s,p,f),E=1-ft(s,c,h),S.push(it[u])):65===u?(v=1-ft(e,f,h),y=1-ft(e,p,c),S.push(st[u])):105===u?(v=ft(s,h,f),y=ft(s,c,p),S.push(st[u])):160===u?(x=ft(s,f,p),w=ft(e,f,p),k=ft(e,h,c),E=ft(s,h,c),S.push(it[u]),S.push(rt[u])):10===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),k=1-ft(s,c,h),E=1-ft(e,c,h),S.push(it[u]),S.push(rt[u])):130===u?(b=1-ft(e,f,h),v=1-ft(s,f,h),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(ot[u]),S.push(st[u])):40===u?(b=ft(s,h,f),v=ft(e,h,f),y=ft(e,c,p),m=ft(s,c,p),S.push(ot[u]),S.push(st[u])):101===u?(w=ft(s,f,p),y=ft(s,c,p),S.push(rt[u])):69===u?(w=1-ft(e,p,f),y=1-ft(e,p,c),S.push(rt[u])):149===u?(k=ft(s,h,c),m=1-ft(s,p,c),S.push(at[u])):21===u?(k=1-ft(e,c,h),m=ft(e,c,p),S.push(at[u])):86===u?(b=1-ft(s,f,h),E=1-ft(s,c,h),S.push(ot[u])):84===u?(b=ft(e,h,f),E=ft(e,h,c),S.push(ot[u])):89===u?(x=1-ft(s,p,f),v=ft(s,h,f),S.push(st[u])):81===u?(x=ft(e,f,p),v=1-ft(e,f,h),S.push(st[u])):96===u?(x=ft(s,f,p),w=ft(e,f,p),E=ft(e,h,c),y=ft(s,c,p),S.push(it[u]),S.push(rt[u])):74===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),E=1-ft(s,c,h),y=1-ft(e,p,c),S.push(it[u]),S.push(rt[u])):24===u?(x=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),m=ft(e,c,p),S.push(it[u]),S.push(st[u])):146===u?(x=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),m=1-ft(s,p,c),S.push(it[u]),S.push(st[u])):6===u?(w=1-ft(e,p,f),b=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),S.push(rt[u]),S.push(ot[u])):164===u?(w=ft(s,f,p),b=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),S.push(rt[u]),S.push(ot[u])):129===u?(v=1-ft(e,f,h),k=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(st[u]),S.push(at[u])):41===u?(v=ft(s,h,f),k=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p),S.push(st[u]),S.push(at[u])):66===u?(b=1-ft(e,f,h),v=1-ft(s,f,h),E=1-ft(s,c,h),y=1-ft(e,p,c),S.push(ot[u]),S.push(st[u])):104===u?(b=ft(s,h,f),v=ft(e,h,f),E=ft(e,h,c),y=ft(s,c,p),S.push(st[u]),S.push(ut[u])):144===u?(x=ft(e,f,p),k=ft(e,h,c),E=ft(s,h,c),m=1-ft(s,p,c),S.push(it[u]),S.push(lt[u])):26===u?(x=1-ft(s,p,f),k=1-ft(s,c,h),E=1-ft(e,c,h),m=ft(e,c,p),S.push(it[u]),S.push(lt[u])):36===u?(w=ft(s,f,p),b=ft(e,h,f),y=ft(e,c,p),m=ft(s,c,p),S.push(rt[u]),S.push(ot[u])):134===u?(w=1-ft(e,p,f),b=1-ft(s,f,h),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(rt[u]),S.push(ot[u])):9===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),v=ft(s,h,f),k=1-ft(e,c,h),S.push(it[u]),S.push(rt[u])):161===u?(x=ft(s,f,p),w=ft(e,f,p),v=1-ft(e,f,h),k=ft(s,h,c),S.push(it[u]),S.push(rt[u])):37===u?(w=ft(s,f,p),k=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p),S.push(rt[u]),S.push(at[u])):133===u?(w=1-ft(e,p,f),k=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c),S.push(rt[u]),S.push(at[u])):148===u?(b=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),m=1-ft(s,p,c),S.push(ot[u]),S.push(lt[u])):22===u?(b=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),m=ft(e,c,p),S.push(ot[u]),S.push(lt[u])):82===u?(x=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),E=1-ft(s,c,h),S.push(it[u]),S.push(st[u])):88===u?(x=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),E=ft(e,h,c),S.push(it[u]),S.push(st[u])):73===u?(x=1-ft(e,p,f),w=1-ft(s,p,f),v=ft(s,h,f),y=1-ft(e,p,c),S.push(it[u]),S.push(rt[u])):97===u?(x=ft(s,f,p),w=ft(e,f,p),v=1-ft(e,f,h),y=ft(s,c,p),S.push(it[u]),S.push(rt[u])):145===u?(x=ft(e,f,p),v=1-ft(e,f,h),k=ft(s,h,c),m=1-ft(s,p,c),S.push(it[u]),S.push(at[u])):25===u?(x=1-ft(s,p,f),v=ft(s,h,f),k=1-ft(e,c,h),m=ft(e,c,p),S.push(it[u]),S.push(at[u])):70===u?(w=1-ft(e,p,f),b=1-ft(s,f,h),E=1-ft(s,c,h),y=1-ft(e,p,c),S.push(rt[u]),S.push(ot[u])):100===u?(w=ft(s,f,p),b=ft(e,h,f),E=ft(e,h,c),y=ft(s,c,p),S.push(rt[u]),S.push(ot[u])):34===u?(0===g?(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)):(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)),S.push(it[u]),S.push(rt[u]),S.push(at[u]),S.push(lt[u])):35===u?(4===g?(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)):(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)),S.push(it[u]),S.push(rt[u]),S.push(st[u]),S.push(lt[u])):136===u?(0===g?(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)):(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)),S.push(it[u]),S.push(rt[u]),S.push(at[u]),S.push(lt[u])):153===u?(0===g?(x=ft(e,f,p),v=1-ft(e,f,h),k=1-ft(e,c,h),m=ft(e,c,p)):(x=1-ft(s,p,f),v=ft(s,h,f),k=ft(s,h,c),m=1-ft(s,p,c)),S.push(it[u]),S.push(st[u])):102===u?(0===g?(w=1-ft(e,p,f),b=ft(e,h,f),E=ft(e,h,c),y=1-ft(e,p,c)):(w=ft(s,f,p),b=1-ft(s,f,h),E=1-ft(s,c,h),y=ft(s,c,p)),S.push(rt[u]),S.push(lt[u])):155===u?(4===g?(x=ft(e,f,p),v=1-ft(e,f,h),k=1-ft(e,c,h),m=ft(e,c,p)):(x=1-ft(s,p,f),v=ft(s,h,f),k=ft(s,h,c),m=1-ft(s,p,c)),S.push(it[u]),S.push(at[u])):103===u?(4===g?(w=1-ft(e,p,f),b=ft(e,h,f),E=ft(e,h,c),y=1-ft(e,p,c)):(w=ft(s,f,p),b=1-ft(s,f,h),E=1-ft(s,c,h),y=ft(s,c,p)),S.push(rt[u]),S.push(ot[u])):152===u?(0===g?(x=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),m=ft(e,c,p)):(x=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),m=1-ft(s,p,c)),S.push(it[u]),S.push(ot[u]),S.push(st[u])):156===u?(4===g?(x=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),m=ft(e,c,p)):(x=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),m=1-ft(s,p,c)),S.push(it[u]),S.push(st[u]),S.push(lt[u])):137===u?(0===g?(x=ft(s,f,p),w=ft(e,f,p),v=1-ft(e,f,h),k=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)):(x=1-ft(e,p,f),w=1-ft(s,p,f),v=ft(s,h,f),k=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)),S.push(it[u]),S.push(rt[u]),S.push(st[u])):139===u?(4===g?(x=ft(s,f,p),w=ft(e,f,p),v=1-ft(e,f,h),k=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)):(x=1-ft(e,p,f),w=1-ft(s,p,f),v=ft(s,h,f),k=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)),S.push(it[u]),S.push(rt[u]),S.push(at[u])):98===u?(0===g?(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),E=ft(e,h,c),y=1-ft(e,p,c)):(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),E=1-ft(s,c,h),y=ft(s,c,p)),S.push(it[u]),S.push(rt[u]),S.push(lt[u])):99===u?(4===g?(x=1-ft(e,p,f),w=1-ft(s,p,f),b=ft(s,h,f),v=ft(e,h,f),E=ft(e,h,c),y=1-ft(e,p,c)):(x=ft(s,f,p),w=ft(e,f,p),b=1-ft(e,f,h),v=1-ft(s,f,h),E=1-ft(s,c,h),y=ft(s,c,p)),S.push(it[u]),S.push(rt[u]),S.push(st[u])):38===u?(0===g?(w=1-ft(e,p,f),b=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)):(w=ft(s,f,p),b=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)),S.push(rt[u]),S.push(at[u]),S.push(lt[u])):39===u?(4===g?(w=1-ft(e,p,f),b=ft(e,h,f),k=ft(e,h,c),E=ft(s,h,c),y=1-ft(s,p,c),m=1-ft(e,p,c)):(w=ft(s,f,p),b=1-ft(s,f,h),k=1-ft(s,c,h),E=1-ft(e,c,h),y=ft(e,c,p),m=ft(s,c,p)),S.push(rt[u]),S.push(ot[u]),S.push(lt[u])):85===u&&(x=1,w=0,b=1,v=0,k=0,E=1,y=0,m=1),(y<0||y>1||m<0||m>1||x<0||x>1||b<0||b>1||k<0||k>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+u+" "+d+" "+c+","+p+","+f+","+h+" "+g+" "+y+" "+m+" "+x+" "+w+" "+b+" "+v+" "+k+" "+E),o.cells[a][l]={cval:u,cval_real:d,flipped:g,topleft:y,topright:m,righttop:x,rightbottom:w,bottomright:b,bottomleft:v,leftbottom:k,lefttop:E,edges:S}}}}}return o}(t,e,n);return v.polygons?(v.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),l=function(t){var e=[],n=0;return t.cells.forEach(function(t,i){t.forEach(function(t,r){if(void 0!==t){var o=pt[t.cval](t);"object"==typeof o&&ht(o)?"object"==typeof o[0]&&ht(o[0])?"object"==typeof o[0][0]&&ht(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=t}):(o.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}(u)):(v.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),l=function(t){for(var e=[],n=t.rows,i=t.cols,r=[],o=0;o0){var a=gt(t.cells[o][s]),l=null,u=s,c=o;null!==a&&r.push([a.p[0]+u,a.p[1]+c]);do{if(null===(l=_t(t.cells[c][u],a.x,a.y,a.o)))break;if(r.push([l.p[0]+u,l.p[1]+c]),u+=l.x,a=l,(c+=l.y)<0||c>=n||u<0||u>=i||void 0===t.cells[c][u]){var p=dt(t,u-=l.x,c-=l.y,l.x,l.y,l.o);if(null===p)break;p.path.forEach(function(t){r.push(t)}),u=p.i,c=p.j,a=p}}while(void 0!==t.cells[c][u]&&t.cells[c][u].edges.length>0);e.push(r),r=[],t.cells[o][s].edges.length>0&&s--}return e}(u)),"function"==typeof v.successCallback&&v.successCallback(l),l}var x=64,w=16,E=4,k=1,S=[],C=[],I=[],N=[],M=[],L=[],O=[],P=[],T=[],A=[],R=[],D=[],j=[],F=[],z=[],B=[],G=[],q=[],U=[],X=[],Y=[],$=[],V=[],H=[];O[85]=A[85]=-1,P[85]=R[85]=0,T[85]=D[85]=1,U[85]=$[85]=1,X[85]=V[85]=0,Y[85]=H[85]=1,S[85]=N[85]=0,C[85]=M[85]=-1,I[85]=z[85]=0,B[85]=j[85]=0,G[85]=F[85]=1,L[85]=q[85]=1,$[1]=$[169]=0,V[1]=V[169]=-1,H[1]=H[169]=0,j[1]=j[169]=-1,F[1]=F[169]=0,z[1]=z[169]=0,A[4]=A[166]=0,R[4]=R[166]=-1,D[4]=D[166]=1,B[4]=B[166]=1,G[4]=G[166]=0,q[4]=q[166]=0,O[16]=O[154]=0,P[16]=P[154]=1,T[16]=T[154]=1,N[16]=N[154]=1,M[16]=M[154]=0,L[16]=L[154]=1,U[64]=U[106]=0,X[64]=X[106]=1,Y[64]=Y[106]=0,S[64]=S[106]=-1,C[64]=C[106]=0,I[64]=I[106]=1,U[2]=U[168]=0,X[2]=X[168]=-1,Y[2]=Y[168]=1,$[2]=$[168]=0,V[2]=V[168]=-1,H[2]=H[168]=0,j[2]=j[168]=-1,F[2]=F[168]=0,z[2]=z[168]=0,B[2]=B[168]=-1,G[2]=G[168]=0,q[2]=q[168]=1,O[8]=O[162]=0,P[8]=P[162]=-1,T[8]=T[162]=0,A[8]=A[162]=0,R[8]=R[162]=-1,D[8]=D[162]=1,j[8]=j[162]=1,F[8]=F[162]=0,z[8]=z[162]=1,B[8]=B[162]=1,G[8]=G[162]=0,q[8]=q[162]=0,O[32]=O[138]=0,P[32]=P[138]=1,T[32]=T[138]=1,A[32]=A[138]=0,R[32]=R[138]=1,D[32]=D[138]=0,S[32]=S[138]=1,C[32]=C[138]=0,I[32]=I[138]=0,N[32]=N[138]=1,M[32]=M[138]=0,L[32]=L[138]=1,$[128]=$[42]=0,V[128]=V[42]=1,H[128]=H[42]=1,U[128]=U[42]=0,X[128]=X[42]=1,Y[128]=Y[42]=0,S[128]=S[42]=-1,C[128]=C[42]=0,I[128]=I[42]=1,N[128]=N[42]=-1,M[128]=M[42]=0,L[128]=L[42]=0,A[5]=A[165]=-1,R[5]=R[165]=0,D[5]=D[165]=0,$[5]=$[165]=1,V[5]=V[165]=0,H[5]=H[165]=0,B[20]=B[150]=0,G[20]=G[150]=1,q[20]=q[150]=1,N[20]=N[150]=0,M[20]=M[150]=-1,L[20]=L[150]=1,O[80]=O[90]=-1,P[80]=P[90]=0,T[80]=T[90]=1,U[80]=U[90]=1,X[80]=X[90]=0,Y[80]=Y[90]=1,j[65]=j[105]=0,F[65]=F[105]=1,z[65]=z[105]=0,S[65]=S[105]=0,C[65]=C[105]=-1,I[65]=I[105]=0,O[160]=O[10]=-1,P[160]=P[10]=0,T[160]=T[10]=1,A[160]=A[10]=-1,R[160]=R[10]=0,D[160]=D[10]=0,$[160]=$[10]=1,V[160]=V[10]=0,H[160]=H[10]=0,U[160]=U[10]=1,X[160]=X[10]=0,Y[160]=Y[10]=1,B[130]=B[40]=0,G[130]=G[40]=1,q[130]=q[40]=1,j[130]=j[40]=0,F[130]=F[40]=1,z[130]=z[40]=0,S[130]=S[40]=0,C[130]=C[40]=-1,I[130]=I[40]=0,N[130]=N[40]=0,M[130]=M[40]=-1,L[130]=L[40]=1,A[37]=A[133]=0,R[37]=R[133]=1,D[37]=D[133]=1,$[37]=$[133]=0,V[37]=V[133]=1,H[37]=H[133]=0,S[37]=S[133]=-1,C[37]=C[133]=0,I[37]=I[133]=0,N[37]=N[133]=1,M[37]=M[133]=0,L[37]=L[133]=0,B[148]=B[22]=-1,G[148]=G[22]=0,q[148]=q[22]=0,$[148]=$[22]=0,V[148]=V[22]=-1,H[148]=H[22]=1,U[148]=U[22]=0,X[148]=X[22]=1,Y[148]=Y[22]=1,N[148]=N[22]=-1,M[148]=M[22]=0,L[148]=L[22]=1,O[82]=O[88]=0,P[82]=P[88]=-1,T[82]=T[88]=1,B[82]=B[88]=1,G[82]=G[88]=0,q[82]=q[88]=1,j[82]=j[88]=-1,F[82]=F[88]=0,z[82]=z[88]=1,U[82]=U[88]=0,X[82]=X[88]=-1,Y[82]=Y[88]=0,O[73]=O[97]=0,P[73]=P[97]=1,T[73]=T[97]=0,A[73]=A[97]=0,R[73]=R[97]=-1,D[73]=D[97]=0,j[73]=j[97]=1,F[73]=F[97]=0,z[73]=z[97]=0,S[73]=S[97]=1,C[73]=C[97]=0,I[73]=I[97]=1,O[145]=O[25]=0,P[145]=P[25]=-1,T[145]=T[25]=0,j[145]=j[25]=1,F[145]=F[25]=0,z[145]=z[25]=1,$[145]=$[25]=0,V[145]=V[25]=1,H[145]=H[25]=1,N[145]=N[25]=-1,M[145]=M[25]=0,L[145]=L[25]=0,A[70]=A[100]=0,R[70]=R[100]=1,D[70]=D[100]=0,B[70]=B[100]=-1,G[70]=G[100]=0,q[70]=q[100]=1,U[70]=U[100]=0,X[70]=X[100]=-1,Y[70]=Y[100]=1,S[70]=S[100]=1,C[70]=C[100]=0,I[70]=I[100]=0,A[101]=A[69]=0,R[101]=R[69]=1,D[101]=D[69]=0,S[101]=S[69]=1,C[101]=C[69]=0,I[101]=I[69]=0,$[149]=$[21]=0,V[149]=V[21]=1,H[149]=H[21]=1,N[149]=N[21]=-1,M[149]=M[21]=0,L[149]=L[21]=0,B[86]=B[84]=-1,G[86]=G[84]=0,q[86]=q[84]=1,U[86]=U[84]=0,X[86]=X[84]=-1,Y[86]=Y[84]=1,O[89]=O[81]=0,P[89]=P[81]=-1,T[89]=T[81]=0,j[89]=j[81]=1,F[89]=F[81]=0,z[89]=z[81]=1,O[96]=O[74]=0,P[96]=P[74]=1,T[96]=T[74]=0,A[96]=A[74]=-1,R[96]=R[74]=0,D[96]=D[74]=1,U[96]=U[74]=1,X[96]=X[74]=0,Y[96]=Y[74]=0,S[96]=S[74]=1,C[96]=C[74]=0,I[96]=I[74]=1,O[24]=O[146]=0,P[24]=P[146]=-1,T[24]=T[146]=1,B[24]=B[146]=1,G[24]=G[146]=0,q[24]=q[146]=1,j[24]=j[146]=0,F[24]=F[146]=1,z[24]=z[146]=1,N[24]=N[146]=0,M[24]=M[146]=-1,L[24]=L[146]=0,A[6]=A[164]=-1,R[6]=R[164]=0,D[6]=D[164]=1,B[6]=B[164]=-1,G[6]=G[164]=0,q[6]=q[164]=0,$[6]=$[164]=0,V[6]=V[164]=-1,H[6]=H[164]=1,U[6]=U[164]=1,X[6]=X[164]=0,Y[6]=Y[164]=0,j[129]=j[41]=0,F[129]=F[41]=1,z[129]=z[41]=1,$[129]=$[41]=0,V[129]=V[41]=1,H[129]=H[41]=0,S[129]=S[41]=-1,C[129]=C[41]=0,I[129]=I[41]=0,N[129]=N[41]=0,M[129]=M[41]=-1,L[129]=L[41]=0,B[66]=B[104]=0,G[66]=G[104]=1,q[66]=q[104]=0,j[66]=j[104]=-1,F[66]=F[104]=0,z[66]=z[104]=1,U[66]=U[104]=0,X[66]=X[104]=-1,Y[66]=Y[104]=0,S[66]=S[104]=0,C[66]=C[104]=-1,I[66]=I[104]=1,O[144]=O[26]=-1,P[144]=P[26]=0,T[144]=T[26]=0,$[144]=$[26]=1,V[144]=V[26]=0,H[144]=H[26]=1,U[144]=U[26]=0,X[144]=X[26]=1,Y[144]=Y[26]=1,N[144]=N[26]=-1,M[144]=M[26]=0,L[144]=L[26]=1,A[36]=A[134]=0,R[36]=R[134]=1,D[36]=D[134]=1,B[36]=B[134]=0,G[36]=G[134]=1,q[36]=q[134]=0,S[36]=S[134]=0,C[36]=C[134]=-1,I[36]=I[134]=1,N[36]=N[134]=1,M[36]=M[134]=0,L[36]=L[134]=0,O[9]=O[161]=-1,P[9]=P[161]=0,T[9]=T[161]=0,A[9]=A[161]=0,R[9]=R[161]=-1,D[9]=D[161]=0,j[9]=j[161]=1,F[9]=F[161]=0,z[9]=z[161]=0,$[9]=$[161]=1,V[9]=V[161]=0,H[9]=H[161]=1,O[136]=0,P[136]=1,T[136]=1,A[136]=0,R[136]=1,D[136]=0,B[136]=-1,G[136]=0,q[136]=1,j[136]=-1,F[136]=0,z[136]=0,$[136]=0,V[136]=-1,H[136]=0,U[136]=0,X[136]=-1,Y[136]=1,S[136]=1,C[136]=0,I[136]=0,N[136]=1,M[136]=0,L[136]=1,O[34]=0,P[34]=-1,T[34]=0,A[34]=0,R[34]=-1,D[34]=1,B[34]=1,G[34]=0,q[34]=0,j[34]=1,F[34]=0,z[34]=1,$[34]=0,V[34]=1,H[34]=1,U[34]=0,X[34]=1,Y[34]=0,S[34]=-1,C[34]=0,I[34]=1,N[34]=-1,M[34]=0,L[34]=0,O[35]=0,P[35]=1,T[35]=1,A[35]=0,R[35]=-1,D[35]=1,B[35]=1,G[35]=0,q[35]=0,j[35]=-1,F[35]=0,z[35]=0,$[35]=0,V[35]=-1,H[35]=0,U[35]=0,X[35]=1,Y[35]=0,S[35]=-1,C[35]=0,I[35]=1,N[35]=1,M[35]=0,L[35]=1,O[153]=0,P[153]=1,T[153]=1,j[153]=-1,F[153]=0,z[153]=0,$[153]=0,V[153]=-1,H[153]=0,N[153]=1,M[153]=0,L[153]=1,A[102]=0,R[102]=-1,D[102]=1,B[102]=1,G[102]=0,q[102]=0,U[102]=0,X[102]=1,Y[102]=0,S[102]=-1,C[102]=0,I[102]=1,O[155]=0,P[155]=-1,T[155]=0,j[155]=1,F[155]=0,z[155]=1,$[155]=0,V[155]=1,H[155]=1,N[155]=-1,M[155]=0,L[155]=0,A[103]=0,R[103]=1,D[103]=0,B[103]=-1,G[103]=0,q[103]=1,U[103]=0,X[103]=-1,Y[103]=1,S[103]=1,C[103]=0,I[103]=0,O[152]=0,P[152]=1,T[152]=1,B[152]=-1,G[152]=0,q[152]=1,j[152]=-1,F[152]=0,z[152]=0,$[152]=0,V[152]=-1,H[152]=0,U[152]=0,X[152]=-1,Y[152]=1,N[152]=1,M[152]=0,L[152]=1,O[156]=0,P[156]=-1,T[156]=1,B[156]=1,G[156]=0,q[156]=1,j[156]=-1,F[156]=0,z[156]=0,$[156]=0,V[156]=-1,H[156]=0,U[156]=0,X[156]=1,Y[156]=1,N[156]=-1,M[156]=0,L[156]=1,O[137]=0,P[137]=1,T[137]=1,A[137]=0,R[137]=1,D[137]=0,j[137]=-1,F[137]=0,z[137]=0,$[137]=0,V[137]=-1,H[137]=0,S[137]=1,C[137]=0,I[137]=0,N[137]=1,M[137]=0,L[137]=1,O[139]=0,P[139]=1,T[139]=1,A[139]=0,R[139]=-1,D[139]=0,j[139]=1,F[139]=0,z[139]=0,$[139]=0,V[139]=1,H[139]=0,S[139]=-1,C[139]=0,I[139]=0,N[139]=1,M[139]=0,L[139]=1,O[98]=0,P[98]=-1,T[98]=0,A[98]=0,R[98]=-1,D[98]=1,B[98]=1,G[98]=0,q[98]=0,j[98]=1,F[98]=0,z[98]=1,U[98]=0,X[98]=1,Y[98]=0,S[98]=-1,C[98]=0,I[98]=1,O[99]=0,P[99]=1,T[99]=0,A[99]=0,R[99]=-1,D[99]=1,B[99]=1,G[99]=0,q[99]=0,j[99]=-1,F[99]=0,z[99]=1,U[99]=0,X[99]=-1,Y[99]=0,S[99]=1,C[99]=0,I[99]=1,A[38]=0,R[38]=-1,D[38]=1,B[38]=1,G[38]=0,q[38]=0,$[38]=0,V[38]=1,H[38]=1,U[38]=0,X[38]=1,Y[38]=0,S[38]=-1,C[38]=0,I[38]=1,N[38]=-1,M[38]=0,L[38]=0,A[39]=0,R[39]=1,D[39]=1,B[39]=-1,G[39]=0,q[39]=0,$[39]=0,V[39]=-1,H[39]=1,U[39]=0,X[39]=1,Y[39]=0,S[39]=-1,C[39]=0,I[39]=1,N[39]=1,M[39]=0,L[39]=0;var W=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},J=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},K=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},Z=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Q=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},tt=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},et=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},nt=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},it=[],rt=[],ot=[],st=[],at=[],lt=[],ut=[],ct=[];st[1]=at[1]=18,st[169]=at[169]=18,ot[4]=rt[4]=12,ot[166]=rt[166]=12,it[16]=ct[16]=4,it[154]=ct[154]=4,lt[64]=ut[64]=22,lt[106]=ut[106]=22,ot[2]=lt[2]=17,st[2]=at[2]=18,ot[168]=lt[168]=17,st[168]=at[168]=18,it[8]=st[8]=9,rt[8]=ot[8]=12,it[162]=st[162]=9,rt[162]=ot[162]=12,it[32]=ct[32]=4,rt[32]=ut[32]=1,it[138]=ct[138]=4,rt[138]=ut[138]=1,at[128]=ct[128]=21,lt[128]=ut[128]=22,at[42]=ct[42]=21,lt[42]=ut[42]=22,rt[5]=at[5]=14,rt[165]=at[165]=14,ot[20]=ct[20]=6,ot[150]=ct[150]=6,it[80]=lt[80]=11,it[90]=lt[90]=11,st[65]=ut[65]=3,st[105]=ut[105]=3,it[160]=lt[160]=11,rt[160]=at[160]=14,it[10]=lt[10]=11,rt[10]=at[10]=14,ot[130]=ct[130]=6,st[130]=ut[130]=3,ot[40]=ct[40]=6,st[40]=ut[40]=3,rt[101]=ut[101]=1,rt[69]=ut[69]=1,at[149]=ct[149]=21,at[21]=ct[21]=21,ot[86]=lt[86]=17,ot[84]=lt[84]=17,it[89]=st[89]=9,it[81]=st[81]=9,it[96]=ut[96]=0,rt[96]=lt[96]=15,it[74]=ut[74]=0,rt[74]=lt[74]=15,it[24]=ot[24]=8,st[24]=ct[24]=7,it[146]=ot[146]=8,st[146]=ct[146]=7,rt[6]=lt[6]=15,ot[6]=at[6]=16,rt[164]=lt[164]=15,ot[164]=at[164]=16,st[129]=ct[129]=7,at[129]=ut[129]=20,st[41]=ct[41]=7,at[41]=ut[41]=20,ot[66]=ut[66]=2,st[66]=lt[66]=19,ot[104]=ut[104]=2,st[104]=lt[104]=19,it[144]=at[144]=10,lt[144]=ct[144]=23,it[26]=at[26]=10,lt[26]=ct[26]=23,rt[36]=ct[36]=5,ot[36]=ut[36]=2,rt[134]=ct[134]=5,ot[134]=ut[134]=2,it[9]=at[9]=10,rt[9]=st[9]=13,it[161]=at[161]=10,rt[161]=st[161]=13,rt[37]=ct[37]=5,at[37]=ut[37]=20,rt[133]=ct[133]=5,at[133]=ut[133]=20,ot[148]=at[148]=16,lt[148]=ct[148]=23,ot[22]=at[22]=16,lt[22]=ct[22]=23,it[82]=ot[82]=8,st[82]=lt[82]=19,it[88]=ot[88]=8,st[88]=lt[88]=19,it[73]=ut[73]=0,rt[73]=st[73]=13,it[97]=ut[97]=0,rt[97]=st[97]=13,it[145]=st[145]=9,at[145]=ct[145]=21,it[25]=st[25]=9,at[25]=ct[25]=21,rt[70]=ut[70]=1,ot[70]=lt[70]=17,rt[100]=ut[100]=1,ot[100]=lt[100]=17,it[34]=st[34]=9,rt[34]=ot[34]=12,at[34]=ct[34]=21,lt[34]=ut[34]=22,it[136]=ct[136]=4,rt[136]=ut[136]=1,ot[136]=lt[136]=17,st[136]=at[136]=18,it[35]=ct[35]=4,rt[35]=ot[35]=12,st[35]=at[35]=18,lt[35]=ut[35]=22,it[153]=ct[153]=4,st[153]=at[153]=18,rt[102]=ot[102]=12,lt[102]=ut[102]=22,it[155]=st[155]=9,at[155]=ct[155]=23,rt[103]=ut[103]=1,ot[103]=lt[103]=17,it[152]=ct[152]=4,ot[152]=lt[152]=17,st[152]=at[152]=18,it[156]=ot[156]=8,st[156]=at[156]=18,lt[156]=ct[156]=23,it[137]=ct[137]=4,rt[137]=ut[137]=1,st[137]=at[137]=18,it[139]=ct[139]=4,rt[139]=st[139]=13,at[139]=ut[139]=20,it[98]=st[98]=9,rt[98]=ot[98]=12,lt[98]=ut[98]=22,it[99]=ut[99]=0,rt[99]=ot[99]=12,st[99]=lt[99]=19,rt[38]=ot[38]=12,at[38]=ct[38]=21,lt[38]=ut[38]=22,rt[39]=ct[39]=5,ot[39]=at[39]=16,lt[39]=ut[39]=22;var pt=[];function ft(t,e,n){return(t-e)/(n-e)}function ht(t){return t.constructor.toString().indexOf("Array")>-1}function dt(t,e,n,i,r,o){for(var s=t.cells[n][e],a=s.cval_real,l=e+i,u=n+r,c=[],p=!1;!p;){if(void 0===t.cells[u]||void 0===t.cells[u][l])if(u-=r,l-=i,a=(s=t.cells[u][l]).cval_real,-1===r)if(0===o)if(a&k)c.push([l,u]),i=-1,r=0,o=0;else{if(!(a&E)){c.push([l+s.bottomright,u]),i=0,r=1,o=1,p=!0;break}c.push([l+1,u]),i=1,r=0,o=0}else{if(!(a&k)){if(a&E){c.push([l+s.bottomright,u]),i=0,r=1,o=1,p=!0;break}c.push([l+s.bottomleft,u]),i=0,r=1,o=0,p=!0;break}c.push([l,u]),i=-1,r=0,o=0}else if(1===r)if(0===o){if(!(a&w)){if(a&x){c.push([l+s.topleft,u+1]),i=0,r=-1,o=0,p=!0;break}c.push([l+s.topright,u+1]),i=0,r=-1,o=1,p=!0;break}c.push([l+1,u+1]),i=1,r=0,o=1}else c.push([l+1,u+1]),i=1,r=0,o=1;else if(-1===i)if(0===o){if(!(a&x)){if(a&k){c.push([l,u+s.leftbottom]),i=1,r=0,o=0,p=!0;break}c.push([l,u+s.lefttop]),i=1,r=0,o=1,p=!0;break}c.push([l,u+1]),i=0,r=1,o=0}else{if(!(a&x)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([l,u+1]),i=0,r=1,o=0}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&E)){c.push([l+1,u+s.rightbottom]),i=-1,r=0,o=0,p=!0;break}c.push([l+1,u]),i=0,r=-1,o=1}else{if(!(a&E)){if(a&w){c.push([l+1,u+s.righttop]),i=-1,r=0,o=1;break}c.push([l+1,u+s.rightbottom]),i=-1,r=0,o=0,p=!0;break}c.push([l+1,u]),i=0,r=-1,o=1}}else if(a=(s=t.cells[u][l]).cval_real,-1===i)if(0===o)if(void 0!==t.cells[u-1]&&void 0!==t.cells[u-1][l])i=0,r=-1,o=1;else{if(!(a&k)){c.push([l+s.bottomright,u]),i=0,r=1,o=1,p=!0;break}c.push([l,u])}else{if(!(a&x)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+l+","+u);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===i){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[u+1]&&void 0!==t.cells[u+1][l])i=0,r=1,o=0;else{if(!(a&w)){c.push([l+s.topleft,u+1]),i=0,r=-1,o=0,p=!0;break}c.push([l+1,u+1]),i=1,r=0,o=1}}else if(-1===r){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[u][l+1])i=1,r=0,o=1;else{if(!(a&E)){c.push([l+1,u+s.righttop]),i=-1,r=0,o=1,p=!0;break}c.push([l+1,u]),i=0,r=-1,o=1}}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[u][l-1])i=-1,r=0,o=0;else{if(!(a&x)){c.push([l,u+s.leftbottom]),i=1,r=0,o=0,p=!0;break}c.push([l,u+1]),i=0,r=1,o=0}}if(u+=r,(l+=i)===e&&u===n)break}return{path:c,i:l,j:u,x:i,y:r,o}}function gt(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&w?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&E?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&E?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&k?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&w?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&E?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&E?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&k?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&E?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&k?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&k?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&x?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&E?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&k?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&k?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&x?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&E?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&x?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&k?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&x?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&x?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&w?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&x?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&w?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function _t(t,e,n,i){var r,o,s,a,l,u=t.cval;switch(e){case-1:if(0===i)r=rt[u],s=A[u],a=R[u],l=D[u];else r=it[u],s=O[u],a=P[u],l=T[u];break;case 1:if(0===i)r=at[u],s=$[u],a=V[u],l=H[u];else r=lt[u],s=U[u],a=X[u],l=Y[u];break;default:switch(n){case-1:if(0===i)r=ut[u],s=S[u],a=C[u],l=I[u];else r=ct[u],s=N[u],a=M[u],l=L[u];break;case 1:if(0===i)r=st[u],s=j[u],a=F[u],l=z[u];else r=ot[u],s=B[u],a=G[u],l=q[u]}}if(o=t.edges.indexOf(r),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n{function e(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}e.prototype.insert=function(t,e){for(var n=this._queue.length,i=n;i--;){var r=this._priorities[i];"desc"===this._sorting?e>r&&(n=i):e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506);function o(t,e,n){if(void 0===n&&(n={}),!0===n.final)return function(t,e){var n=o(e,t);return n=(n+180)%360}(t,e);var s=r.getCoord(t),a=r.getCoord(e),l=i.degreesToRadians(s[0]),u=i.degreesToRadians(a[0]),c=i.degreesToRadians(s[1]),p=i.degreesToRadians(a[1]),f=Math.sin(u-l)*Math.cos(p),h=Math.cos(c)*Math.sin(p)-Math.sin(c)*Math.cos(p)*Math.cos(u-l);return i.radiansToDegrees(Math.atan2(f,h))}e.default=o},1323:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2446)),o=i(n(3154)),s=n(8421),a=i(n(4527));function l(t,e){for(var n=0;n0}function c(t,e,n){var i=n[0]-t[0],r=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0===i*s-r*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}e.default=function(t,e){var n=!0;return s.flattenEach(t,function(t){s.flattenEach(e,function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,i=e.coordinates,!(n[0]===i[0]&&n[1]===i[1]);case"LineString":return!l(e,t);case"Polygon":return!r.default(t,e)}break;case"LineString":switch(e.type){case"Point":return!l(t,e);case"LineString":return!function(t,e){if(o.default(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!u(e,t)}break;case"Polygon":switch(e.type){case"Point":return!r.default(e,t);case"LineString":return!u(t,e);case"Polygon":return!function(t,e){for(var n=0,i=t.coordinates[0];n0)return!0;return!1}(e,t)}}var n,i;return!1}(t.geometry,e.geometry)})}),n}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},1353:(t,e,n)=>{"use strict";e.h3=l,e.k8=function(t,e){var n=t.get_current_subtask(),i=n.actions.stream.pop(),r=JSON.parse(i.redo_payload);r.init_spatial=n.annotations.access[e].spatial_payload,r.finished=!0,i.redo_payload=JSON.stringify(r),n.actions.stream.push(i)},e.DS=function(t,e){for(var n=t.get_current_subtask(),i=n.actions.stream,r=null,o=i.length-1;o>=0;o--)if("begin_edit"===i[o].act_type&&i[o].annotation_id===e){r=i[o];break}if(null===r)return void(0,a.log_message)('No "begin_edit" action found for annotation ID: '.concat(e),a.LogLevel.ERROR,!0);var s=JSON.parse(r.redo_payload);s.annotation=n.annotations.access[e],s.finished=!0,r.redo_payload=JSON.stringify(s),l(t,{act_type:"finish_edit",annotation_id:e,frame:t.state.current_frame,undo_payload:{},redo_payload:{}},!1,!1)},e.WH=function(t,e,n,i,r){void 0===i&&(i=0);void 0===r&&(r=!1);var o=t.get_current_subtask(),s=o.actions.stream.pop(),a=JSON.parse(s.redo_payload),u=JSON.parse(s.undo_payload);a.diffX=e,a.diffY=n,a.diffZ=i,u.diffX=-e,u.diffY=-n,u.diffZ=-i,a.finished=!0,a.move_not_allowed=r,s.redo_payload=JSON.stringify(a),s.undo_payload=JSON.stringify(u),o.actions.stream.push(s),l(t,{act_type:"finish_move",annotation_id:s.annotation_id,frame:t.state.current_frame,undo_payload:{},redo_payload:{}},!1,!1)},e.tN=_,e.ZS=function(t){var e=t.get_current_subtask().actions.undone_stack;if(0===e.length)return;var n=e.pop();y(t,n)};var i=n(7105),r=n(496),o=n(2571),s=n(5573),a=n(5638);function l(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0),t.set_saved(!1);var o=t.get_current_subtask(),s=o.annotations.access[e.annotation_id];r&&!n&&(o.actions.undone_stack=[]);var a={act_type:e.act_type,annotation_id:e.annotation_id,frame:e.frame,undo_payload:JSON.stringify(e.undo_payload),redo_payload:JSON.stringify(e.redo_payload),prev_timestamp:(null==s?void 0:s.last_edited_at)||null,prev_user:(null==s?void 0:s.last_edited_by)||"unknown"};r&&(o.actions.stream.push(a),void 0!==s&&(s.last_edited_at=i.ULabel.get_time(),s.last_edited_by=t.config.username)),u(t,a,!1,n)}function u(t,e,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1);var r={begin_annotation:{action:c,undo:h},create_nonspatial_annotation:{action:c,undo:h},continue_edit:{action:p},continue_move:{action:p},continue_brush:{action:p},continue_annotation:{action:p},create_annotation:{action:f,undo:h},finish_modify_annotation:{action:f,undo:f},finish_edit:{action:f},finish_move:{action:f},finish_annotation:{action:f,undo:f},cancel_annotation:{action:f,undo:g},delete_annotation:{action:h,undo:f},assign_annotation_id:{action:d,undo:d},begin_edit:{undo:f,redo:f},begin_move:{undo:f,redo:f},start_complex_polygon:{undo:f},merge_polygon_complex_layer:{undo:g},simplify_polygon_complex_layer:{undo:g},begin_brush:{undo:g},delete_annotations_in_polygon:{}};e.act_type in r&&(!n&&!i&&"action"in r[e.act_type]||i&&!("redo"in r[e.act_type])&&"action"in r[e.act_type]?r[e.act_type].action(t,e):n&&"undo"in r[e.act_type]?r[e.act_type].undo(t,e,n):i&&"redo"in r[e.act_type]&&r[e.act_type].redo(t,e))}function c(t,e,n){void 0===n&&(n=!1),t.draw_annotation_from_id(e.annotation_id)}function p(t,e,n){var i;void 0===n&&(n=!1);var r=t.get_current_subtask_key(),o=(null===(i=t.subtasks[r].state.move_candidate)||void 0===i?void 0:i.offset)||{id:e.annotation_id,diffX:0,diffY:0,diffZ:0};t.update_filter_distance_during_polyline_move(e.annotation_id,!0,!1,o),t.rebuild_containing_box(e.annotation_id,!1,r),t.redraw_annotation(e.annotation_id,r,o),t.suggest_edits()}function f(t,e,n){void 0===n&&(n=!1),t.rebuild_containing_box(e.annotation_id),t.redraw_annotation(e.annotation_id),t.suggest_edits(null,null,!0),t.update_filter_distance(e.annotation_id),t.toolbox.redraw_update_items(t),t.destroy_polygon_ender(e.annotation_id)}function h(t,e,n){var i;void 0===n&&(n=!1);var r=t.get_current_subtask().annotations.access;if(e.annotation_id in r){var o=null===(i=r[e.annotation_id])||void 0===i?void 0:i.spatial_type;s.NONSPATIAL_MODES.includes(o)?t.clear_nonspatial_annotation(e.annotation_id):(t.redraw_annotation(e.annotation_id),"polyline"===r[e.annotation_id].spatial_type&&t.update_filter_distance(e.annotation_id,!1,!0))}t.destroy_polygon_ender(e.annotation_id),t.suggest_edits(null,null,!0),t.toolbox.redraw_update_items(t)}function d(t,e,n){if((void 0===n&&(n=!1),t.redraw_annotation(e.annotation_id),t.recolor_active_polygon_ender(),t.recolor_brush_circle(),n||t.hide_id_dialog(),t.suggest_edits(null,null,!0),t.config.toolbox_order.includes(r.AllowedToolboxItem.FilterDistance))&&"polyline"===t.get_current_subtask().annotations.access[e.annotation_id].spatial_type){var i=t.toolbox.items.find(function(t){return"FilterDistance"===t.get_toolbox_item_type()});(null==i?void 0:i.multi_class_mode)&&(0,o.filter_points_distance_from_line)(t,!0)}t.toolbox.redraw_update_items(t)}function g(t,e,n){void 0===n&&(n=!1),t.redraw_annotation(e.annotation_id)}function _(t,e){void 0===e&&(e=!1);var n=t.get_current_subtask(),i=n.actions.stream,r=n.actions.undone_stack;if(0!==i.length){n.state.idd_thumbnail||t.hide_id_dialog();var o=i.pop();!1===JSON.parse(o.redo_payload).finished&&(i.push(o),function(t,e){switch(e.act_type){case"begin_annotation":case"begin_edit":case"begin_move":t.end_drag(t.state.last_move)}}(t,o),o=i.pop()),o.is_internal_undo=e,r.push(o),function(t,e){t.update_frame(null,e.frame);var n=JSON.parse(e.undo_payload),i=t.get_current_subtask().annotations.access;if(e.annotation_id in i){var r=i[e.annotation_id];r.last_edited_at=e.prev_timestamp,r.last_edited_by=e.prev_user}switch(e.act_type){case"begin_annotation":t.begin_annotation__undo(e.annotation_id);break;case"continue_annotation":t.continue_annotation__undo(e.annotation_id);break;case"finish_annotation":t.finish_annotation__undo(e.annotation_id);break;case"begin_edit":t.begin_edit__undo(e.annotation_id,n);break;case"begin_move":t.begin_move__undo(e.annotation_id,n);break;case"delete_annotation":t.delete_annotation__undo(e.annotation_id);break;case"cancel_annotation":t.cancel_annotation__undo(e.annotation_id,n);break;case"assign_annotation_id":t.assign_annotation_id__undo(e.annotation_id,n);break;case"create_annotation":t.create_annotation__undo(e.annotation_id);break;case"create_nonspatial_annotation":t.create_nonspatial_annotation__undo(e.annotation_id);break;case"start_complex_polygon":t.start_complex_polygon__undo(e.annotation_id);break;case"merge_polygon_complex_layer":t.merge_polygon_complex_layer__undo(e.annotation_id,n),e.is_internal_undo||_(t);break;case"simplify_polygon_complex_layer":t.simplify_polygon_complex_layer__undo(e.annotation_id,n),e.is_internal_undo||_(t);break;case"delete_annotations_in_polygon":t.delete_annotations_in_polygon__undo(n);break;case"begin_brush":t.begin_brush__undo(e.annotation_id,n);break;case"finish_modify_annotation":t.finish_modify_annotation__undo(e.annotation_id,n);break;default:(0,a.log_message)("Action type not recognized for undo: ".concat(e.act_type),a.LogLevel.WARNING)}}(t,o),u(t,o,!0)}}function y(t,e){t.update_frame(null,e.frame);var n=JSON.parse(e.redo_payload);switch(e.act_type){case"begin_annotation":t.begin_annotation(null,e.annotation_id,n);break;case"continue_annotation":t.continue_annotation(null,null,e.annotation_id,n);break;case"finish_annotation":t.finish_annotation__redo(e.annotation_id);break;case"begin_edit":t.begin_edit__redo(e.annotation_id,n);break;case"begin_move":t.begin_move__redo(e.annotation_id,n);break;case"delete_annotation":t.delete_annotation__redo(e.annotation_id);break;case"cancel_annotation":t.cancel_annotation(e.annotation_id);break;case"assign_annotation_id":t.assign_annotation_id(e.annotation_id,n);break;case"create_annotation":t.create_annotation__redo(e.annotation_id,n);break;case"create_nonspatial_annotation":t.create_nonspatial_annotation(e.annotation_id,n);break;case"start_complex_polygon":t.start_complex_polygon(e.annotation_id);break;case"merge_polygon_complex_layer":t.merge_polygon_complex_layer(e.annotation_id,n.layer_idx,!1,!0);break;case"simplify_polygon_complex_layer":t.simplify_polygon_complex_layer(e.annotation_id,n.active_idx,!0),t.redo();break;case"delete_annotations_in_polygon":t.delete_annotations_in_polygon(e.annotation_id,n);break;case"finish_modify_annotation":t.finish_modify_annotation__redo(e.annotation_id,n);break;default:(0,a.log_message)("Action type not recognized for redo: ".concat(e.act_type),a.LogLevel.WARNING)}}},1356:(t,e,n)=>{"use strict";var i=n(8967),r=n(8506),o=n(3227);function s(t){return(t=t.slice()).push(t[0]),i.polygon([t])}function a(t,e){if(e=e||{},!i.isObject(e))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return r.collectionOf(t,"Point","points"),i.featureCollection(o.voronoi().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(s))}t.exports=a,t.exports.default=a},1424:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ULABEL_VERSION:()=>i});const i="0.20.0"},1476:(t,e,n)=>{var i=n(3841),r=n(1137);t.exports=function(t,e,n,o){return e.length>0&&Array.isArray(e[0])?r(t,e,n,o):i(t,e,n,o)},t.exports.nested=r,t.exports.flat=i},1484:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4383)),o=i(n(2446)),s=i(n(2903));e.default=function(t,e,n,i){var a=s.default(6),l=e.features.map(function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null===(e=t.properties)||void 0===e?void 0:e[n]}});return a.load(l),t.features.forEach(function(t){t.properties||(t.properties={});var e=r.default(t),n=a.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),s=[];n.forEach(function(e){o.default([e.minX,e.minY],t)&&s.push(e.property)}),t.properties[i]=s}),t}},1514:t=>{"use strict";t.exports=Math.abs},1582:(t,e,n)=>{"use strict";var i=n(5341),r=n(4262),o=n(1476),s=n(3467).orient2d;function a(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],i=t[0],r=t[0],s=0;si[0]&&(i=a),a[1]r[1]&&(r=a)}var l=[e,n,i,r],u=l.slice();for(s=0;s=2&&h(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var i=[],r=t.length-1;r>=0;r--){for(;i.length>=2&&h(i[i.length-2],i[i.length-1],t[r])<=0;)i.pop();i.push(t[r])}return i.pop(),e.pop(),e.concat(i)}(u)}(t),s=new i(16);s.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},s.compareMinX=function(t,e){return t[0]-e[0]},s.compareMinY=function(t,e){return t[1]-e[1]},s.load(t);for(var a,u=[],c=0;cs||l.push({node:d,dist:g})}for(;l.length&&!l.peek().node.children;){var _=l.pop(),y=_.node,v=m(y,e,n),b=m(y,i,o);if(_.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function f(t,e,n){for(var i=Math.min(t[0],e[0]),r=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:i,minY:r,maxX:o,maxY:s}),l=0;l0!=h(t,e,i)>0&&h(n,i,t)>0!=h(n,i,e)>0}function g(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function _(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function y(t,e){var n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i}function m(t,e,n){var i=e[0],r=e[1],o=n[0]-i,s=n[1]-r;if(0!==o||0!==s){var a=((t[0]-i)*o+(t[1]-r)*s)/(o*o+s*s);a>1?(i=n[0],r=n[1]):a>0&&(i+=o*a,r+=s*a)}return(o=t[0]-i)*o+(s=t[1]-r)*s}function v(t,e,n,i,r,o,s,a){var l,u,c,p,f=n-t,h=i-e,d=s-r,g=a-o,_=t-r,y=e-o,m=f*f+h*h,v=f*d+h*g,b=d*d+g*g,x=f*_+h*y,w=d*_+g*y,E=m*b-v*v,k=E,S=E;0===E?(u=0,k=1,p=w,S=b):(p=m*w-v*x,(u=v*w-b*x)<0?(u=0,p=w,S=b):u>k&&(u=k,p=w+v,S=b)),p<0?(p=0,-x<0?u=0:-x>m?u=k:(u=-x,k=m)):p>S&&(p=S,-x+v<0?u=0:-x+v>m?u=k:(u=-x+v,k=m));var C=(1-(c=0===p?0:p/S))*r+c*s-((1-(l=0===u?0:u/k))*t+l*n),I=(1-c)*o+c*a-((1-l)*e+l*i);return C*C+I*I}function b(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}r.default&&(r=r.default),t.exports=a,t.exports.default=a},1589:(t,e,n)=>{"use strict";var i=n(8452),r=n(487),o=n(7675),s=n(5330),a=n(3984),l=r(s());i(l,{getPolyfill:s,implementation:o,shim:a}),t.exports=l},1715:(t,e,n)=>{"use strict";function i(){return new r}function r(){this.reset()}n.r(e),n.d(e,{geoAlbers:()=>wi,geoAlbersUsa:()=>Ei,geoArea:()=>W,geoAzimuthalEqualArea:()=>Ii,geoAzimuthalEqualAreaRaw:()=>Ci,geoAzimuthalEquidistant:()=>Mi,geoAzimuthalEquidistantRaw:()=>Ni,geoBounds:()=>Gt,geoCentroid:()=>Qt,geoCircle:()=>ce,geoClipExtent:()=>Se,geoConicConformal:()=>Ri,geoConicConformalRaw:()=>Ai,geoConicEqualArea:()=>xi,geoConicEqualAreaRaw:()=>bi,geoConicEquidistant:()=>zi,geoConicEquidistantRaw:()=>Fi,geoContains:()=>He,geoDistance:()=>ze,geoEquirectangular:()=>ji,geoEquirectangularRaw:()=>Di,geoGnomonic:()=>Gi,geoGnomonicRaw:()=>Bi,geoGraticule:()=>Ke,geoGraticule10:()=>Ze,geoIdentity:()=>Ui,geoInterpolate:()=>Qe,geoLength:()=>De,geoMercator:()=>Oi,geoMercatorRaw:()=>Li,geoNaturalEarth1:()=>Yi,geoNaturalEarth1Raw:()=>Xi,geoOrthographic:()=>Vi,geoOrthographicRaw:()=>$i,geoPath:()=>ii,geoProjection:()=>yi,geoProjectionMutator:()=>mi,geoRotation:()=>ae,geoStereographic:()=>Wi,geoStereographicRaw:()=>Hi,geoStream:()=>D,geoTransform:()=>li,geoTransverseMercator:()=>Ki,geoTransverseMercatorRaw:()=>Ji}),r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(t){s(o,t,this.t),s(this,o.s,this.s),this.s?this.t+=o.t:this.s=o.t},valueOf:function(){return this.s}};var o=new r;function s(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}var a=1e-6,l=1e-12,u=Math.PI,c=u/2,p=u/4,f=2*u,h=180/u,d=u/180,g=Math.abs,_=Math.atan,y=Math.atan2,m=Math.cos,v=Math.ceil,b=Math.exp,x=(Math.floor,Math.log),w=Math.pow,E=Math.sin,k=Math.sign||function(t){return t>0?1:t<0?-1:0},S=Math.sqrt,C=Math.tan;function I(t){return t>1?0:t<-1?u:Math.acos(t)}function N(t){return t>1?c:t<-1?-c:Math.asin(t)}function M(t){return(t=E(t/2))*t}function L(){}function O(t,e){t&&T.hasOwnProperty(t.type)&&T[t.type](t,e)}var P={Feature:function(t,e){O(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,o=m(e=(e*=d)/2+p),s=E(e),a=G*s,l=B*o+a*m(r),u=a*i*E(r);q.add(y(u,l)),z=t,B=o,G=s}function W(t){return U.reset(),D(t,X),2*U}function J(t){return[y(t[1],t[0]),N(t[2])]}function K(t){var e=t[0],n=t[1],i=m(n);return[i*m(e),i*E(e),E(n)]}function Z(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Q(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function tt(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function et(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function nt(t){var e=S(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var it,rt,ot,st,at,lt,ut,ct,pt,ft,ht,dt,gt,_t,yt,mt,vt,bt,xt,wt,Et,kt,St,Ct,It,Nt,Mt=i(),Lt={point:Ot,lineStart:Tt,lineEnd:At,polygonStart:function(){Lt.point=Rt,Lt.lineStart=Dt,Lt.lineEnd=jt,Mt.reset(),X.polygonStart()},polygonEnd:function(){X.polygonEnd(),Lt.point=Ot,Lt.lineStart=Tt,Lt.lineEnd=At,q<0?(it=-(ot=180),rt=-(st=90)):Mt>a?st=90:Mt<-a&&(rt=-90),ft[0]=it,ft[1]=ot}};function Ot(t,e){pt.push(ft=[it=t,ot=t]),est&&(st=e)}function Pt(t,e){var n=K([t*d,e*d]);if(ct){var i=Q(ct,n),r=Q([i[1],-i[0],0],i);nt(r),r=J(r);var o,s=t-at,a=s>0?1:-1,l=r[0]*h*a,u=g(s)>180;u^(a*atst&&(st=o):u^(a*at<(l=(l+360)%360-180)&&lst&&(st=e)),u?tFt(it,ot)&&(ot=t):Ft(t,ot)>Ft(it,ot)&&(it=t):ot>=it?(tot&&(ot=t)):t>at?Ft(it,t)>Ft(it,ot)&&(ot=t):Ft(t,ot)>Ft(it,ot)&&(it=t)}else pt.push(ft=[it=t,ot=t]);est&&(st=e),ct=n,at=t}function Tt(){Lt.point=Pt}function At(){ft[0]=it,ft[1]=ot,Lt.point=Ot,ct=null}function Rt(t,e){if(ct){var n=t-at;Mt.add(g(n)>180?n+(n>0?360:-360):n)}else lt=t,ut=e;X.point(t,e),Pt(t,e)}function Dt(){X.lineStart()}function jt(){Rt(lt,ut),X.lineEnd(),g(Mt)>a&&(it=-(ot=180)),ft[0]=it,ft[1]=ot,ct=null}function Ft(t,e){return(e-=t)<0?e+360:e}function zt(t,e){return t[0]-e[0]}function Bt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eFt(i[0],i[1])&&(i[1]=r[1]),Ft(r[0],i[1])>Ft(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(a=Ft(i[1],r[0]))>s&&(s=a,it=r[0],ot=i[1])}return pt=ft=null,it===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[it,rt],[ot,st]]}var qt={sphere:L,point:Ut,lineStart:Yt,lineEnd:Ht,polygonStart:function(){qt.lineStart=Wt,qt.lineEnd=Jt},polygonEnd:function(){qt.lineStart=Yt,qt.lineEnd=Ht}};function Ut(t,e){t*=d;var n=m(e*=d);Xt(n*m(t),n*E(t),E(e))}function Xt(t,e,n){++ht,gt+=(t-gt)/ht,_t+=(e-_t)/ht,yt+=(n-yt)/ht}function Yt(){qt.point=$t}function $t(t,e){t*=d;var n=m(e*=d);Ct=n*m(t),It=n*E(t),Nt=E(e),qt.point=Vt,Xt(Ct,It,Nt)}function Vt(t,e){t*=d;var n=m(e*=d),i=n*m(t),r=n*E(t),o=E(e),s=y(S((s=It*o-Nt*r)*s+(s=Nt*i-Ct*o)*s+(s=Ct*r-It*i)*s),Ct*i+It*r+Nt*o);dt+=s,mt+=s*(Ct+(Ct=i)),vt+=s*(It+(It=r)),bt+=s*(Nt+(Nt=o)),Xt(Ct,It,Nt)}function Ht(){qt.point=Ut}function Wt(){qt.point=Kt}function Jt(){Zt(kt,St),qt.point=Ut}function Kt(t,e){kt=t,St=e,t*=d,e*=d,qt.point=Zt;var n=m(e);Ct=n*m(t),It=n*E(t),Nt=E(e),Xt(Ct,It,Nt)}function Zt(t,e){t*=d;var n=m(e*=d),i=n*m(t),r=n*E(t),o=E(e),s=It*o-Nt*r,a=Nt*i-Ct*o,l=Ct*r-It*i,u=S(s*s+a*a+l*l),c=N(u),p=u&&-c/u;xt+=p*s,wt+=p*a,Et+=p*l,dt+=c,mt+=c*(Ct+(Ct=i)),vt+=c*(It+(It=r)),bt+=c*(Nt+(Nt=o)),Xt(Ct,It,Nt)}function Qt(t){ht=dt=gt=_t=yt=mt=vt=bt=xt=wt=Et=0,D(t,qt);var e=xt,n=wt,i=Et,r=e*e+n*n+i*i;return ru?t-f:t<-u?t+f:t,e]}function ie(t,e,n){return(t%=f)?e||n?ee(oe(t),se(e,n)):oe(t):e||n?se(e,n):ne}function re(t){return function(e,n){return[(e+=t)>u?e-f:e<-u?e+f:e,n]}}function oe(t){var e=re(t);return e.invert=re(-t),e}function se(t,e){var n=m(t),i=E(t),r=m(e),o=E(e);function s(t,e){var s=m(e),a=m(t)*s,l=E(t)*s,u=E(e),c=u*n+a*i;return[y(l*r-c*o,a*n-u*i),N(c*r+l*o)]}return s.invert=function(t,e){var s=m(e),a=m(t)*s,l=E(t)*s,u=E(e),c=u*r-l*o;return[y(l*r+u*o,a*n+c*i),N(c*n-a*i)]},s}function ae(t){function e(e){return(e=t(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e}return t=ie(t[0]*d,t[1]*d,t.length>2?t[2]*d:0),e.invert=function(e){return(e=t.invert(e[0]*d,e[1]*d))[0]*=h,e[1]*=h,e},e}function le(t,e,n,i,r,o){if(n){var s=m(e),a=E(e),l=i*n;null==r?(r=e+i*f,o=e-l/2):(r=ue(s,r),o=ue(s,o),(i>0?ro)&&(r+=i*f));for(var u,c=r;i>0?c>o:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fe(t,e){return g(t[0]-e[0])=0;--o)r.point((c=u[o])[0],c[1]);else i(f.x,f.p.x,-1,r);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);r.lineEnd()}}}function ge(t){if(e=t.length){for(var e,n,i=0,r=t[0];++ie?1:t>=e?0:NaN}ne.invert=ne;var ye,me;1===(ye=_e).length&&(me=ye,ye=function(t,e){return _e(me(t),e)});var ve=Array.prototype;ve.slice,ve.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);function be(t){for(var e,n,i,r=t.length,o=-1,s=0;++o=0;)for(e=(i=t[r]).length;--e>=0;)n[--s]=i[e];return n}function xe(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i0)do{l.point(0===c||3===c?t:n,c>1?i:e)}while((c=(c+a+4)%4)!==p);else l.point(o[0],o[1])}function s(i,r){return g(i[0]-t)0?0:3:g(i[0]-n)0?2:1:g(i[1]-e)0?1:0:r>0?3:2}function l(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),i=s(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var a,u,c,p,f,h,d,g,_,y,m,v=s,b=pe(),x={point:w,lineStart:function(){x.point=E,u&&u.push(c=[]);y=!0,_=!1,d=g=NaN},lineEnd:function(){a&&(E(p,f),h&&_&&b.rejoin(),a.push(b.result()));x.point=w,_&&v.lineEnd()},polygonStart:function(){v=b,a=[],u=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=u.length;ni&&(f-o)*(i-s)>(h-s)*(t-o)&&++e:h<=i&&(f-o)*(i-s)<(h-s)*(t-o)&&--e;return e}(),n=m&&e,r=(a=be(a)).length;(n||r)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),r&&de(a,l,e,o,s),s.polygonEnd());v=s,a=u=c=null}};function w(t,e){r(t,e)&&v.point(t,e)}function E(o,s){var a=r(o,s);if(u&&c.push([o,s]),y)p=o,f=s,h=a,y=!1,a&&(v.lineStart(),v.point(o,s));else if(a&&_)v.point(o,s);else{var l=[d=Math.max(Ee,Math.min(we,d)),g=Math.max(Ee,Math.min(we,g))],b=[o=Math.max(Ee,Math.min(we,o)),s=Math.max(Ee,Math.min(we,s))];!function(t,e,n,i,r,o){var s,a=t[0],l=t[1],u=0,c=1,p=e[0]-a,f=e[1]-l;if(s=n-a,p||!(s>0)){if(s/=p,p<0){if(s0){if(s>c)return;s>u&&(u=s)}if(s=r-a,p||!(s<0)){if(s/=p,p<0){if(s>c)return;s>u&&(u=s)}else if(p>0){if(s0)){if(s/=f,f<0){if(s0){if(s>c)return;s>u&&(u=s)}if(s=o-l,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>u&&(u=s)}else if(f>0){if(s0&&(t[0]=a+u*p,t[1]=l+u*f),c<1&&(e[0]=a+c*p,e[1]=l+c*f),!0}}}}}(l,b,t,e,n,i)?a&&(v.lineStart(),v.point(o,s),m=!1):(_||(v.lineStart(),v.point(l[0],l[1])),v.point(b[0],b[1]),a||v.lineEnd(),m=!1)}d=o,g=s,_=a}return x}}function Se(){var t,e,n,i=0,r=0,o=960,s=500;return n={stream:function(n){return t&&e===n?t:t=ke(i,r,o,s)(e=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],o=+a[1][0],s=+a[1][1],t=e=null,n):[[i,r],[o,s]]}}}var Ce=i();function Ie(t,e){var n=e[0],i=e[1],r=[E(n),-m(n),0],o=0,s=0;Ce.reset();for(var l=0,c=t.length;l=0?1:-1,P=O*L,T=P>u,A=b*I;if(Ce.add(y(A*O*E(P),x*M+A*m(P))),o+=T?L+O*f:L,T^_>=n^S>=n){var R=Q(K(g),K(k));nt(R);var D=Q(r,R);nt(D);var j=(T^L>=0?-1:1)*N(D[2]);(i>j||i===j&&(R[0]||R[1]))&&(s+=T^L>=0?1:-1)}}return(o<-a||oa}).map(u)).concat(xe(v(o/d)*d,r,d).filter(function(t){return g(t%y)>a}).map(c))}return b.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},b.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(f(s).slice(1),p(n).reverse().slice(1),f(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(m)):[[i,l],[n,s]]},b.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),b.precision(m)):[[e,o],[t,r]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(_=+t[0],y=+t[1],b):[_,y]},b.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],b):[h,d]},b.precision=function(a){return arguments.length?(m=+a,u=We(o,r,90),c=Je(e,t,m),p=We(l,s,90),f=Je(i,n,m),b):m},b.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function Ze(){return Ke()()}function Qe(t,e){var n=t[0]*d,i=t[1]*d,r=e[0]*d,o=e[1]*d,s=m(i),a=E(i),l=m(o),u=E(o),c=s*m(n),p=s*E(n),f=l*m(r),g=l*E(r),_=2*N(S(M(o-i)+s*l*M(r-n))),v=E(_),b=_?function(t){var e=E(t*=_)/v,n=E(_-t)/v,i=n*c+e*f,r=n*p+e*g,o=n*a+e*u;return[y(r,i)*h,y(o,S(i*i+r*r))*h]}:function(){return[n*h,i*h]};return b.distance=_,b}function tn(t){return t}var en,nn,rn,on,sn=i(),an=i(),ln={point:L,lineStart:L,lineEnd:L,polygonStart:function(){ln.lineStart=un,ln.lineEnd=fn},polygonEnd:function(){ln.lineStart=ln.lineEnd=ln.point=L,sn.add(g(an)),an.reset()},result:function(){var t=sn/2;return sn.reset(),t}};function un(){ln.point=cn}function cn(t,e){ln.point=pn,en=rn=t,nn=on=e}function pn(t,e){an.add(on*t-rn*e),rn=t,on=e}function fn(){pn(en,nn)}const hn=ln;var dn=1/0,gn=dn,_n=-dn,yn=_n,mn={point:function(t,e){t_n&&(_n=t);eyn&&(yn=e)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var t=[[dn,gn],[_n,yn]];return _n=yn=-(gn=dn=1/0),t}};const vn=mn;var bn,xn,wn,En,kn=0,Sn=0,Cn=0,In=0,Nn=0,Mn=0,Ln=0,On=0,Pn=0,Tn={point:An,lineStart:Rn,lineEnd:Fn,polygonStart:function(){Tn.lineStart=zn,Tn.lineEnd=Bn},polygonEnd:function(){Tn.point=An,Tn.lineStart=Rn,Tn.lineEnd=Fn},result:function(){var t=Pn?[Ln/Pn,On/Pn]:Mn?[In/Mn,Nn/Mn]:Cn?[kn/Cn,Sn/Cn]:[NaN,NaN];return kn=Sn=Cn=In=Nn=Mn=Ln=On=Pn=0,t}};function An(t,e){kn+=t,Sn+=e,++Cn}function Rn(){Tn.point=Dn}function Dn(t,e){Tn.point=jn,An(wn=t,En=e)}function jn(t,e){var n=t-wn,i=e-En,r=S(n*n+i*i);In+=r*(wn+t)/2,Nn+=r*(En+e)/2,Mn+=r,An(wn=t,En=e)}function Fn(){Tn.point=An}function zn(){Tn.point=Gn}function Bn(){qn(bn,xn)}function Gn(t,e){Tn.point=qn,An(bn=wn=t,xn=En=e)}function qn(t,e){var n=t-wn,i=e-En,r=S(n*n+i*i);In+=r*(wn+t)/2,Nn+=r*(En+e)/2,Mn+=r,Ln+=(r=En*t-wn*e)*(wn+t),On+=r*(En+e),Pn+=3*r,An(wn=t,En=e)}const Un=Tn;function Xn(t){this._context=t}Xn.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,f)}},result:L};var Yn,$n,Vn,Hn,Wn,Jn=i(),Kn={point:L,lineStart:function(){Kn.point=Zn},lineEnd:function(){Yn&&Qn($n,Vn),Kn.point=L},polygonStart:function(){Yn=!0},polygonEnd:function(){Yn=null},result:function(){var t=+Jn;return Jn.reset(),t}};function Zn(t,e){Kn.point=Qn,$n=Hn=t,Vn=Wn=e}function Qn(t,e){Hn-=t,Wn-=e,Jn.add(S(Hn*Hn+Wn*Wn)),Hn=t,Wn=e}const ti=Kn;function ei(){this._string=[]}function ni(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ii(t,e){var n,i,r=4.5;function o(t){return t&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),D(t,n(i))),i.result()}return o.area=function(t){return D(t,n(hn)),hn.result()},o.measure=function(t){return D(t,n(ti)),ti.result()},o.bounds=function(t){return D(t,n(vn)),vn.result()},o.centroid=function(t){return D(t,n(Un)),Un.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,tn):(t=e).stream,o):t},o.context=function(t){return arguments.length?(i=null==t?(e=null,new ei):new Xn(e=t),"function"!=typeof r&&i.pointRadius(r),o):e},o.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(i.pointRadius(+t),+t),o):r},o.projection(t).context(e)}function ri(t,e,n,i){return function(r,o){var s,a,l,u=e(o),c=r.invert(i[0],i[1]),p=pe(),f=e(p),h=!1,d={point:g,lineStart:y,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=b,d.lineEnd=x,a=[],s=[]},polygonEnd:function(){d.point=g,d.lineStart=y,d.lineEnd=m,a=be(a);var t=Ie(s,c);a.length?(h||(o.polygonStart(),h=!0),de(a,si,t,n,o)):t&&(h||(o.polygonStart(),h=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),h&&(o.polygonEnd(),h=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,n){var i=r(e,n);t(e=i[0],n=i[1])&&o.point(e,n)}function _(t,e){var n=r(t,e);u.point(n[0],n[1])}function y(){d.point=_,u.lineStart()}function m(){d.point=g,u.lineEnd()}function v(t,e){l.push([t,e]);var n=r(t,e);f.point(n[0],n[1])}function b(){f.lineStart(),l=[]}function x(){v(l[0][0],l[0][1]),f.lineEnd();var t,e,n,i,r=f.clean(),u=p.result(),c=u.length;if(l.pop(),s.push(l),l=null,c)if(1&r){if((e=(n=u[0]).length-1)>0){for(h||(o.polygonStart(),h=!0),o.lineStart(),t=0;t1&&2&r&&u.push(u.pop().concat(u.shift())),a.push(u.filter(oi))}return d}}function oi(t){return t.length>1}function si(t,e){return((t=t.x)[0]<0?t[1]-c-a:c-t[1])-((e=e.x)[0]<0?e[1]-c-a:c-e[1])}ei.prototype={_radius:4.5,_circle:ni(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=ni(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};const ai=ri(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var l=o>0?u:-u,p=g(o-n);g(p-u)0?c:-c),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(l,i),t.point(o,i),e=0):r!==l&&p>=u&&(g(n-r)a?_((E(e)*(o=m(i))*E(n)-E(i)*(r=m(e))*E(t))/(r*o*s)):(e+i)/2}(n,i,o,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(l,i),e=0),t.point(n=o,i=s),r=l},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*c,i.point(-u,r),i.point(0,r),i.point(u,r),i.point(u,0),i.point(u,-r),i.point(0,-r),i.point(-u,-r),i.point(-u,0),i.point(-u,r);else if(g(t[0]-e[0])>a){var o=t[0]4*e&&m--){var E=s+h,k=l+d,C=u+_,I=S(E*E+k*k+C*C),M=N(C/=I),L=g(g(C)-1)e||g((b*A+x*R)/w-.5)>.3||s*h+l*d+u*_0,r=g(n)>a;function o(t,e){return m(t)*m(e)>n}function s(t,e,i){var r=[1,0,0],o=Q(K(t),K(e)),s=Z(o,o),l=o[0],c=s-l*l;if(!c)return!i&&t;var p=n*s/c,f=-n*l/c,h=Q(r,o),d=et(r,p);tt(d,et(o,f));var _=h,y=Z(d,_),m=Z(_,_),v=y*y-m*(Z(d,d)-1);if(!(v<0)){var b=S(v),x=et(_,(-y-b)/m);if(tt(x,d),x=J(x),!i)return x;var w,E=t[0],k=e[0],C=t[1],I=e[1];k0^x[1]<(g(x[0]-E)u^(E<=x[0]&&x[0]<=k)){var L=et(_,(-y+b)/m);return tt(L,d),[x,J(L)]}}}function l(e,n){var r=i?t:u-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return ri(o,function(t){var e,n,c,p,f;return{lineStart:function(){p=c=!1,f=1},point:function(h,d){var g,_=[h,d],y=o(h,d),m=i?y?0:l(h,d):y?l(h+(h<0?u:-u),d):0;if(!e&&(p=c=y)&&t.lineStart(),y!==c&&(!(g=s(e,_))||fe(e,g)||fe(_,g))&&(_[0]+=a,_[1]+=a,y=o(_[0],_[1])),y!==c)f=0,y?(t.lineStart(),g=s(_,e),t.point(g[0],g[1])):(g=s(e,_),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(r&&e&&i^y){var v;m&n||!(v=s(_,e,!0))||(f=0,i?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!y||e&&fe(e,_)||t.point(_[0],_[1]),e=_,c=y,n=m},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return f|(p&&c)<<1}}},function(n,i,r,o){le(o,t,e,r,n,i)},i?[0,-t]:[-u,t-u])}(C=t*d,6*d):(C=null,ai),D()):C*h},P.clipExtent=function(t){return arguments.length?(M=null==t?(N=s=l=c=null,tn):ke(N=+t[0][0],s=+t[0][1],l=+t[1][0],c=+t[1][1]),D()):null==N?null:[[N,s],[l,c]]},P.scale=function(t){return arguments.length?(_=+t,R()):_},P.translate=function(t){return arguments.length?(y=+t[0],v=+t[1],R()):[y,v]},P.center=function(t){return arguments.length?(b=t[0]%360*d,x=t[1]%360*d,R()):[b*h,x*h]},P.rotate=function(t){return arguments.length?(w=t[0]%360*d,E=t[1]%360*d,k=t.length>2?t[2]%360*d:0,R()):[w*h,E*h,k*h]},P.precision=function(t){return arguments.length?(O=gi(A,L=t*t),D()):S(L)},P.fitExtent=function(t,e){return pi(P,t,e)},P.fitSize=function(t,e){return fi(P,t,e)},function(){return e=t.apply(this,arguments),P.invert=e.invert&&T,R()}}function vi(t){var e=0,n=u/3,i=mi(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*d,n=t[1]*d):[e*h,n*h]},r}function bi(t,e){var n=E(t),i=(n+E(e))/2;if(g(i)=.12&&r<.234&&i>=-.425&&i<-.214?l:r>=.166&&r<.234&&i>=-.214&&i<-.115?u:s).invert(t)},p.stream=function(n){return t&&e===n?t:(i=[s.stream(e=n),l.stream(n),u.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n0?e<-c+a&&(e=-c+a):e>c-a&&(e=c-a);var n=r/w(Ti(e),i);return[n*E(i*t),r-n*m(i*t)]}return o.invert=function(t,e){var n=r-e,o=k(i)*S(t*t+n*n);return[y(t,g(n))/i*k(n),2*_(w(r/o,1/i))-c]},o}function Ri(){return vi(Ai).scale(109.5).parallels([30,30])}function Di(t,e){return[t,e]}function ji(){return yi(Di).scale(152.63)}function Fi(t,e){var n=m(t),i=t===e?E(t):(n-m(e))/(e-t),r=n/i+t;if(g(i)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}Ni.invert=Si(function(t){return t}),Li.invert=function(t,e){return[t,2*_(b(e))-c]},Di.invert=Di,Bi.invert=Si(_),Xi.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,s=o*o;i-=n=(i*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(g(n)>a&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},$i.invert=Si(N),Hi.invert=Si(function(t){return 2*_(t)}),Ji.invert=function(t,e){return[-e,2*_(b(t))-c]}},1734:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1323)),o=n(8421);e.default=function(t,e){var n=!1;return o.flattenEach(t,function(t){o.flattenEach(e,function(e){if(!0===n)return!0;n=!r.default(t.geometry,e.geometry)})}),n}},1756:(t,e,n)=>{"use strict";var i=n(6766),r=n(5810),o=i.eudist,s=(i.mandist,i.dist,r.kmrand),a=r.kmpp;function l(t,e,n){n=n||[];for(var i=0;i0,y=[];if(n)r="kmrand"==n?s(t,e):"kmpp"==n?a(t,e):n;else for(var m={};r.length{"use strict";var i=n(5764),r=n(375),o=n(8421),s=n(8967),a=n(8506);function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=l(i),c=l(r);function p(t,e,n,i,r){if(r=r||{},!s.isObject(r))throw new Error("options is invalid");var l=r.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==i)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if(f(n)===f(i))return u.default(t,e,r);var p=a.getCoords(t),h=c.default(t,e,n,i,r),d=[[p]];return o.coordEach(h,function(t){d[0].push(t)}),d[0].push(p),s.polygon(d,l)}function f(t){var e=t%360;return e<0&&(e+=360),e}t.exports=p,t.exports.default=p},1925:(t,e,n)=>{"use strict";var i=n(3711),r=n(6649),o=n(4408),s=n(4383),a=n(2307),l=n(9778),u=n(7153),c=n(8421),p=n(8967),f=n(8506);function h(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var d=h(i),g=h(r),_=h(o),y=h(s),m=h(a),v=h(l),b=h(u);function x(t,e,n){if(n=n||{},!p.isObject(n))throw new Error("options is invalid");var i=n.origin,r=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(i)||"object"==typeof i;return!0!==r&&(t=d.default(t)),"FeatureCollection"!==t.type||o?w(t,e,i):(c.featureEach(t,function(n,r){t.features[r]=w(n,e,i)}),t)}function w(t,e,n){var i="Point"===f.getType(t);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return f.getCoord(e);var n=t.bbox?t.bbox:y.default(t),i=n[0],r=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return p.point([i,r]);case"se":case"southeast":case"eastsouth":case"bottomright":return p.point([o,r]);case"nw":case"northwest":case"westnorth":case"topleft":return p.point([i,s]);case"ne":case"northeast":case"eastnorth":case"topright":return p.point([o,s]);case"center":return g.default(t);case void 0:case null:case"centroid":return _.default(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||c.coordEach(t,function(t){var i=v.default(n,t),r=m.default(n,t),o=i*e,s=f.getCoords(b.default(n,o,r));t[0]=s[0],t[1]=s[1],3===t.length&&(t[2]*=e)}),t}t.exports=x,t.exports.default=x},1972:(t,e,n)=>{"use strict";var i=n(8421),r=n(8506),o=n(8967);function s(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function a(t,e){return t[0]*e[1]-e[0]*t[1]}function l(t,e){return!function(t,e){return 0===a(s(t),s(e))}(t,e)&&function(t,e){var n,i,r=t[0],o=s(t),l=e[0],u=s(e),c=a(o,u),p=function(t,e){return[t[0]+e[0],t[1]+e[1]]}(r,function(t,e){return[t*e[0],t*e[1]]}(a((i=r,[(n=l)[0]-i[0],n[1]-i[1]]),u)/c,o));return p}(t,e)}function u(t,e,n){if(n=n||{},!o.isObject(n))throw new Error("options is invalid");var s=n.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var a=r.getType(t),l=t.properties;switch(a){case"LineString":return c(t,e,s);case"MultiLineString":var u=[];return i.flattenEach(t,function(t){u.push(c(t,e,s).geometry.coordinates)}),o.multiLineString(u,l);default:throw new Error("geometry "+a+" is not supported")}}function c(t,e,n){var i=[],s=o.lengthToDegrees(e,n),a=r.getCoords(t),u=[];return a.forEach(function(t,e){if(e!==a.length-1){var n=(c=t,p=a[e+1],f=s,h=Math.sqrt((c[0]-p[0])*(c[0]-p[0])+(c[1]-p[1])*(c[1]-p[1])),d=c[0]+f*(p[1]-c[1])/h,g=p[0]+f*(p[1]-c[1])/h,_=c[1]+f*(c[0]-p[0])/h,y=p[1]+f*(c[0]-p[0])/h,[[d,_],[g,y]]);if(i.push(n),e>0){var r=i[e-1],o=l(n,r);!1!==o&&(r[1]=o,n[0]=o),u.push(r[0]),e===a.length-2&&(u.push(n[0]),u.push(n[1]))}2===a.length&&(u.push(n[0]),u.push(n[1]))}var c,p,f,h,d,g,_,y}),o.lineString(u,t.properties)}t.exports=u,t.exports.default=u},2057:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9004)),o=n(8506),s=n(8967);e.default=function(t,e,n){void 0===n&&(n={});var i=o.getGeom(t),a=o.getGeom(e),l=r.default.union(i.coordinates,a.coordinates);return 0===l.length?null:1===l.length?s.polygon(l[0],n.properties):s.multiPolygon(l,n.properties)}},2086:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506);function o(t){var e=r.getCoords(t);if(2===e.length&&!s(e[0],e[1]))return e;var n=[],i=e.length-1,o=n.length;n.push(e[0]);for(var l=1;l2&&a(n[o-3],n[o-1],n[o-2])&&n.splice(n.length-2,1))}if(n.push(e[e.length-1]),o=n.length,s(e[0],e[e.length-1])&&o<4)throw new Error("invalid polygon");return a(n[o-3],n[o-1],n[o-2])&&n.splice(n.length-2,1),n}function s(t,e){return t[0]===e[0]&&t[1]===e[1]}function a(t,e,n){var i=n[0],r=n[1],o=t[0],s=t[1],a=e[0],l=e[1],u=a-o,c=l-s;return 0===(i-o)*c-(r-s)*u&&(Math.abs(u)>=Math.abs(c)?u>0?o<=i&&i<=a:a<=i&&i<=o:c>0?s<=r&&r<=l:l<=r&&r<=s)}e.default=function(t,e){void 0===e&&(e={});var n="object"==typeof e?e.mutate:e;if(!t)throw new Error("geojson is required");var s=r.getType(t),a=[];switch(s){case"LineString":a=o(t);break;case"MultiLineString":case"Polygon":r.getCoords(t).forEach(function(t){a.push(o(t))});break;case"MultiPolygon":r.getCoords(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(o(t))}),a.push(e)});break;case"Point":return t;case"MultiPoint":var l={};r.getCoords(t).forEach(function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(l,e)||(a.push(t),l[e]=!0)});break;default:throw new Error(s+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=a,t):{type:s,coordinates:a}:!0===n?(t.geometry.coordinates=a,t):i.feature({type:s,coordinates:a},t.properties,{bbox:t.bbox,id:t.id})}},2120:(t,e,n)=>{"use strict";var i=n(4383),r=n(3932);function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(i),a=o(r);function l(t){return a.default(s.default(t))}t.exports=l,t.exports.default=l},2141:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967);e.default=function(t,e){var n=!1;return i.featureCollection(function(t){if(t.length<3)return[];t.sort(o);var e,n,i,a,l,u,c=t.length-1,p=t[c].x,f=t[0].x,h=t[c].y,d=h,g=1e-12;for(;c--;)t[c].yd&&(d=t[c].y);var _,y=f-p,m=d-h,v=y>m?y:m,b=.5*(f+p),x=.5*(d+h),w=[new r({__sentinel:!0,x:b-20*v,y:x-v},{__sentinel:!0,x:b,y:x+20*v},{__sentinel:!0,x:b+20*v,y:x-v})],E=[],k=[];c=t.length;for(;c--;){for(k.length=0,_=w.length;_--;)(y=t[c].x-w[_].x)>0&&y*y>w[_].r?(E.push(w[_]),w.splice(_,1)):y*y+(m=t[c].y-w[_].y)*m>w[_].r||(k.push(w[_].a,w[_].b,w[_].b,w[_].c,w[_].c,w[_].a),w.splice(_,1));for(s(k),_=k.length;_;)n=k[--_],e=k[--_],i=t[c],a=n.x-e.x,l=n.y-e.y,u=2*(a*(i.y-n.y)-l*(i.x-n.x)),Math.abs(u)>g&&w.push(new r(e,n,i))}Array.prototype.push.apply(E,w),c=E.length;for(;c--;)(E[c].a.__sentinel||E[c].b.__sentinel||E[c].c.__sentinel)&&E.splice(c,1);return E}(t.features.map(function(t){var i={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?i.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,i.z=t.geometry.coordinates[2]),i})).map(function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],o=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),o.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},i.polygon([[e,r,o,e]],s)}))};var r=function(t,e,n){this.a=t,this.b=e,this.c=n;var i,r,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,l=n.y-t.y,u=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+l*(t.y+n.y),p=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(l*u-s*c)/p,this.y=(o*c-a*u)/p,i=this.x-t.x,r=this.y-t.y,this.r=i*i+r*r};function o(t,e){return e.x-t.x}function s(t){var e,n,i,r,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],i=s;i;)if(o=t[--i],e===(r=t[--i])&&n===o||e===o&&n===r){t.splice(s,2),t.splice(i,2),s-=2;continue t}}},2163:(t,e,n)=>{"use strict";var i=n(3711),r=n(7333),o=n(8421),s=n(8506),a=n(8967);function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=l(i),c=l(r);function p(t,e){if(e=e||{},!a.isObject(e))throw new Error("options is invalid");var n=e.reverse||!1,i=e.mutate||!1;if(!t)throw new Error(" is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof i)throw new Error(" must be a boolean");!1===i&&(t=u.default(t));var r=[];switch(t.type){case"GeometryCollection":return o.geomEach(t,function(t){f(t,n)}),t;case"FeatureCollection":return o.featureEach(t,function(t){o.featureEach(f(t,n),function(t){r.push(t)})}),a.featureCollection(r)}return f(t,n)}function f(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return o.geomEach(t,function(t){f(t,e)}),t;case"LineString":return h(s.getCoords(t),e),t;case"Polygon":return d(s.getCoords(t),e),t;case"MultiLineString":return s.getCoords(t).forEach(function(t){h(t,e)}),t;case"MultiPolygon":return s.getCoords(t).forEach(function(t){d(t,e)}),t;case"Point":case"MultiPoint":return t}}function h(t,e){c.default(t)===e&&t.reverse()}function d(t,e){c.default(t[0])!==e&&t[0].reverse();for(var n=1;n{"use strict";var i=n(8840),r=n(4957),o=n(8421),s=n(8967);function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l=a(i),u=a(r);function c(t,e,n){if(n=n||{},!s.isObject(n))throw new Error("options is invalid");var i=n.units,r=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var a=[];return o.flattenEach(t,function(t){r&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,i){var r=l.default(t,{units:n});if(r<=e)return i(t);var o=r/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506);function o(t,e){var n=i.degreesToRadians(t[1]),r=i.degreesToRadians(e[1]),o=i.degreesToRadians(e[0]-t[0]);o>Math.PI&&(o-=2*Math.PI),o<-Math.PI&&(o+=2*Math.PI);var s=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),a=Math.atan2(o,s);return(i.radiansToDegrees(a)+360)%360}e.default=function(t,e,n){var i;return void 0===n&&(n={}),(i=n.final?o(r.getCoord(e),r.getCoord(t)):o(r.getCoord(t),r.getCoord(e)))>180?-(360-i):i}},2347:t=>{function e(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}e.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},e.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,i=0;i0){for(l=0;l=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,i=0;i{"use strict";var i=n(8506),r=Math.PI/180,o=180/Math.PI,s=function(t,e){this.lon=t,this.lat=e,this.x=r*t,this.y=r*e};s.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},s.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new s(e,t)};var a=function(){this.coords=[],this.length=0};a.prototype.move_to=function(t){this.length++,this.coords.push(t)};var l=function(t){this.properties=t||{},this.geometries=[]};l.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;ed&&(y>f&&_f&&yc&&(c=m)}var v=[];if(u&&c0&&Math.abs(w-n[x-1][0])>d){var E=parseFloat(n[x-1][0]),k=parseFloat(n[x-1][1]),S=parseFloat(n[x][0]),C=parseFloat(n[x][1]);if(E>-180&&E-180&&n[x-1][0]f&&E<180&&-180===S&&x+1f&&n[x-1][0]<180){b.push([180,n[x][1]]),x++,b.push([n[x][0],n[x][1]]);continue}if(Ef){var I=E;E=S,S=I;var N=k;k=C,C=N}if(E>f&&S=180&&Ef?180:-180,L]),(b=[]).push([n[x-1][0]>f?-180:180,L]),v.push(b)}else b=[],v.push(b);b.push([w,n[x][1]])}else b.push([n[x][0],n[x][1]])}}else{var O=[];v.push(O);for(var P=0;P{"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=i(n(9391));function o(t){var e=t[0],n=t[1],i=t[2],o=t[3];if(r.default(t.slice(0,2),[i,n])>=r.default(t.slice(0,2),[e,o])){var s=(n+o)/2;return[e,s-(i-e)/2,i,s+(i-e)/2]}var a=(e+i)/2;return[a-(o-n)/2,n,a+(o-n)/2,o]}t.exports=o,t.exports.default=o},2446:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8506);function r(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;rt[1]!=u>t[1]&&t[0]<(l-s)*(t[1]-a)/(u-a)+s&&(i=!i)}return i}e.default=function(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=i.getCoord(t),s=i.getGeom(e),a=s.type,l=e.bbox,u=s.coordinates;if(l&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(o,l))return!1;"Polygon"===a&&(u=[u]);for(var c=!1,p=0;p{"use strict";function n(t){var e,n;return t.classification_payloads.forEach(function(t){(void 0===n||t.confidence>n)&&(e=t.class_id,n=t.confidence)}),e.toString()}function i(t,e,n){void 0===n&&(n="human"),void 0===t.deprecated_by&&(t.deprecated_by={}),t.deprecated_by[n]=e,Object.values(t.deprecated_by).some(function(t){return t})?t.deprecated=!0:t.deprecated=!1}function r(t,e){return t>e}function o(t,e,n,i,r,o){var s,a,l,u=r-n,c=o-i,p=u*u+c*c;0!=p&&(s=((t-n)*u+(e-i)*c)/p),void 0===s||s<0?(a=n,l=i):s>1?(a=r,l=o):(a=n+s*u,l=i+s*c);var f=t-a,h=e-l;return Math.sqrt(f*f+h*h)}function s(t,e,n){void 0===n&&(n=null);for(var i,r=t.spatial_payload[0][0],s=t.spatial_payload[0][1],a=0;ae&&(e=t.classification_payloads[n].confidence);return e},e.get_annotation_class_id=n,e.mark_deprecated=i,e.value_is_lower_than_filter=function(t,e){return th.closest_row.distance;e&&!t.deprecated?(i(t,!0,"distance_from_row"),b[t.subtask_key].push(t.id)):!e&&t.deprecated&&(i(t,!1,"distance_from_row"),b[t.subtask_key].push(t.id))});if(s)for(var x in b)t.redraw_multiple_spatial_annotations(b[x],x);null===t.filter_distance_overlay||void 0===t.filter_distance_overlay?console.warn("\n filter_distance_overlay currently does not exist.\n As such, unable to update distance overlay\n "):(t.filter_distance_overlay.update_annotations(p),t.filter_distance_overlay.update_distances(h),t.filter_distance_overlay.update_mode(f),t.filter_distance_overlay.update_display_overlay(o),t.filter_distance_overlay.draw_overlay(n))},e.findAllPolylineClassDefinitions=function(t){var e=[];for(var n in t.subtasks){var i=t.subtasks[n];i.allowed_modes.includes("polyline")&&i.class_defs.forEach(function(t){e.push(t)})}return e}},2583:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8421);e.default=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return r.featureEach(t,function(t){var n,i,r,o;switch(null===(o=t.geometry)||void 0===o?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(i=e.MultiLineString.coordinates).push.apply(i,t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(r=e.MultiPolygon.coordinates).push.apply(r,t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties)}}),i.featureCollection(Object.keys(e).filter(function(t){return e[t].coordinates.length}).sort().map(function(t){var n={type:t,coordinates:e[t].coordinates},r={collectedProperties:e[t].properties};return i.feature(n,r)}))}},2748:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BACK_Z_INDEX:()=>r,BBOX3_SVG:()=>_,BBOX_SVG:()=>s,BUTTON_LOADER_HTML:()=>m,COLORS:()=>v,CONTOUR_SVG:()=>p,DELETE_BBOX_SVG:()=>a,DELETE_POLYGON_SVG:()=>c,DEMO_ANNOTATION:()=>o,FRONT_Z_INDEX:()=>i,GLOBAL_SVG:()=>h,POINT_SVG:()=>l,POLYGON_SVG:()=>u,POLYLINE_SVG:()=>g,TBAR_SVG:()=>f,WHOLE_IMAGE_SVG:()=>d,get_init_style:()=>y});const i=100,r=75,o={id:"7c64913a-9d8c-475a-af1a-658944e37c31",new:!0,created_by:"TestUser",created_at:"2020-12-21T02:41:47.304Z",deprecated:!1,spatial_type:"contour",spatial_payload:[[4,25],[4,25],[4,24],[4,23],[4,22],[4,22],[5,22],[5,21],[5,20],[6,20],[6,19],[7,19],[7,18],[8,18],[8,18],[10,18],[11,18],[11,17],[12,17],[12,16],[12,16],[13,16],[14,15],[16,14],[16,14],[17,14],[18,14],[18,13],[19,13],[20,13],[20,13],[21,13],[22,13],[23,13],[24,13],[24,13],[25,13],[26,13],[27,13],[28,13],[28,13],[29,13],[30,13],[31,13],[32,13],[34,13],[36,14],[36,14],[37,15],[40,15],[40,16],[41,16],[42,17],[43,17],[44,18],[44,18],[45,18],[46,18],[47,18],[47,18],[48,18],[48,18],[49,19],[50,20],[52,20],[52,20],[53,21],[54,21],[55,21],[56,21],[57,21],[58,22],[59,22],[60,22],[60,22],[61,22],[63,22],[64,22],[64,22],[65,22],[66,22],[67,22],[68,22],[68,21],[69,21],[70,20],[70,19],[71,19],[71,18],[72,18],[72,18],[72,18],[73,18],[75,17],[75,16],[76,16],[76,16],[76,15],[77,14],[78,14],[79,14],[79,13],[79,12],[80,12],[81,12],[82,11],[83,11],[84,10],[85,10],[86,10],[87,10],[88,10],[88,10],[89,10],[90,10],[91,10],[92,10],[92,10],[93,10],[94,10],[94,10],[95,10],[96,10],[96,11],[96,11],[98,11],[98,12],[99,12],[100,13],[100,14],[101,14],[101,15],[102,15],[104,16],[104,17],[104,18],[105,18],[106,18],[106,18],[107,18],[107,19],[107,20],[108,20],[108,21],[108,21],[108,22],[109,22],[109,22],[109,23]],classification_payloads:null,annotation_meta:"is_assigned_to_each_annotation"},s='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',a='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',l='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n\n',u='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',c='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',p='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',f='\n\n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n\n',h='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',d='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n \n \n\n',g='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',_='\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n \n \n image/svg+xml\n \n \n \n \n\n\n \n \n\n\n \n \n \n \n\n\n';let y=t=>`\ndiv#${t} {\n display: none;\n}\ndiv#${t} * {\n box-sizing: content-box;\n text-align: center;\n}\ndiv#${t}.ulabel-night {\n background-color: black;\n}\ndiv#${t} div.full_ulabel_container_ {\n font-family: sans-serif;\n}\n\ndiv#${t} .ulabel-hidden {\n display: none !important;\n}\n\ndiv#${t} div.annbox_cls, div#${t} div.toolbox_cls {\n height: 100%;\n}\ndiv#${t} div.annbox_cls {\n width: calc(100% - 320px);\n background-color: black;\n overflow: scroll;\n position: absolute;\n top: 0;\n left: 0;\n}\ndiv#${t} div.annbox_cls img.image_frame {\n position: absolute;\n top: 0;\n left: 0;\n max-width: none;\n max-height: none;\n}\n\n\n/* Frame annotation dialog */\ndiv#${t} div.frame_annotation_dialog {\n width: 60px;\n overflow: hidden;\n position: absolute;\n z-index: 80;\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(143, 143, 143);\n transition: opacity 0.1s, width 0.3s, height 0.3s, min-height 0.3s;\n opacity: 0.5;\n top: 40px;\n}\ndiv#${t} div.frame_annotation_dialog.fad_ind__0 {\n right: 360px;\n}\ndiv#${t} div.frame_annotation_dialog.fad_ind__1 {\n right: 445px;\n}\ndiv#${t} div.frame_annotation_dialog.fad_ind__2 {\n right: 530px;\n}\ndiv#${t} div.frame_annotation_dialog.fad_ind__3 {\n right: 615px;\n}\ndiv#${t} div.frame_annotation_dialog div.hide_overflow_container {\n width: 100%;\n /* position: absolute;\n right: 0; */\n overflow: hidden;\n}\ndiv#${t} div.frame_annotation_dialog.active:hover, div#${t} div.frame_annotation_dialog.active.permopen {\n max-width: none;\n width: 400px;\n overflow: visible;\n}\ndiv#${t} div.frame_annotation_dialog.active {\n z-index: 125;\n opacity: 1.0;\n}\ndiv#${t}.ulabel-night div.frame_annotation_dialog {\n background-color: rgb(37, 37, 37);\n border: 1px solid rgb(102, 102, 102);\n text-align: right;\n}\ndiv.front_dialogs {\n position: absolute;\n top: 0;\n right: 0;\n z-index: -1;\n}\ndiv#${t} div.frame_annotation_dialog div.row_container {\n position: relative;\n width: 400px;\n left: -340px;\n overflow: visible;\n transition: left 0.3s;\n}\ndiv#${t} div.frame_annotation_dialog:hover div.row_container, div#${t} div.frame_annotation_dialog.active.permopen div.row_container {\n left: 0;\n overflow: visible;\n}\n/* ROWS */\ndiv#${t} div.frame_annotation_dialog div.fad_row {\n width: 400px;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_row_inner {\n width: 400px;\n text-align: right;\n}\n\n/* NAME */\ndiv#${t} div.fad_st_name {\n font-size: 8px;\n padding: 4px;\n width: 52px;\n overflow: hidden;\n text-align: center;\n display: inline-block;\n}\ndiv#${t}.ulabel-night div.fad_st_name {\n color: white;\n}\n\n/* ADD BUTTON */\ndiv#${t} div.fad_st_add {\n width: 60px;\n height: 50px;\n display: none;\n position: relative;\n}\ndiv#${t} div.frame_annotation_dialog.active div.fad_st_add {\n display: inline-block;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row.add a.add-glob-button {\n position: absolute;\n font-size: 20px;\n width: 25px;\n height: 25px;\n border-radius: 12.5px;\n text-decoration: none;\n background-color: rgba(128, 128, 128, 0.198);\n color: gray;\n border: 1px solid gray;\n top: 25px;\n left: 30px;\n transform: translateX(-50%) translateY(-50%);\n line-height: 25px;\n text-align: center;\n}\n/* div#${t} div.frame_annotation_dialog div.fad_row.add a.add-glob-button span.plus {\n display: block;\n text-align: center;\n width: 25px;\n height: 25px;\n position: absolute;\n top: 12.5px;\n left: 12.5px;\n transform: translateX(-50%) translateY(-50%);\n color: black;\n} */\ndiv#${t} div.frame_annotation_dialog div.fad_row.add a.add-glob-button:hover {\n border-color: black;\n color: black;\n}\ndiv#${t}.ulabel-night div.frame_annotation_dialog div.fad_row.add a.add-glob-button:hover {\n border-color: white;\n color: white;\n}\ndiv#${t}.ulabel-night div.frame_annotation_dialog div.fad_row.add a.add-glob-button span.plus {\n color: white;\n}\ndiv#${t} div.frame_annotation_dialog.active div.fad_row.add {\n display: inline-block;\n}\n\ndiv#${t} div.frame_annotation_dialog div.fad_annotation_rows {\n width: 400px;\n display: inline-block;\n}\n\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons {\n display: inline-block;\n vertical-align: top;\n min-height: 60px;\n width: 340px;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_type_icon {\n display: inline-block;\n vertical-align: top;\n height: 60px;\n width: 60px;\n position: relative;\n text-align: center;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_type_icon svg {\n height: 50px;\n width: 50px;\n padding: 5px;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container {\n display: inline-block;\n vertical-align: top;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container.text {\n width: 220px;\n margin: 0;\n border: none;\n padding: none;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container.text textarea {\n box-sizing: border-box;\n width: calc(100% - 2px);\n height: 58px;\n min-height: 58px;\n resize: vertical;\n background-color: rgba(0,0,0,0);\n}\ndiv#${t}.ulabel-night div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container.text textarea {\n color: white;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container.button {\n width: 30px;\n height: 30px;\n padding: 15px;\n padding-right: 20px;\n padding-left: 0;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons div.fad_inp_container.button.frst {\n padding-left: 20px;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons a.fad_button {\n display: block;\n width: 28px;\n height: 28px;\n background-color: rgba(128, 128, 128, 0.198);\n border-radius: 14px;\n border: 1px solid gray;\n color: gray;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons a.fad_button:hover {\n border-color: black;\n color: black;\n}\ndiv#${t}.ulabel-night div.frame_annotation_dialog div.fad_row div.fad_buttons a.fad_button:hover {\n border-color: white;\n color: white;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons a.fad_button.reclf {\n position: relative;\n}\ndiv#${t} div.frame_annotation_dialog div.fad_row div.fad_buttons a.fad_button.delete {\n text-decoration: none;\n text-align: center;\n line-height: 28px;\n font-size: 22px;\n}\n\ndiv#${t} div.canvasses {\n position: absolute;\n top: 0; \n left: 0;\n padding-right: 100%;\n padding-bottom: 100%;\n}\ndiv#${t} canvas.canvas_cls {\n position: absolute;\n top: 0;\n left: 0;\n}\ndiv#${t} canvas.annotation_canvas {\n pointer-events: none;\n}\n\ndiv#${t} .id_dialog {\n width: 400px;\n height: 400px;\n background-color: rgba(0, 0, 0, 0.0);\n position: absolute;\n display: none;\n}\n/* .id_dialog.thumb {\n transform: scale(0.375);\n opacity: 0.5;\n}\n.id_dialog.thumb:hover {\n opacity: 1.0;\n} */\ndiv#${t} .ender_outer {\n display: block;\n position: absolute;\n width: 50px;\n height: 50px;\n background-color: transparent;\n box-shadow: 0 0 0 2px white;\n border-radius: 25px;\n z-index: ${i};\n}\ndiv#${t} .ender_inner {\n display: block;\n position: absolute;\n left: 20px;\n top: 20px;\n width: 10px;\n height: 10px;\n background-color: transparent;\n border-radius: 10px;\n}\ndiv#${t} .brush_circle {\n display: block;\n position: absolute;\n width: 50px;\n height: 50px;\n background-color: white;\n opacity: 0.4;\n border-radius: 25px;\n z-index: ${i};\n}\n\n/* ================== TOOLBOX ================== */\n\ndiv#${t} div.zpcont {\n height: 90px;\n position: relative;\n background-color: white;\n}\n\ndiv#${t}.ulabel-night div.zpcont {\n background-color: rgb(24, 24, 24);\n}\n\ndiv#${t} div.zpcont:hover, div#${t}.ulabel-night div.zpcont:hover {\n background-color: rgba(0,0,0,0);\n}\n\ndiv#${t} div.linestyle {\n padding: 10px 30px;\n}\n\ndiv#${t} canvas.demo-canvas {\n width: 120px;\n height: 40px;\n border: 1px solid lightgray;\n}\ndiv#${t}.ulabel-night canvas.demo-canvas {\n border: 1px solid rgb(87, 87, 87);\n}\ndiv#${t} div.line-expl {\n width: 185px;\n}\n\ndiv#${t} div.line-expl a {\n display: inline-block;\n vertical-align: middle;\n}\ndiv#${t} div.line-expl canvas {\n display: inline-block;\n vertical-align: middle;\n width: 120px;\n height: 40px;\n}\ndiv#${t} div.lstyl-row div.line-expl, div#${t} div.lstyl-row div.setting {\n display: inline-block;\n vertical-align: middle;\n}\ndiv#${t} div.setting {\n width: calc(100% - 185px);\n text-align: right;\n}\ndiv#${t} div.lstyl-row div.setting a {\n display: inline-block;\n border-radius: 5px;\n padding: 3px 6px;\n margin-bottom: 5px;\n text-decoration: none;\n color: black;\n font-size: 14px;\n}\ndiv#${t}.ulabel-night div.lstyl-row div.setting a {\n color: white;\n}\ndiv#${t} div.lstyl-row div.setting a {\n background-color: rgba(100, 148, 237, 0.479);\n color: black;\n}\ndiv#${t} div.lstyl-row div.setting a[href="#"] {\n background-color: rgba(0,0,0,0);\n color: black;\n}\ndiv#${t}.ulabel-night div.lstyl-row div.setting a[href="#"] {\n color: white;\n}\ndiv#${t} div.lstyl-row div.setting a[href="#"]:hover {\n background-color: rgba(255, 181, 44, 0.397);\n}\n\ndiv#${t} div.dialogs_container {\n position: absolute;\n top: 0;\n left: 0;\n}\n\ndiv.toolbox_inner_cls {\n height: calc(100% - 38px);\n overflow-y: scroll;\n overflow-x: hidden;\n}\n\n\n/* ========== Tab Buttons ========== */\n\ndiv#${t} div.toolbox-tabs {\n position: absolute;\n bottom: 0;\n width: 100%;\n opacity: 0.8;\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab {\n display: block;\n width: 100%;\n padding: 5px 0;\n background-color: rgba(0, 3, 161, 0.144);\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab.sel {\n display: block;\n width: 100%;\n background-color: rgba(0, 3, 161, 0.561);\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab * {\n vertical-align: middle;\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab a.tb-st-switch {\n display: inline-block;\n width: 70px;\n padding: 0 15px;\n text-decoration: none;\n color: rgb(37, 37, 37);\n}\ndiv#${t}.ulabel-night div.toolbox-tabs div.tb-st-tab a.tb-st-switch {\n color: rgb(150, 150, 150);\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab.sel a.tb-st-switch {\n color: rgb(238, 238, 238);\n}\ndiv#${t}.ulabel-night div.toolbox-tabs div.tb-st-tab.sel a.tb-st-switch {\n color: rgb(238, 238, 238);\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab a.tb-st-switch[href]:hover {\n color: cornflowerblue;\n}\ndiv#${t}.ulabel-night div.toolbox-tabs div.tb-st-tab a.tb-st-switch[href]:hover {\n color: rgb(238, 238, 238);\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab span.tb-st-range {\n display: inline-block;\n width: calc(100% - 100px);\n text-align: center;\n}\ndiv#${t} div.toolbox-tabs div.tb-st-tab span.tb-st-range input {\n width: 80%;\n transform: rotate(180deg);\n}\n\n/* ========== Annotation Box Dialogs ========== */\n\ndiv#${t} div.global_edit_suggestion {\n display: none;\n position: absolute;\n width: 150px;\n /*height: 75px;*/\n height: 0px;\n text-align: center;\n z-index: 1;\n /* background-color: white; */\n transform: scale(0.66666);\n overflow: visible;\n}\ndiv#${t} div.global_edit_suggestion.mcm {\n width: 225px;\n transform: scale(0.5);\n}\ndiv#${t} a.global_sub_suggestion {\n width: 60px;\n height: 60px;\n margin-left: 7.5px;\n margin-right: 7.5px;\n display: inline-block;\n border-radius: 37.5px;\n background-color: white;\n overflow: hidden;\n transform: translateY(-50%);\n}\ndiv#${t} a.global_sub_suggestion img {\n display: block;\n width: 40px;\n height: 40px;\n padding: 10px;\n}\ndiv#${t} a.global_sub_suggestion span.bigx {\n position: absolute;\n display: block;\n font-size: 4em;\n text-align: center;\n width: 60px;\n top: 50%;\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n color: black;\n text-decoration: none;\n}\ndiv#${t} a.global_sub_suggestion.reid_suggestion {\n opacity: 0.3;\n background-color: black;\n}\ndiv#${t} a.global_sub_suggestion.reid_suggestion:hover {\n opacity: 0; \n}\n\ndiv#${t} a.tbid-opt {\n display: inline-block;\n text-decoration: none;\n padding: 5px 8px;\n border-radius: 5px;\n color: black;\n}\ndiv#${t} div.colprev {\n display: inline-block;\n vertical-align: middle;\n height: 15px;\n width: 15px;\n}\ndiv#${t} span.tb-cls-nam {\n display: inline-block;\n vertical-align: middle;\n}\ndiv#${t}.ulabel-night span.tb-cls-nam {\n color: white;\n}\ndiv#${t} a.tbid-opt:hover {\n background-color: rgba(255, 181, 44, 0.397);\n}\ndiv#${t} a.tbid-opt.sel {\n background-color: rgba(100, 148, 237, 0.459);\n}\ndiv#${t} div.toolbox-name-header {\n background-color: rgb(0, 128, 202);\n margin: 0;\n}\ndiv#${t}.ulabel-night div.toolbox-name-header {\n background-color: rgb(0, 60, 95);\n}\ndiv#${t} div.toolbox-name-header h1 {\n margin: 0;\n padding: 0;\n font-size: 15px;\n display: inline-block;\n padding: 10px 15px;\n width: calc(70% - 30px);\n vertical-align: middle;\n}\ndiv#${t} div.toolbox-name-header h1 a {\n color: white;\n font-weight: 100;\n text-decoration: none;\n}\ndiv#${t} div.toolbox-name-header h1 {\n color: rgb(212, 212, 212);\n font-size: 12px;\n font-weight: 100;\n}\ndiv#${t}.ulabel-night div.toolbox-name-header h1 span.version-number {\n color: rgb(190, 190, 190);\n}\ndiv#${t} div.night-button-cont {\n text-align: right;\n display: inline-block;\n vertical-align: middle;\n position: relative;\n padding-right: 10px;\n width: calc(30% - 10px);\n}\ndiv#${t} a.night-button {\n display: inline-block;\n padding: 10px;\n opacity: 0.7;\n}\ndiv#${t} div.night-button-track {\n width: 35px;\n height: 12px;\n border-radius: 6px;\n position: relative;\n display: inline-block;\n background-color: rgba(0, 0, 0, 0.52);\n}\ndiv#${t} div.night-status {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n position: absolute;\n background-color: rgb(139, 139, 139);\n left: -4px;\n top: -4px;\n transition: left 0.2s;\n}\ndiv#${t} a.night-button:hover {\n opacity: 1;\n}\ndiv#${t}.ulabel-night div.night-button-track {\n background-color: rgba(255, 255, 255, 0.52);\n}\ndiv#${t}.ulabel-night div.night-status {\n left: 19px;\n}\n\n\ndiv#${t}.ulabel-night *::-webkit-scrollbar {\n background-color: black;\n}\ndiv#${t}.ulabel-night *::-webkit-scrollbar-track {\n background-color: black;\n}\ndiv#${t}.ulabel-night *::-webkit-scrollbar-thumb {\n border: 1px solid rgb(110, 110, 110);\n background-color: rgb(51, 51, 51);\n}\ndiv#${t}.ulabel-night *::-webkit-scrollbar-thumb:hover {\n background-color: rgb(90, 90, 90);\n} \ndiv#${t}.ulabel-night *::-webkit-scrollbar-corner {\n background-color:rgb(0, 60, 95);\n}\n\ndiv#${t} a.repo-anchor {\n text-transform: uppercase;\n}\n\n\ndiv#${t} a.id-dialog-clickable-indicator {\n position: absolute; \n top: 0;\n left: 0;\n display: block;\n border-radius: 200px;\n height: 400px;\n width: 400px;\n overflow: hidden;\n}\ndiv#${t} a.id-dialog-clickable-indicator svg {\n position: absolute;\n top: 0;\n left: 0;\n}\n\ndiv#${t} .editable {\n display: none;\n position: absolute;\n width: 50px;\n height: 50px;\n background-color: gray;\n opacity: 0.7;\n border-radius: 25px;\n z-index: 0;\n}\ndiv#${t} .editable.soft {\n opacity: 0.4;\n}\ndiv#${t} .editable:hover {\n background-color: white;\n opacity: 1.0;\n}\ndiv#${t} .editable.soft:hover {\n opacity: 0.7;\n}\n\ndiv#${t} div.toolbox-refs {\n text-align: center;\n}\ndiv#${t} div.toolbox-refs a {\n color: rgb(5, 50, 133);\n display: inline-block;\n margin-top: 10px;\n}\ndiv#${t} div.toolbox-refs a:hover {\n color: rgb(44, 77, 139);\n}\ndiv#${t}.ulabel-night div.toolbox-refs a {\n color: rgb(176, 202, 250);\n}\ndiv#${t}.ulabel-night div.toolbox-refs a:hover {\n color: rgb(123, 160, 228);\n}\n\ndiv#${t} .submit-button-container {\n display: flex;\n flex-direction: column;\n}\ndiv#${t} .submit-button-row {\n display: flex;\n align-items: center;\n gap: 0.5em;\n overflow-x: auto;\n margin-bottom: -0.5em;\n}\ndiv#${t} .submit-button {\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n background-color: rgba(255, 166, 0, 0.739); \n margin-right: auto;\n margin-left: auto;\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n cursor: pointer;\n}\n\n/* Dual ring loader */\n.lds-dual-ring {\n position: absolute;\n display: block;\n width: 18px;\n height: 18px;\n top: 50%;\n left: 50%;\n transform: translateY(-50%) translateX(-50%);\n}\n.lds-dual-ring:after {\n content: " ";\n display: block;\n width: 14.4px;\n height: 14.4px;\n margin: 1.8px;\n border-radius: 50%;\n border: 1.35px solid #fff;\n border-color: #fff transparent #fff transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n}\n@keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n`;const m='
',v=["orange","crimson","dodgerblue","midnightblue","seagreen","tan","blueviolet","chocolate","darksalmon","deeppink","fuchsia"]},2779:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8421),r=n(8967);e.default=function(t,e){void 0===e&&(e={});var n=0,o=0,s=0;return i.geomEach(t,function(t,a,l){var u=e.weight?null==l?void 0:l[e.weight]:void 0;if(u=null==u?1:u,!r.isNumber(u))throw new Error("weight value must be a number for feature index "+a);(u=Number(u))>0&&i.coordEach(t,function(t){n+=t[0]*u,o+=t[1]*u,s+=u})}),r.point([n/s,o/s],e.properties,e)}},2903:(t,e,n)=>{"use strict";t.exports=r,t.exports.default=r;var i=n(3351);function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,n,r,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=r||(s=e+Math.ceil((n-e)/r/2)*r,i(t,s,e,n,o),a.push(e,s,s,n))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!_(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var o=this._chooseSplitIndex(n,r,i),a=y(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,s,l,u,c,f;for(u=c=1/0,i=e;i<=n-e;i++)s=d(r=a(t,0,i,this.toBBox),o=a(t,i,n,this.toBBox)),l=p(r)+p(o),s=e;r--)o=t.children[r],l(c,t.leaf?s(o):o),p+=f(c);return p},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)l(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():s(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},3045:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FilterPointDistanceFromRow=e.KeypointSliderItem=e.RecolorActiveItem=e.AnnotationResizeItem=e.ClassCounterToolboxItem=e.AnnotationIDToolboxItem=e.ZoomPanToolboxItem=e.BrushToolboxItem=e.ModeSelectionToolboxItem=e.ToolboxItem=e.ToolboxTab=e.Toolbox=void 0;var o,s=n(496),a=n(2571),l=n(4493),u=n(8505),c=n(8286);!function(t){t.VANISH="v",t.SMALL="s",t.LARGE="l",t.INCREMENT="inc",t.DECREMENT="dec"}(o||(o={}));var p=.01;String.prototype.replaceLowerConcat=function(t,e,n){return void 0===n&&(n=null),"string"==typeof n?this.replaceAll(t,e).toLowerCase().concat(n):this.replaceAll(t,e).toLowerCase()};var f=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=[]),this.tabs=t,this.items=e}return t.create_toolbox=function(t,e){if(null==e&&(e=t.config.toolbox_order),0===e.length)throw new Error("No Toolbox Items Given");this.add_styles();for(var n=[],i=0;i\n
\n ').concat(n,'\n
\n \n
\n
\n

ULabel v').concat(i,'

\x3c!--\n --\x3e\n
\n
\n ');for(var o in this.items)r+=this.items[o].get_html()+"
";return r+='\n
\n
\n '.concat(this.get_toolbox_tabs(t),"\n
\n
\n ")},t.prototype.get_toolbox_tabs=function(t){var e="";for(var n in t.subtasks){var i=n==t.get_current_subtask_key(),r=t.subtasks[n],o=new h([],r,n,i);e+=o.html,this.tabs.push(o)}return e},t.prototype.redraw_update_items=function(t){for(var e=0,n=this.items;e\n ').concat(this.subtask.display_name,'\x3c!--\n --\x3e\n \n

\n Mode:\n \n

\n \n '},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"ModeSelection"},e}(d);e.ModeSelectionToolboxItem=g;var _=function(t){function e(e){var n=t.call(this)||this;return n.ulabel=e,n.add_styles(),n.add_event_listeners(),n}return r(e,t),e.prototype.add_styles=function(){var t="\n #toolbox div.brush button:not(.circle) {\n padding: 1rem 0.5rem;\n border: 1px solid gray;\n border-radius: 10px\n }\n\n #toolbox div.brush div.brush-button-holder {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-bottom: 1rem;\n }\n\n #toolbox div.brush span.brush-mode {\n display: flex;\n } \n \n #toolbox div.brush button.brush-button.".concat(e.BRUSH_BTN_ACTIVE_CLS," {\n background-color: #1c2d4d;\n }\n "),n="brush-toolbox-item-styles";if(!document.getElementById(n)){var i=document.head||document.querySelector("head"),r=document.createElement("style");r.appendChild(document.createTextNode(t)),r.id=n,i.appendChild(r)}},e.prototype.add_event_listeners=function(){var t=this;$(document).on("click.ulabel",".brush-button",function(e){switch($(e.currentTarget).attr("id")){case"brush-mode":t.ulabel.toggle_brush_mode(e);break;case"erase-mode":t.ulabel.toggle_erase_mode(e);break;case"brush-inc":t.ulabel.change_brush_size(1.1);break;case"brush-dec":t.ulabel.change_brush_size(1/1.1)}})},e.prototype.get_html=function(){return'\n
\n

Brush Tool

\n
\n \n \n \n \n \n \n \n \n
\n
\n '},e.show_brush_toolbox_item=function(){$(".brush").removeClass("ulabel-hidden")},e.hide_brush_toolbox_item=function(){$(".brush").addClass("ulabel-hidden")},e.prototype.after_init=function(){"polygon"!==this.ulabel.get_current_subtask().state.annotation_mode&&e.hide_brush_toolbox_item()},e.prototype.get_toolbox_item_type=function(){return"Brush"},e.BRUSH_BTN_ACTIVE_CLS="brush-button-active",e}(d);e.BrushToolboxItem=_;var y=function(t){function e(e){var n=t.call(this)||this;return n.ulabel=e,n.set_frame_range(e),n.add_styles(),n.add_event_listeners(),n}return r(e,t),e.prototype.add_styles=function(){var t="zoom-pan-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode('\n #toolbox div.zoom-pan {\n padding: 10px 30px;\n display: grid;\n grid-template-rows: auto 1.25rem auto;\n grid-template-columns: 1fr 1fr;\n grid-template-areas:\n "zoom pan"\n "zoom-tip pan-tip"\n "recenter recenter";\n }\n \n #toolbox div.zoom-pan > * {\n place-self: center;\n }\n \n #toolbox div.zoom-pan button {\n background-color: lightgray;\n }\n\n #toolbox div.zoom-pan button:hover {\n background-color: rgba(0, 128, 255, 0.9);\n }\n \n #toolbox div.zoom-pan div.set-zoom {\n grid-area: zoom;\n }\n \n #toolbox div.zoom-pan div.set-pan {\n grid-area: pan;\n }\n \n #toolbox div.zoom-pan div.set-pan div.pan-container {\n display: inline-flex;\n align-items: center;\n }\n \n #toolbox div.zoom-pan p.shortcut-tip {\n margin: 2px 0;\n font-size: 10px;\n color: white;\n }\n\n #toolbox div.zoom-pan:hover p.shortcut-tip {\n color: black;\n }\n\n .ulabel-night #toolbox div.zoom-pan p.shortcut-tip {\n margin: 0;\n font-size: 10px;\n color: black;\n }\n\n .ulabel-night #toolbox div.zoom-pan:hover p.shortcut-tip {\n color: white;\n }\n \n #toolbox.ulabel-night div.zoom-pan:hover p.pan-shortcut-tip {\n color: white;\n }\n \n #toolbox div.zoom-pan p.zoom-shortcut-tip {\n grid-area: zoom-tip;\n }\n \n #toolbox div.zoom-pan p.pan-shortcut-tip {\n grid-area: pan-tip;\n }\n \n #toolbox div.zoom-pan span.pan-label {\n margin-right: 10px;\n }\n \n #toolbox div.zoom-pan span.pan-button-holder {\n display: inline-grid;\n position: relative;\n grid-template-rows: 28px 28px;\n grid-template-columns: 28px 28px;\n grid-template-areas:\n "left top"\n "bottom right";\n transform: rotate(-45deg);\n gap: 1px;\n }\n \n #toolbox div.zoom-pan span.pan-button-holder > * {\n border: 1px solid gray;\n }\n \n #toolbox div.zoom-pan button.ulabel-pan:hover {\n background-color: cornflowerblue;\n }\n \n #toolbox div.zoom-pan button.ulabel-pan-left {\n grid-area: left;\n border-radius: 100% 0 0 0;\n }\n \n #toolbox div.zoom-pan button.ulabel-pan-right {\n grid-area: right;\n border-radius: 0 0 100% 0;\n }\n \n #toolbox div.zoom-pan button.ulabel-pan-up {\n grid-area: top;\n border-radius: 0 100% 0 0;\n }\n \n #toolbox div.zoom-pan button.ulabel-pan-down {\n grid-area: bottom;\n border-radius: 0 0 0 100%;\n }\n \n #toolbox div.zoom-pan span.spokes {\n background-color: white;\n width: 16px;\n height: 16px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n }\n \n .ulabel-night #toolbox div.zoom-pan span.spokes {\n background-color: black;\n }\n\n #toolbox div.zoom-pan div.recenter-container {\n grid-area: recenter;\n }\n \n .ulabel-night #toolbox div.zoom-pan a {\n color: lightblue;\n }\n\n .ulabel-night #toolbox div.zoom-pan a:active {\n color: white;\n }\n ')),n.id=t,e.appendChild(n)}},e.prototype.add_event_listeners=function(){var t=this,e=this.ulabel.config.image_data.frames.length>1;$(document).on("click.ulabel",".ulabel-zoom-button",function(e){var n;$(e.currentTarget).hasClass("ulabel-zoom-out")?t.ulabel.state.zoom_val/=1.1:$(e.currentTarget).hasClass("ulabel-zoom-in")&&(t.ulabel.state.zoom_val*=1.1),t.ulabel.rezoom(),null===(n=t.ulabel.filter_distance_overlay)||void 0===n||n.draw_overlay()}),$(document).on("click.ulabel",".ulabel-pan",function(e){var n=$("#"+t.ulabel.config.annbox_id);$(e.currentTarget).hasClass("ulabel-pan-up")?n.scrollTop(n.scrollTop()-20):$(e.currentTarget).hasClass("ulabel-pan-down")?n.scrollTop(n.scrollTop()+20):$(e.currentTarget).hasClass("ulabel-pan-left")?n.scrollLeft(n.scrollLeft()-20):$(e.currentTarget).hasClass("ulabel-pan-right")&&n.scrollLeft(n.scrollLeft()+20)}),e?$(document).on("keypress.ulabel",function(e){switch(e.preventDefault(),e.key){case"ArrowRight":case"ArrowDown":t.ulabel.update_frame(1);break;case"ArrowUp":case"ArrowLeft":t.ulabel.update_frame(-1)}}):$(document).on("keydown.ulabel",function(e){var n=$("#"+t.ulabel.config.annbox_id);switch(e.key){case"ArrowLeft":n.scrollLeft(n.scrollLeft()-20),e.preventDefault();break;case"ArrowRight":n.scrollLeft(n.scrollLeft()+20),e.preventDefault();break;case"ArrowUp":n.scrollTop(n.scrollTop()-20),e.preventDefault();break;case"ArrowDown":n.scrollTop(n.scrollTop()+20),e.preventDefault()}}),$(document).on("click.ulabel","#recenter-button",function(){t.ulabel.show_initial_crop()}),$(document).on("click.ulabel","#recenter-whole-image-button",function(){t.ulabel.show_whole_image()}),$(document).on("keypress.ulabel",function(e){e.key==t.ulabel.config.change_zoom_keybind.toLowerCase()&&document.getElementById("recenter-button").click(),e.key==t.ulabel.config.change_zoom_keybind.toUpperCase()&&document.getElementById("recenter-whole-image-button").click()})},e.prototype.set_frame_range=function(t){1!=t.config.image_data.frames.length?this.frame_range='\n
\n

scroll to switch frames

\n
\n
\n Frame  \n \n
\n Zoom\n \n \n \n \n
\n

ctrl+scroll or shift+drag

\n
\n
\n Pan\n \n \n \n \n \n \n \n
\n
\n

scrollclick+drag or ctrl+drag

\n \n '.concat(this.frame_range,"\n
\n ")},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"ZoomPan"},e}(d);e.ZoomPanToolboxItem=y;var m=function(t){function e(e){var n=t.call(this)||this;return n.ulabel=e,n.set_instructions(e),n.add_styles(),n}return r(e,t),e.prototype.add_styles=function(){var t="annotation-id-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode("\n #toolbox div.classification div.id-toolbox-app {\n margin-bottom: 1rem;\n }\n ")),n.id=t,e.appendChild(n)}},e.prototype.set_instructions=function(t){this.instructions="",null!=t.config.instructions_url&&(this.instructions='\n Instructions\n '))},e.prototype.get_html=function(){return'\n
\n

Annotation ID

\n
\n
\n
\n '.concat(this.instructions,"\n
\n ")},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"AnnotationID"},e}(d);e.AnnotationIDToolboxItem=m;var v=function(t){function e(){for(var e=[],n=0;n0){r[s.class_id]+=1;break}var u,c,p="";for(e=0;e"));this.inner_HTML='

Annotation Count

'+"

".concat(p,"

")}},e.prototype.get_html=function(){return'\n
'+this.inner_HTML+"
"},e.prototype.after_init=function(){},e.prototype.redraw_update=function(t){this.update_toolbox_counter(t.get_current_subtask()),$("#"+t.config.toolbox_id+" div.toolbox-class-counter").html(this.inner_HTML)},e.prototype.get_toolbox_item_type=function(){return"ClassCounter"},e}(d);e.ClassCounterToolboxItem=v;var b=function(t){function e(e){var n=t.call(this)||this;for(var i in n.cached_size=1.5,n.ulabel=e,n.keybind_configuration=e.config.default_keybinds,e.subtasks){var r=e.subtasks[i].display_name.replaceLowerConcat(" ","-","-cached-size"),o=n.read_size_cookie(e.subtasks[i]);if(null!=o&&"NaN"!=o)n.update_annotation_size(e,e.subtasks[i],Number(o)),n[r]=Number(o);else if(null!=e.config.default_annotation_size)n.update_annotation_size(e,e.subtasks[i],e.config.default_annotation_size),n[r]=e.config.default_annotation_size;else{n.update_annotation_size(e,e.subtasks[i],5),n[r]=5}}return n.add_styles(),n.add_event_listeners(),n}return r(e,t),e.prototype.add_styles=function(){var t="resize-annotation-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode("\n #toolbox div.annotation-resize button:not(.circle) {\n padding: 1rem 0.5rem;\n border: 1px solid gray;\n border-radius: 10px\n }\n\n #toolbox div.annotation-resize div.annotation-resize-button-holder {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-bottom: 1rem;\n }\n\n #toolbox div.annotation-resize span.annotation-vanish:hover,\n #toolbox div.annotation-resize span.annotation-size:hover {\n border-radius: 10px;\n box-shadow: 0 0 4px 2px lightgray, 0 0 white;\n }\n\n /* No box-shadow in night-mode */\n .ulabel-night #toolbox div.annotation-resize span.annotation-vanish:hover,\n .ulabel-night #toolbox div.annotation-resize span.annotation-size:hover {\n box-shadow: initial;\n }\n\n #toolbox div.annotation-resize span.annotation-size {\n display: flex;\n }\n\n #toolbox div.annotation-resize span.annotation-size #annotation-resize-s {\n border-radius: 10px 0 0 10px;\n }\n\n #toolbox div.annotation-resize span.annotation-size #annotation-resize-l {\n border-radius: 0 10px 10px 0;\n }\n \n #toolbox div.annotation-resize span.annotation-inc {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n #toolbox div.annotation-resize button.locked {\n background-color: #1c2d4d;\n }\n \n ")),n.id=t,e.appendChild(n)}},e.prototype.add_event_listeners=function(){var t=this;$(document).on("click.ulabel",".annotation-resize-button",function(e){var n=t.ulabel.get_current_subtask_key(),i=t.ulabel.get_current_subtask(),r=$(e.currentTarget).attr("id").slice(18);t.update_annotation_size(t.ulabel,i,r),t.ulabel.redraw_all_annotations(n,null,!1)}),$(document).on("keydown.ulabel",function(e){var n=t.ulabel.get_current_subtask();switch(e.key){case t.keybind_configuration.annotation_vanish.toUpperCase():t.update_all_subtask_annotation_size(t.ulabel,o.VANISH);break;case t.keybind_configuration.annotation_vanish.toLowerCase():t.update_annotation_size(t.ulabel,n,o.VANISH);break;case t.keybind_configuration.annotation_size_small:t.update_annotation_size(t.ulabel,n,o.SMALL);break;case t.keybind_configuration.annotation_size_large:t.update_annotation_size(t.ulabel,n,o.LARGE);break;case t.keybind_configuration.annotation_size_minus:t.update_annotation_size(t.ulabel,n,o.DECREMENT);break;case t.keybind_configuration.annotation_size_plus:t.update_annotation_size(t.ulabel,n,o.INCREMENT);break;default:return}t.ulabel.redraw_all_annotations(null,null,!1)})},e.prototype.update_annotation_size=function(t,e,n){if(null!==e){var i=.5,r=e.display_name.replaceLowerConcat(" ","-","-cached-size"),s=e.display_name.replaceLowerConcat(" ","-","-vanished");if(!this[s]||"v"===n)if("number"!=typeof n){switch(n){case o.SMALL:this.loop_through_annotations(e,1.5,"="),this[r]=1.5;break;case o.LARGE:this.loop_through_annotations(e,5,"="),this[r]=5;break;case o.DECREMENT:this.loop_through_annotations(e,i,"-"),this[r]-i>p?this[r]-=i:this[r]=p;break;case o.INCREMENT:this.loop_through_annotations(e,i,"+"),this[r]+=i;break;case o.VANISH:this[s]?(this.loop_through_annotations(e,this[r],"="),this[s]=!this[s],$("#annotation-resize-v").removeClass("locked")):(this.loop_through_annotations(e,p,"="),this[s]=!this[s],$("#annotation-resize-v").addClass("locked"));break;default:console.error("update_annotation_size called with unknown size")}null!==t.state.line_size&&(t.state.line_size=this[r])}else this.loop_through_annotations(e,n,"=")}},e.prototype.loop_through_annotations=function(t,e,n){for(var i in t.annotations.access)switch(n){case"=":t.annotations.access[i].line_size=e;break;case"+":t.annotations.access[i].line_size+=e;break;case"-":t.annotations.access[i].line_size-e<=p?t.annotations.access[i].line_size=p:t.annotations.access[i].line_size-=e;break;default:throw Error("Invalid Operation given to loop_through_annotations")}if(t.annotations.ordering.length>0){var r=t.annotations.access[t.annotations.ordering[0]].line_size;r!==p&&this.set_size_cookie(r,t)}},e.prototype.update_all_subtask_annotation_size=function(t,e){for(var n in t.subtasks)this.update_annotation_size(t,t.subtasks[n],e)},e.prototype.redraw_update=function(t){this[t.get_current_subtask().display_name.replaceLowerConcat(" ","-","-vanished")]?$("#annotation-resize-v").addClass("locked"):$("#annotation-resize-v").removeClass("locked")},e.prototype.set_size_cookie=function(t,e){var n=new Date;n.setTime(n.getTime()+864e9);var i=e.display_name.replaceLowerConcat(" ","_");document.cookie=i+"_size="+t+";"+n.toUTCString()+";path=/"},e.prototype.read_size_cookie=function(t){for(var e=t.display_name.replaceLowerConcat(" ","_")+"_size=",n=document.cookie.split(";"),i=0;i\n

Change Annotation Size

\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n '},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"AnnotationResize"},e}(d);e.AnnotationResizeItem=b;var x=function(t){function e(e){var n,i=t.call(this)||this;return i.most_recent_redraw_time=0,i.ulabel=e,i.config=i.ulabel.config.recolor_active_toolbox_item,i.add_styles(),i.add_event_listeners(),i.read_local_storage(),null!==(n=i.gradient_turned_on)&&void 0!==n||(i.gradient_turned_on=i.config.gradient_turned_on),i}return r(e,t),e.prototype.save_local_storage_color=function(t,e){(0,c.set_local_storage_item)("RecolorActiveItem-".concat(t),e)},e.prototype.save_local_storage_gradient=function(t){(0,c.set_local_storage_item)("RecolorActiveItem-Gradient",t)},e.prototype.read_local_storage=function(){for(var t=0,e=this.ulabel.valid_class_ids;t div"));i&&(i.style.backgroundColor=e),this.replace_color_pie(),n&&this.save_local_storage_color(t,e)},e.prototype.add_styles=function(){var t="recolor-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode('\n #toolbox div.recolor-active {\n padding: 0 2rem;\n }\n\n #toolbox div.recolor-active div.recolor-tbi-gradient {\n font-size: 80%;\n }\n\n #toolbox div.recolor-active div.gradient-toggle-container {\n text-align: left;\n display: flex;\n align-items: center;\n }\n\n #toolbox div.recolor-active div.gradient-slider-container {\n display: flex;\n align-items: center;\n }\n\n #toolbox div.recolor-active div.gradient-slider-container > input {\n width: 50%;\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder {\n margin: 0.5rem;\n display: grid;\n grid-template-columns: 2fr 1fr;\n grid-template-rows: 1fr 1fr 1fr;\n grid-template-areas:\n "yellow picker"\n "red picker"\n "cyan picker";\n gap: 0.25rem 0.75rem;\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder .color-change-btn {\n height: 1.5rem;\n border-radius: 0.5rem;\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder #color-change-yellow {\n grid-area: yellow;\n background-color: yellow;\n border: 1px solid rgb(200, 200, 0);\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder #color-change-red {\n grid-area: red;\n background-color: red;\n border: 1px solid rgb(200, 0, 0);\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder #color-change-cyan {\n grid-area: cyan;\n background-color: cyan;\n border: 1px solid rgb(0, 200, 200);\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder div.color-picker-border {\n grid-area: picker;\n background: linear-gradient(to bottom right, red, orange, yellow, green, blue, indigo, violet);\n border: 1px solid black;\n border-radius: 0.5rem;\n }\n\n #toolbox div.recolor-active div.annotation-recolor-button-holder div.color-picker-border div.color-picker-container {\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n margin: 3px;\n background-color: black;\n border: 1px solid black;\n border-radius: 0.5rem;\n }\n\n #toolbox div.recolor-active div.color-picker-container input.color-change-picker {\n width: 100%;\n height: 100%;\n padding: 0;\n opacity: 0;\n }')),n.id=t,e.appendChild(n)}},e.prototype.add_event_listeners=function(){var t=this;$(document).on("click.ulabel",".color-change-btn",function(e){var n=e.target.id.slice(13),i=(0,c.get_active_class_id)(t.ulabel);t.update_color(i,n),t.redraw(0)}),$(document).on("input.ulabel","input.color-change-picker",function(e){var n=e.currentTarget.value,i=(0,c.get_active_class_id)(t.ulabel);t.update_color(i,n),document.getElementById("color-picker-container").style.backgroundColor=n,t.redraw()}),$(document).on("input.ulabel","#gradient-toggle",function(e){t.redraw(0),t.save_local_storage_gradient(e.target.checked)}),$(document).on("input.ulabel","#gradient-slider",function(e){$("div.gradient-slider-value-display").text(e.currentTarget.value+"%"),t.redraw(100,!0)})},e.prototype.redraw=function(t,e){if(void 0===t&&(t=100),void 0===e&&(e=!1),!(Date.now()-this.most_recent_redraw_time\n

Recolor Annotations

\n
\n
\n \n \n
\n
\n \n \n
100%
\n
\n
\n
\n \n \n \n
\n
\n \n
\n
\n
\n
\n ')},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"RecolorActive"},e}(d);e.RecolorActiveItem=x;var w=function(t){function e(e,n){var i=t.call(this)||this;return i.filter_value=0,i.inner_HTML='

Keypoint Slider

',i.ulabel=e,void 0!==n?(i.name=n.name,i.filter_function=n.filter_function,i.get_confidence=n.confidence_function,i.mark_deprecated=n.mark_deprecated,i.keybinds=n.keybinds):(i.name="Keypoint Slider",i.filter_function=a.value_is_lower_than_filter,i.get_confidence=a.get_annotation_confidence,i.mark_deprecated=a.mark_deprecated,i.keybinds={increment:"2",decrement:"1"},n={}),i.slider_bar_id=i.name.replaceLowerConcat(" ","-"),Object.prototype.hasOwnProperty.call(i.ulabel.config,i.name.replaceLowerConcat(" ","_","_default_value"))&&(i.filter_value=i.ulabel.config[i.name.replaceLowerConcat(" ","_","_default_value")]),i.ulabel.config.filter_annotations_on_load&&i.filter_annotations(i.ulabel),i.add_styles(),i}return r(e,t),e.prototype.add_styles=function(){var t="keypoint-slider-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode("\n /* Component has no css?? */\n ")),n.id=t,e.appendChild(n)}},e.prototype.filter_annotations=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1),null===e&&(e=Math.round(100*this.filter_value));var i={};for(var r in t.subtasks)i[r]=[];for(var o=0,s=(0,a.get_point_and_line_annotations)(t)[0];o\n

'.concat(this.name,"

\n ")+e.getSliderHTML()+"\n \n "},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"KeypointSlider"},e}(d);e.KeypointSliderItem=w;var E=function(t){function e(e,n){void 0===n&&(n=null);var i=t.call(this)||this;for(var r in i.ulabel=e,i.config=i.ulabel.config.distance_filter_toolbox_item,s.DEFAULT_FILTER_DISTANCE_CONFIG)Object.prototype.hasOwnProperty.call(i.config,r)||(i.config[r]=s.DEFAULT_FILTER_DISTANCE_CONFIG[r]);for(var o in i.config)i[o]=i.config[o];i.disable_multi_class_mode&&(i.multi_class_mode=!1),i.collapse_options=(0,c.get_local_storage_item)("filterDistanceCollapseOptions"),i.create_overlay();var a=(0,c.get_local_storage_item)("filterDistanceShowOverlay");i.show_overlay=null!==a?a:i.show_overlay,i.overlay.update_display_overlay(i.show_overlay);var l=(0,c.get_local_storage_item)("filterDistanceFilterDuringPolylineMove");return i.filter_during_polyline_move=null!==l?l:i.filter_during_polyline_move,i.add_styles(),i.add_event_listeners(),i}return r(e,t),e.prototype.add_styles=function(){var t="filter-distance-from-row-toolbox-item-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode('\n #toolbox div.filter-row-distance {\n text-align: left;\n }\n\n #toolbox p.tb-header {\n margin: 0.75rem 0 0.5rem;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options {\n display: inline-block;\n position: relative;\n left: 1rem;\n margin-bottom: 0.5rem;\n font-size: 80%;\n user-select: none;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options * {\n text-align: left;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options.ulabel-collapsed {\n border: none;\n margin-bottom: 0;\n padding: 0; /* Padding takes up too much space without the content */\n\n /* Needed to prevent the element from moving when ulabel-collapsed is toggled \n 0.75em comes from the previous padding, 2px comes from the removed border */\n padding-left: calc(0.75em + 2px)\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options legend {\n border-radius: 0.1rem;\n padding: 0.1rem 0.3rem;\n cursor: pointer;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options.ulabel-collapsed legend {\n padding: 0.1rem 0.28rem;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options.ulabel-collapsed :not(legend) {\n display: none;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options legend:hover {\n background-color: rgba(128, 128, 128, 0.3)\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options input[type="checkbox"] {\n margin: 0;\n }\n\n #toolbox div.filter-row-distance fieldset.filter-row-distance-options label {\n position: relative;\n top: -0.2rem;\n font-size: smaller;\n }')),n.id=t,e.appendChild(n)}},e.prototype.add_event_listeners=function(){var t=this;$(document).on("click.ulabel","fieldset.filter-row-distance-options > legend",function(){return t.toggleCollapsedOptions()}),$(document).on("click.ulabel","#filter-slider-distance-multi-checkbox",function(e){t.multi_class_mode=e.currentTarget.checked,t.switchFilterMode(),t.overlay.update_mode(t.multi_class_mode);var n=t.multi_class_mode;(0,a.filter_points_distance_from_line)(t.ulabel,n)}),$(document).on("change.ulabel","#filter-slider-distance-toggle-overlay-checkbox",function(e){t.show_overlay=e.currentTarget.checked,t.overlay.update_display_overlay(t.show_overlay),t.overlay.draw_overlay(),(0,c.set_local_storage_item)("filterDistanceShowOverlay",t.show_overlay)}),$(document).on("change.ulabel","#filter-slider-distance-filter-during-polyline-move-checkbox",function(e){t.filter_during_polyline_move=e.currentTarget.checked,(0,c.set_local_storage_item)("filterDistanceFilterDuringPolylineMove",t.filter_during_polyline_move)}),$(document).on("keypress.ulabel",function(e){e.key===t.toggle_overlay_keybind&&document.querySelector("#filter-slider-distance-toggle-overlay-checkbox").click()})},e.prototype.switchFilterMode=function(){$("#filter-single-class-mode").toggleClass("ulabel-hidden"),$("#filter-multi-class-mode").toggleClass("ulabel-hidden")},e.prototype.toggleCollapsedOptions=function(){$("fieldset.filter-row-distance-options").toggleClass("ulabel-collapsed"),this.collapse_options=!this.collapse_options,(0,c.set_local_storage_item)("filterDistanceCollapseOptions",this.collapse_options)},e.prototype.create_overlay=function(){for(var t=(0,a.get_point_and_line_annotations)(this.ulabel)[1],e={closest_row:void 0},n=document.querySelectorAll(".filter-row-distance-slider"),i=0;i\n \n Multi-Class Filtering\n \n ')),'\n
\n

'.concat(this.name,'

\n
\n \n Options ˅\n \n ')+i+'\n
\n \n \n Show Filter Range\n \n
\n
\n \n \n Filter During Move\n \n
\n
\n
\n ').concat(n.getSliderHTML(),'\n
\n
\n ')+e+"\n
\n
\n "},e.prototype.after_init=function(){},e.prototype.get_toolbox_item_type=function(){return"FilterDistance"},e}(d);e.FilterPointDistanceFromRow=E},3066:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]\n \n \n
\n \n ')),$("#"+t.config.container_id+" div#fad_st__".concat(n)).append('\n
\n '));var i=document.getElementById(t.subtasks[n].canvas_bid),r=document.getElementById(t.subtasks[n].canvas_fid);t.subtasks[n].state.back_context=i.getContext("2d"),t.subtasks[n].state.front_context=r.getContext("2d")}}(t,n),!t.config.allow_annotations_outside_image)for(i=t.config.image_height,c=t.config.image_width,p=0,f=Object.values(t.subtasks);p{"use strict";var i=n(4459);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},3126:(t,e,n)=>{"use strict";var i=n(6743),r=n(9675),o=n(76),s=n(3144);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new r("a function is required");return s(i,o,t)}},3144:(t,e,n)=>{"use strict";var i=n(6743),r=n(1002),o=n(76),s=n(7119);t.exports=s||i.call(o,r)},3154:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(8967),o=n(8506),s=i(n(7042)),a=n(8421),l=i(n(4945));function u(t,e){var n=o.getCoords(t),i=o.getCoords(e);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var s=n[0][0],a=n[0][1],l=n[1][0],u=n[1][1],c=i[0][0],p=i[0][1],f=i[1][0],h=i[1][1],d=(h-p)*(l-s)-(f-c)*(u-a),g=(f-c)*(a-p)-(h-p)*(s-c),_=(l-s)*(a-p)-(u-a)*(s-c);if(0===d)return null;var y=g/d,m=_/d;if(y>=0&&y<=1&&m>=0&&m<=1){var v=s+y*(l-s),b=a+y*(u-a);return r.point([v,b])}return null}e.default=function(t,e){var n={},i=[];if("LineString"===t.type&&(t=r.feature(t)),"LineString"===e.type&&(e=r.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var c=u(t,e);return c&&i.push(c),r.featureCollection(i)}var p=l.default();return p.load(s.default(e)),a.featureEach(s.default(t),function(t){a.featureEach(p.search(t),function(e){var r=u(t,e);if(r){var s=o.getCoords(r).join(",");n[s]||(n[s]=!0,i.push(r))}})}),r.featureCollection(i)}},3183:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9391)),o=n(8967),s=n(8506),a=n(8421),l=i(n(9778));function u(t,e){return t[0]*e[0]+t[1]*e[1]}function c(t,e,n){return"planar"===n.method?l.default(t,e,n):r.default(t,e,n)}e.default=function(t,e,n){if(void 0===n&&(n={}),n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=o.point(t):"Point"===t.type?t=o.feature(t):s.featureOf(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=o.lineString(e):"LineString"===e.type?e=o.feature(e):s.featureOf(e,"LineString","line");var i=1/0,r=t.geometry.coordinates;return a.segmentEach(e,function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],s=function(t,e,n,i){var r=[n[0]-e[0],n[1]-e[1]],o=[t[0]-e[0],t[1]-e[1]],s=u(o,r);if(s<=0)return c(t,e,{method:i.method,units:"degrees"});var a=u(r,r);if(a<=s)return c(t,n,{method:i.method,units:"degrees"});var l=s/a,p=[e[0]+l*r[0],e[1]+l*r[1]];return c(t,p,{method:i.method,units:"degrees"})}(r,e,o,n);s{"use strict";var i=n(41),r=n(592)(),o=n(4462).functionsHaveConfigurableNames(),s=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!o||(r?i(t,"name",e,!0,!0):i(t,"name",e)),t}},3227:(t,e,n)=>{"use strict";function i(t){return function(){return t}}function r(t){return t[0]}function o(t){return t[1]}function s(){this._=null}function a(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function l(t,e){var n=e,i=e.R,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function u(t,e){var n=e,i=e.L,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function c(t){for(;t.L;)t=t.L;return t}n.r(e),n.d(e,{voronoi:()=>q}),s.prototype={constructor:s,insert:function(t,e){var n,i,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=c(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(i=n.U).L?(r=i.R)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.R&&(l(this,n),n=(t=n).U),n.C=!1,i.C=!0,u(this,i)):(r=i.L)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.L&&(u(this,n),n=(t=n).U),n.C=!1,i.C=!0,l(this,i)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,r=t.U,o=t.L,s=t.R;if(n=o?s?c(s):o:s,r?r.L===t?r.L=n:r.R=n:this._=n,o&&s?(i=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(r=n.U,n.U=t.U,t=n.R,r.L=t,n.R=s,s.U=n):(n.U=r,r=n,t=n.R)):(i=t.C,t=n),t&&(t.U=r),!i)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===r.L){if((e=r.R).C&&(e.C=!1,r.C=!0,l(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,u(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,l(this,r),t=this._;break}}else if((e=r.L).C&&(e.C=!1,r.C=!0,u(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,l(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,u(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}};const p=s;function f(t,e,n,i){var r=[null,null],o=D.push(r)-1;return r.left=t,r.right=e,n&&d(r,t,e,n),i&&d(r,e,t,i),A[t.index].halfedges.push(o),A[e.index].halfedges.push(o),r}function h(t,e,n){var i=[e,n];return i.left=t,i}function d(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function g(t,e,n,i,r){var o,s=t[0],a=t[1],l=s[0],u=s[1],c=0,p=1,f=a[0]-l,h=a[1]-u;if(o=e-l,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>p)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>p)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>p)return;o>c&&(c=o)}if(o=r-u,h||!(o<0)){if(o/=h,h<0){if(o>p)return;o>c&&(c=o)}else if(h>0){if(o0||p<1)||(c>0&&(t[0]=[l+c*f,u+c*h]),p<1&&(t[1]=[l+p*f,u+p*h]),!0)}}}}}function _(t,e,n,i,r){var o=t[1];if(o)return!0;var s,a,l=t[0],u=t.left,c=t.right,p=u[0],f=u[1],h=c[0],d=c[1],g=(p+h)/2,_=(f+d)/2;if(d===f){if(g=i)return;if(p>h){if(l){if(l[1]>=r)return}else l=[g,n];o=[g,r]}else{if(l){if(l[1]1)if(p>h){if(l){if(l[1]>=r)return}else l=[(n-a)/s,n];o=[(r-a)/s,r]}else{if(l){if(l[1]=i)return}else l=[e,s*e+a];o=[i,s*i+a]}else{if(l){if(l[0]=-F)){var h=l*l+u*u,d=c*c+p*p,g=(p*h-u*d)/f,_=(l*d-c*h)/f,y=x.pop()||new w;y.arc=t,y.site=r,y.x=g+s,y.y=(y.cy=_+a)+Math.sqrt(g*g+_*_),t.circle=y;for(var m=null,v=R._;v;)if(y.yj)a=a.L;else{if(!((r=o-P(a,s))>j)){i>-j?(e=a.P,n=a):r>-j?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){A[t.index]={site:t,halfedges:[]}}(t);var l=I(t);if(T.insert(e,l),e||n){if(e===n)return k(e),n=I(e.site),T.insert(l,n),l.edge=n.edge=f(e.site,l.site),E(e),void E(n);if(n){k(e),k(n);var u=e.site,c=u[0],p=u[1],h=t[0]-c,g=t[1]-p,_=n.site,y=_[0]-c,m=_[1]-p,v=2*(h*m-g*y),b=h*h+g*g,x=y*y+m*m,w=[(m*b-g*x)/v+c,(h*x-y*b)/v+p];d(n.edge,u,_,w),l.edge=f(u,t,null,w),n.edge=f(t,_,null,w),E(e),E(n)}else l.edge=f(e.site,l.site)}}function O(t,e){var n=t.site,i=n[0],r=n[1],o=r-e;if(!o)return i;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],l=n[1],u=l-e;if(!u)return a;var c=a-i,p=1/o-1/u,f=c/u;return p?(-f+Math.sqrt(f*f-2*p*(c*c/(-2*u)-l+u/2+r-o/2)))/p+i:(i+a)/2}function P(t,e){var n=t.N;if(n)return O(n,e);var i=t.site;return i[1]===e?i[0]:1/0}var T,A,R,D,j=1e-6,F=1e-12;function z(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function B(t,e){return e[1]-t[1]||e[0]-t[0]}function G(t,e){var n,i,r,o=t.sort(B).pop();for(D=[],A=new Array(t.length),T=new p,R=new p;;)if(r=b,o&&(!r||o[1]j||Math.abs(r[0][1]-r[1][1])>j)||delete D[o]}(s,a,l,u),function(t,e,n,i){var r,o,s,a,l,u,c,p,f,d,g,_,y=A.length,b=!0;for(r=0;rj||Math.abs(_-f)>j)&&(l.splice(a,0,D.push(h(s,d,Math.abs(g-t)j?[t,Math.abs(p-t)j?[Math.abs(f-i)j?[n,Math.abs(p-n)j?[Math.abs(f-e)=a)return null;var l=t-r.site[0],u=e-r.site[1],c=l*l+u*u;do{r=o.cells[i=s],s=null,r.halfedges.forEach(function(n){var i=o.edges[n],a=i.left;if(a!==r.site&&a||(a=i.right)){var l=t-a[0],u=e-a[1],p=l*l+u*u;pr;){if(o-r>600){var a=o-r+1,l=i-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);e(t,i,Math.max(r,Math.floor(i-l*c/a+p)),Math.min(o,Math.floor(i+(a-l)*c/a+p)),s)}var f=t[i],h=r,d=o;for(n(t,r,i),s(t[o],f)>0&&n(t,r,o);h0;)d--}0===s(t[r],f)?n(t,r,d):n(t,++d,o),d<=i&&(r=d+1),i<=d&&(o=d-1)}}function n(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function i(t,e){return te?1:0}return t}()},3414:(t,e,n)=>{"use strict";var i=n(6570),r=n(8967);function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(i);function a(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=l(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(l(t))}),e}function l(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r0&&(i+=t[r-1].length,n.holes.push(i))}return n}(t),n=s.default(e.vertices,e.holes,2),i=[],o=[];n.forEach(function(t,i){var r=n[i];o.push([e.vertices[2*r],e.vertices[2*r+1]])});for(var a=0;au==c>-u?(o=u,u=e[++p]):(o=c,c=i[++f]);let h=0;if(pu==c>-u?(a=o-((s=u+o)-u),u=e[++p]):(a=o-((s=c+o)-c),c=i[++f]),o=s,0!==a&&(r[h++]=a);pu==c>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++p]):(a=o-((s=o+c)-(l=s-o))+(c-l),c=i[++f]),o=s,0!==a&&(r[h++]=a);for(;p0!=m>0)return v;const b=Math.abs(y+m);return Math.abs(v)>=o*b?v:-function(t,r,o,h,d,g,_){let y,m,v,b,x,w,E,k,S,C,I,N,M,L,O,P,T,A;const R=t-d,D=o-d,j=r-g,F=h-g;x=(O=(k=R-(E=(w=e*R)-(w-R)))*(C=F-(S=(w=e*F)-(w-F)))-((L=R*F)-E*S-k*S-E*C))-(I=O-(T=(k=j-(E=(w=e*j)-(w-j)))*(C=D-(S=(w=e*D)-(w-D)))-((P=j*D)-E*S-k*S-E*C))),l[0]=O-(I+x)+(x-T),x=(M=L-((N=L+I)-(x=N-L))+(I-x))-(I=M-P),l[1]=M-(I+x)+(x-P),x=(A=N+I)-N,l[2]=N-(A-x)+(I-x),l[3]=A;let z=function(t,e){let n=e[0];for(let i=1;i=B||-z>=B)return z;if(y=t-(R+(x=t-R))+(x-d),v=o-(D+(x=o-D))+(x-d),m=r-(j+(x=r-j))+(x-g),b=h-(F+(x=h-F))+(x-g),0===y&&0===m&&0===v&&0===b)return z;if(B=a*_+n*Math.abs(z),(z+=R*b+F*y-(j*v+D*m))>=B||-z>=B)return z;x=(O=(k=y-(E=(w=e*y)-(w-y)))*(C=F-(S=(w=e*F)-(w-F)))-((L=y*F)-E*S-k*S-E*C))-(I=O-(T=(k=m-(E=(w=e*m)-(w-m)))*(C=D-(S=(w=e*D)-(w-D)))-((P=m*D)-E*S-k*S-E*C))),f[0]=O-(I+x)+(x-T),x=(M=L-((N=L+I)-(x=N-L))+(I-x))-(I=M-P),f[1]=M-(I+x)+(x-P),x=(A=N+I)-N,f[2]=N-(A-x)+(I-x),f[3]=A;const G=i(4,l,4,f,u);x=(O=(k=R-(E=(w=e*R)-(w-R)))*(C=b-(S=(w=e*b)-(w-b)))-((L=R*b)-E*S-k*S-E*C))-(I=O-(T=(k=j-(E=(w=e*j)-(w-j)))*(C=v-(S=(w=e*v)-(w-v)))-((P=j*v)-E*S-k*S-E*C))),f[0]=O-(I+x)+(x-T),x=(M=L-((N=L+I)-(x=N-L))+(I-x))-(I=M-P),f[1]=M-(I+x)+(x-P),x=(A=N+I)-N,f[2]=N-(A-x)+(I-x),f[3]=A;const q=i(G,u,4,f,c);x=(O=(k=y-(E=(w=e*y)-(w-y)))*(C=b-(S=(w=e*b)-(w-b)))-((L=y*b)-E*S-k*S-E*C))-(I=O-(T=(k=m-(E=(w=e*m)-(w-m)))*(C=v-(S=(w=e*v)-(w-v)))-((P=m*v)-E*S-k*S-E*C))),f[0]=O-(I+x)+(x-T),x=(M=L-((N=L+I)-(x=N-L))+(I-x))-(I=M-P),f[1]=M-(I+x)+(x-P),x=(A=N+I)-N,f[2]=N-(A-x)+(I-x),f[3]=A;const U=i(q,c,4,f,p);return p[U-1]}(t,r,h,d,g,_,b)},t.orient2dfast=function(t,e,n,i,r,o){return(e-o)*(n-r)-(t-r)*(i-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},3509:t=>{function e(t,e,n,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,i)}e.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var r=0;r=this.minPts&&(e=this._mergeArrays(e,r))}1!==this._assigned[i]&&this._addToCluster(i,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506),o=n(4828);function s(t,e){for(var n=[],i=0,r=t;i0&&(a[0][0]===a[a.length-1][0]&&a[0][1]===a[a.length-1][1]||a.push(a[0]),a.length>=4&&n.push(a))}return n}e.default=function(t,e){var n=r.getGeom(t),a=n.type,l="Feature"===t.type?t.properties:{},u=n.coordinates;switch(a){case"LineString":case"MultiLineString":var c=[];return"LineString"===a&&(u=[u]),u.forEach(function(t){o.lineclip(t,e,c)}),1===c.length?i.lineString(c[0],l):i.multiLineString(c,l);case"Polygon":return i.polygon(s(u,e),l);case"MultiPolygon":return i.multiPolygon(u.map(function(t){return s(t,e)}),l);default:throw new Error("geometry "+a+" not supported")}}},3607:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ULabelLoader=void 0;var n=function(){function t(){}return t.add_loader_div=function(e){var n=document.createElement("div");n.classList.add("ulabel-loader-overlay");var i=document.createElement("div");i.classList.add("ulabel-loader");var r=t.build_loader_style();n.appendChild(i),n.appendChild(r),e.appendChild(n)},t.remove_loader_div=function(){var t=document.querySelector(".ulabel-loader-overlay");t&&t.remove()},t.build_loader_style=function(){var t=document.createElement("style");return t.innerHTML="\n .ulabel-loader-overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 100;\n }\n .ulabel-loader {\n border: 16px solid #f3f3f3;\n border-top: 16px solid #3498db;\n border-radius: 50%;\n width: 120px;\n height: 120px;\n animation: spin 2s linear infinite;\n position: fixed;\n inset: 0;\n margin: auto;\n }\n \n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",t},t}();e.ULabelLoader=n},3628:(t,e,n)=>{"use strict";var i=n(8648),r=n(1064),o=n(7176);t.exports=i?function(t){return i(t)}:r?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return r(t)}:o?function(t){return o(t)}:null},3707:(t,e,n)=>{"use strict";var i=n(8421),r=n(8967);function o(t){var e=[];return"FeatureCollection"===t.type?i.featureEach(t,function(t){i.coordEach(t,function(n){e.push(r.point(n,t.properties))})}):i.coordEach(t,function(n){e.push(r.point(n,t.properties))}),r.featureCollection(e)}t.exports=o,t.exports.default=o},3711:(t,e)=>{"use strict";function n(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=i(t.properties),e.geometry=r(t.geometry),e}function i(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map(function(t){return t}):e[n]=i(r):e[n]=r}),e):e}function r(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return r(t)}),e):(e.coordinates=o(t.coordinates),e)}function o(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map(function(t){return o(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return n(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return n(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return r(t);default:throw new Error("unknown GeoJSON type")}}},3841:t=>{t.exports=function(t,e,n,i){var r=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);for(var a=(i-n)/2,l=0,u=a-1;lo!=h>o&&r<(f-c)*(o-p)/(h-p)+c&&(s=!s)}return s}},3855:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(5784),r=n(1207),o=n(6432),s=n(347),a=n(1484),l=n(9387),u=n(1111),c=n(301),p=n(7974),f=n(9730),h=n(2120),d=n(2363),g=n(5764),_=n(8748),y=n(6649),m=n(6320),v=n(4408),b=n(2583),x=n(9391),w=n(3707),E=n(4383),k=n(3414),S=n(3932),C=n(2446),I=n(9791),N=n(7696),M=n(3284),L=n(8220),O=n(2141),P=n(1288),T=n(4202),A=n(5518),R=n(6979),D=n(7849),j=n(9399),F=n(8840),z=n(7969),B=n(4957),G=n(7497),q=n(6834),U=n(4036),X=n(3154),Y=n(2222),$=n(7911),V=n(2352),H=n(7042),W=n(5848),J=n(375),K=n(4527),Z=n(8785),Q=n(3574),tt=n(4300),et=n(1786),nt=n(2307),it=n(9778),rt=n(7153),ot=n(4951),st=n(2163),at=n(1279),lt=n(7948),ut=n(1925),ct=n(8509),pt=n(1972),ft=n(7804),ht=n(1323),dt=n(3974),gt=n(7971),_t=n(7333),yt=n(8436),mt=n(5378),vt=n(7447),bt=n(4960),xt=n(1734),wt=n(3711),Et=n(2086),kt=n(8703),St=n(7521),Ct=n(3183),It=n(3980),Nt=n(9736),Mt=n(1356),Lt=n(7420),Ot=n(2779),Pt=n(6724),Tt=n(4333),At=n(4309),Rt=n(6775),Dt=n(7938),jt=n(7484),Ft=n(1101),zt=n(4575),Bt=n(5943),Gt=n(8967),qt=n(8506),Ut=n(8421),Xt=n(4927),Yt=n(7262),$t=n(2057),Vt=n(9627),Ht=n(7095),Wt=n(7564),Jt=n(7300),Kt=n(4512),Zt=n(9269),Qt=n(9933);function te(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function ee(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var ne=te(i),ie=te(r),re=te(o),oe=te(s),se=te(a),ae=te(l),le=te(u),ue=te(c),ce=te(p),pe=te(f),fe=te(h),he=te(d),de=te(g),ge=te(_),_e=te(y),ye=te(m),me=te(v),ve=te(b),be=te(x),xe=te(w),we=te(E),Ee=te(k),ke=te(S),Se=te(C),Ce=te(I),Ie=te(N),Ne=te(M),Me=te(L),Le=te(O),Oe=te(P),Pe=te(T),Te=te(A),Ae=te(R),Re=te(D),De=te(j),je=te(F),Fe=te(z),ze=te(B),Be=te(G),Ge=te(q),qe=te(U),Ue=te(X),Xe=te(Y),Ye=te($),$e=te(V),Ve=te(H),He=te(W),We=te(J),Je=te(K),Ke=te(Z),Ze=te(Q),Qe=te(tt),tn=te(et),en=te(nt),nn=te(it),rn=te(rt),on=te(ot),sn=te(st),an=te(at),ln=te(lt),un=te(ut),cn=te(ct),pn=te(pt),fn=te(ft),hn=te(ht),dn=te(dt),gn=te(gt),_n=te(_t),yn=te(yt),mn=te(mt),vn=te(vt),bn=te(bt),xn=te(xt),wn=te(wt),En=te(Et),kn=te(kt),Sn=te(St),Cn=te(Ct),In=te(It),Nn=te(Nt),Mn=te(Mt),Ln=te(Lt),On=te(Ot),Pn=te(Pt),Tn=te(Tt),An=te(At),Rn=te(Rt),Dn=te(Dt),jn=te(jt),Fn=ee(Ft),zn=ee(zt),Bn=ee(Bt),Gn=ee(Gt),qn=ee(qt),Un=ee(Ut),Xn=te(Xt),Yn=te(Yt),$n=te($t),Vn=te(Vt),Hn=te(Ht),Wn=te(Wt),Jn=te(Jt),Kn=te(Kt),Zn=te(Zt),Qn=te(Qt);Object.keys(Ft).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ft[t]}})}),Object.keys(zt).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return zt[t]}})}),Object.keys(Bt).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return Bt[t]}})}),Object.keys(Gt).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return Gt[t]}})}),Object.keys(qt).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return qt[t]}})}),Object.keys(Ut).forEach(function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return Ut[t]}})}),Object.defineProperty(e,"isolines",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(e,"convex",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(e,"pointsWithinPolygon",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(e,"within",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(e,"concave",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(e,"collect",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(e,"simplify",{enumerable:!0,get:function(){return le.default}}),Object.defineProperty(e,"bezier",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(e,"bezierSpline",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(e,"tag",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(e,"sample",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(e,"envelope",{enumerable:!0,get:function(){return fe.default}}),Object.defineProperty(e,"square",{enumerable:!0,get:function(){return he.default}}),Object.defineProperty(e,"circle",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(e,"midpoint",{enumerable:!0,get:function(){return ge.default}}),Object.defineProperty(e,"center",{enumerable:!0,get:function(){return _e.default}}),Object.defineProperty(e,"centerOfMass",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(e,"centroid",{enumerable:!0,get:function(){return me.default}}),Object.defineProperty(e,"combine",{enumerable:!0,get:function(){return ve.default}}),Object.defineProperty(e,"distance",{enumerable:!0,get:function(){return be.default}}),Object.defineProperty(e,"explode",{enumerable:!0,get:function(){return xe.default}}),Object.defineProperty(e,"bbox",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(e,"tesselate",{enumerable:!0,get:function(){return Ee.default}}),Object.defineProperty(e,"bboxPolygon",{enumerable:!0,get:function(){return ke.default}}),Object.defineProperty(e,"booleanPointInPolygon",{enumerable:!0,get:function(){return Se.default}}),Object.defineProperty(e,"inside",{enumerable:!0,get:function(){return Se.default}}),Object.defineProperty(e,"nearest",{enumerable:!0,get:function(){return Ce.default}}),Object.defineProperty(e,"nearestPoint",{enumerable:!0,get:function(){return Ce.default}}),Object.defineProperty(e,"nearestPointOnLine",{enumerable:!0,get:function(){return Ie.default}}),Object.defineProperty(e,"pointOnLine",{enumerable:!0,get:function(){return Ie.default}}),Object.defineProperty(e,"nearestPointToLine",{enumerable:!0,get:function(){return Ne.default}}),Object.defineProperty(e,"planepoint",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(e,"tin",{enumerable:!0,get:function(){return Le.default}}),Object.defineProperty(e,"bearing",{enumerable:!0,get:function(){return Oe.default}}),Object.defineProperty(e,"destination",{enumerable:!0,get:function(){return Pe.default}}),Object.defineProperty(e,"kinks",{enumerable:!0,get:function(){return Te.default}}),Object.defineProperty(e,"pointOnFeature",{enumerable:!0,get:function(){return Ae.default}}),Object.defineProperty(e,"pointOnSurface",{enumerable:!0,get:function(){return Ae.default}}),Object.defineProperty(e,"area",{enumerable:!0,get:function(){return Re.default}}),Object.defineProperty(e,"along",{enumerable:!0,get:function(){return De.default}}),Object.defineProperty(e,"length",{enumerable:!0,get:function(){return je.default}}),Object.defineProperty(e,"lineDistance",{enumerable:!0,get:function(){return je.default}}),Object.defineProperty(e,"lineSlice",{enumerable:!0,get:function(){return Fe.default}}),Object.defineProperty(e,"lineSliceAlong",{enumerable:!0,get:function(){return ze.default}}),Object.defineProperty(e,"pointGrid",{enumerable:!0,get:function(){return Be.default}}),Object.defineProperty(e,"truncate",{enumerable:!0,get:function(){return Ge.default}}),Object.defineProperty(e,"flatten",{enumerable:!0,get:function(){return qe.default}}),Object.defineProperty(e,"lineIntersect",{enumerable:!0,get:function(){return Ue.default}}),Object.defineProperty(e,"lineChunk",{enumerable:!0,get:function(){return Xe.default}}),Object.defineProperty(e,"unkinkPolygon",{enumerable:!0,get:function(){return Ye.default}}),Object.defineProperty(e,"greatCircle",{enumerable:!0,get:function(){return $e.default}}),Object.defineProperty(e,"lineSegment",{enumerable:!0,get:function(){return Ve.default}}),Object.defineProperty(e,"lineSplit",{enumerable:!0,get:function(){return He.default}}),Object.defineProperty(e,"lineArc",{enumerable:!0,get:function(){return We.default}}),Object.defineProperty(e,"polygonToLine",{enumerable:!0,get:function(){return Je.default}}),Object.defineProperty(e,"polygonToLineString",{enumerable:!0,get:function(){return Je.default}}),Object.defineProperty(e,"lineStringToPolygon",{enumerable:!0,get:function(){return Ke.default}}),Object.defineProperty(e,"lineToPolygon",{enumerable:!0,get:function(){return Ke.default}}),Object.defineProperty(e,"bboxClip",{enumerable:!0,get:function(){return Ze.default}}),Object.defineProperty(e,"lineOverlap",{enumerable:!0,get:function(){return Qe.default}}),Object.defineProperty(e,"sector",{enumerable:!0,get:function(){return tn.default}}),Object.defineProperty(e,"rhumbBearing",{enumerable:!0,get:function(){return en.default}}),Object.defineProperty(e,"rhumbDistance",{enumerable:!0,get:function(){return nn.default}}),Object.defineProperty(e,"rhumbDestination",{enumerable:!0,get:function(){return rn.default}}),Object.defineProperty(e,"polygonTangents",{enumerable:!0,get:function(){return on.default}}),Object.defineProperty(e,"rewind",{enumerable:!0,get:function(){return sn.default}}),Object.defineProperty(e,"isobands",{enumerable:!0,get:function(){return an.default}}),Object.defineProperty(e,"transformRotate",{enumerable:!0,get:function(){return ln.default}}),Object.defineProperty(e,"transformScale",{enumerable:!0,get:function(){return un.default}}),Object.defineProperty(e,"transformTranslate",{enumerable:!0,get:function(){return cn.default}}),Object.defineProperty(e,"lineOffset",{enumerable:!0,get:function(){return pn.default}}),Object.defineProperty(e,"polygonize",{enumerable:!0,get:function(){return fn.default}}),Object.defineProperty(e,"booleanDisjoint",{enumerable:!0,get:function(){return hn.default}}),Object.defineProperty(e,"booleanContains",{enumerable:!0,get:function(){return dn.default}}),Object.defineProperty(e,"booleanCrosses",{enumerable:!0,get:function(){return gn.default}}),Object.defineProperty(e,"booleanClockwise",{enumerable:!0,get:function(){return _n.default}}),Object.defineProperty(e,"booleanOverlap",{enumerable:!0,get:function(){return yn.default}}),Object.defineProperty(e,"booleanPointOnLine",{enumerable:!0,get:function(){return mn.default}}),Object.defineProperty(e,"booleanEqual",{enumerable:!0,get:function(){return vn.default}}),Object.defineProperty(e,"booleanWithin",{enumerable:!0,get:function(){return bn.default}}),Object.defineProperty(e,"booleanIntersects",{enumerable:!0,get:function(){return xn.default}}),Object.defineProperty(e,"clone",{enumerable:!0,get:function(){return wn.default}}),Object.defineProperty(e,"cleanCoords",{enumerable:!0,get:function(){return En.default}}),Object.defineProperty(e,"clustersDbscan",{enumerable:!0,get:function(){return kn.default}}),Object.defineProperty(e,"clustersKmeans",{enumerable:!0,get:function(){return Sn.default}}),Object.defineProperty(e,"pointToLineDistance",{enumerable:!0,get:function(){return Cn.default}}),Object.defineProperty(e,"booleanParallel",{enumerable:!0,get:function(){return In.default}}),Object.defineProperty(e,"shortestPath",{enumerable:!0,get:function(){return Nn.default}}),Object.defineProperty(e,"voronoi",{enumerable:!0,get:function(){return Mn.default}}),Object.defineProperty(e,"ellipse",{enumerable:!0,get:function(){return Ln.default}}),Object.defineProperty(e,"centerMean",{enumerable:!0,get:function(){return On.default}}),Object.defineProperty(e,"centerMedian",{enumerable:!0,get:function(){return Pn.default}}),Object.defineProperty(e,"standardDeviationalEllipse",{enumerable:!0,get:function(){return Tn.default}}),Object.defineProperty(e,"angle",{enumerable:!0,get:function(){return An.default}}),Object.defineProperty(e,"polygonSmooth",{enumerable:!0,get:function(){return Rn.default}}),Object.defineProperty(e,"moranIndex",{enumerable:!0,get:function(){return Dn.default}}),Object.defineProperty(e,"distanceWeight",{enumerable:!0,get:function(){return jn.default}}),e.projection=Fn,e.random=zn,e.clusters=Bn,Object.defineProperty(e,"bearingToAngle",{enumerable:!0,get:function(){return Gt.bearingToAzimuth}}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:function(){return Gt.convertLength}}),Object.defineProperty(e,"degrees2radians",{enumerable:!0,get:function(){return Gt.degreesToRadians}}),Object.defineProperty(e,"distanceToDegrees",{enumerable:!0,get:function(){return Gt.lengthToDegrees}}),Object.defineProperty(e,"distanceToRadians",{enumerable:!0,get:function(){return Gt.lengthToRadians}}),e.helpers=Gn,Object.defineProperty(e,"radians2degrees",{enumerable:!0,get:function(){return Gt.radiansToDegrees}}),Object.defineProperty(e,"radiansToDistance",{enumerable:!0,get:function(){return Gt.radiansToLength}}),e.invariant=qn,e.meta=Un,Object.defineProperty(e,"difference",{enumerable:!0,get:function(){return Xn.default}}),Object.defineProperty(e,"buffer",{enumerable:!0,get:function(){return Yn.default}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return $n.default}}),Object.defineProperty(e,"intersect",{enumerable:!0,get:function(){return Vn.default}}),Object.defineProperty(e,"dissolve",{enumerable:!0,get:function(){return Hn.default}}),Object.defineProperty(e,"hexGrid",{enumerable:!0,get:function(){return Wn.default}}),Object.defineProperty(e,"mask",{enumerable:!0,get:function(){return Jn.default}}),Object.defineProperty(e,"squareGrid",{enumerable:!0,get:function(){return Kn.default}}),Object.defineProperty(e,"triangleGrid",{enumerable:!0,get:function(){return Zn.default}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return Qn.default}})},3932:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967);e.default=function(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),o=Number(t[2]),s=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[n,r],l=[n,s],u=[o,s],c=[o,r];return i.polygon([[a,c,u,l,a]],e.properties,{bbox:t,id:e.id})}},3974:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4383)),o=i(n(2446)),s=i(n(5378)),a=n(8506);function l(t,e){var n,i=!1;for(n=0;ne[0])&&(!(t[2]e[1])&&!(t[3]{"use strict";var i=n(8452).supportsDescriptors,r=n(5330),o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,a=TypeError,l=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!i||!l)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r(),e=l(u),n=o(e,"flags");return n&&n.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},4035:(t,e,n)=>{"use strict";var i,r,o,s,a=n(8075),l=n(9092)();if(l){i=a("Object.prototype.hasOwnProperty"),r=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var c=a("Object.prototype.toString"),p=Object.getOwnPropertyDescriptor;t.exports=l?function(t){if(!t||"object"!=typeof t)return!1;var e=p(t,"lastIndex");if(!(e&&i(e,"value")))return!1;try{r(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)}},4036:(t,e,n)=>{"use strict";var i=n(8421),r=n(8967);function o(t){if(!t)throw new Error("geojson is required");var e=[];return i.flattenEach(t,function(t){e.push(t)}),r.featureCollection(e)}t.exports=o,t.exports.default=o},4039:(t,e,n)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,r=n(1333);t.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&r())))}},4202:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506);e.default=function(t,e,n,o){void 0===o&&(o={});var s=r.getCoord(t),a=i.degreesToRadians(s[0]),l=i.degreesToRadians(s[1]),u=i.degreesToRadians(n),c=i.lengthToRadians(e,o.units),p=Math.asin(Math.sin(l)*Math.cos(c)+Math.cos(l)*Math.sin(c)*Math.cos(u)),f=a+Math.atan2(Math.sin(u)*Math.sin(c)*Math.cos(l),Math.cos(c)-Math.sin(l)*Math.sin(p)),h=i.radiansToDegrees(f),d=i.radiansToDegrees(p);return i.point([h,d],o.properties)}},4262:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});class i{constructor(t=[],e=r){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,i=e[t];for(;t>0;){const r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i}_down(t){const{data:e,compare:n}=this,i=this.length>>1,r=e[t];for(;t=0)break;e[t]=o,t=i}e[t]=r}}function r(t,e){return te?1:0}},4300:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4945)),o=i(n(7042)),s=i(n(7696)),a=i(n(5378)),l=n(8506),u=n(8421),c=n(8967),p=i(n(4982));function f(t,e){var n=l.getCoords(e),i=l.getCoords(t),r=i[0],o=i[i.length-1],s=t.geometry.coordinates;return p.default(n[0],r)?s.unshift(n[1]):p.default(n[0],o)?s.push(n[1]):p.default(n[1],r)?s.unshift(n[0]):p.default(n[1],o)&&s.push(n[0]),t}e.default=function(t,e,n){if(void 0===n&&(n={}),n=n||{},!c.isObject(n))throw new Error("options is invalid");var i,h=n.tolerance||0,d=[],g=r.default(),_=o.default(t);return g.load(_),u.segmentEach(e,function(t){var e=!1;t&&(u.featureEach(g.search(t),function(n){if(!1===e){var r=l.getCoords(t).sort(),o=l.getCoords(n).sort();p.default(r,o)||(0===h?a.default(r[0],n)&&a.default(r[1],n):s.default(n,r[0]).properties.dist<=h&&s.default(n,r[1]).properties.dist<=h)?(e=!0,i=i?f(i,t):t):(0===h?a.default(o[0],t)&&a.default(o[1],t):s.default(t,o[0]).properties.dist<=h&&s.default(t,o[1]).properties.dist<=h)&&(i=i?f(i,n):n)}}),!1===e&&i&&(d.push(i),i=void 0))}),i&&d.push(i),c.featureCollection(d)}},4309:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1288)),o=n(8967),s=i(n(2307));e.default=function(t,e,n,i){if(void 0===i&&(i={}),!o.isObject(i))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var a=t,l=e,u=n,c=o.bearingToAzimuth(!0!==i.mercator?r.default(a,l):s.default(a,l)),p=o.bearingToAzimuth(!0!==i.mercator?r.default(u,l):s.default(u,l)),f=Math.abs(c-p);return!0===i.explementary?360-f:f}},4333:(t,e,n)=>{"use strict";var i=n(8421),r=n(8506),o=n(8967),s=n(2779),a=n(6432),l=n(7420);function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=u(s),p=u(a),f=u(l);function h(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.steps||64,s=e.weight,a=e.properties||{};if(!o.isNumber(n))throw new Error("steps must be a number");if(!o.isObject(a))throw new Error("properties must be a number");var l=i.coordAll(t).length,u=c.default(t,{weight:s}),h=0,g=0,_=0;i.featureEach(t,function(t){var e=t.properties[s]||1,n=d(r.getCoords(t),r.getCoords(u));h+=Math.pow(n.x,2)*e,g+=Math.pow(n.y,2)*e,_+=n.x*n.y*e});var y=h-g,m=Math.sqrt(Math.pow(y,2)+4*Math.pow(_,2)),v=2*_,b=Math.atan((y+m)/v),x=180*b/Math.PI,w=0,E=0,k=0;i.featureEach(t,function(t){var e=t.properties[s]||1,n=d(r.getCoords(t),r.getCoords(u));w+=Math.pow(n.x*Math.cos(b)-n.y*Math.sin(b),2)*e,E+=Math.pow(n.x*Math.sin(b)+n.y*Math.cos(b),2)*e,k+=e});var S=Math.sqrt(2*w/k),C=Math.sqrt(2*E/k),I=f.default(u,S,C,{units:"degrees",angle:x,steps:n,properties:a}),N=p.default(t,o.featureCollection([I])),M={meanCenterCoordinates:r.getCoords(u),semiMajorAxis:S,semiMinorAxis:C,numberOfFeatures:l,angle:x,percentageWithinEllipse:100*i.coordAll(N).length/l};return I.properties.standardDeviationalEllipse=M,I}function d(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}t.exports=h,t.exports.default=h},4383:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8421);function r(t){var e=[1/0,1/0,-1/0,-1/0];return i.coordEach(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VALID_HTML_COLORS=void 0,e.VALID_HTML_COLORS={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},4408:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8421),r=n(8967);e.default=function(t,e){void 0===e&&(e={});var n=0,o=0,s=0;return i.coordEach(t,function(t){n+=t[0],o+=t[1],s++},!0),r.point([n/s,o/s],e.properties)}},4459:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},4462:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch(t){n=null}e.functionsHaveConfigurableNames=function(){if(!e()||!n)return!1;var t=n(function(){},"name");return!!t&&!!t.configurable};var i=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof i&&""!==function(){}.bind().name},t.exports=e},4493:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SliderHandler=void 0,e.add_style_to_document=function(t){var e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");e.appendChild(n),n.appendChild(document.createTextNode((0,s.get_init_style)(t.config.container_id)))},e.prep_window_html=function(t,e){void 0===e&&(e=null);var n=function(t){for(var e,n="",i=0;i\n ');return n}(t),o=function(t){var e="",n=0;for(var i in t.subtasks)(t.subtasks[i].allowed_modes.includes("whole-image")||t.subtasks[i].allowed_modes.includes("global"))&&(n+=1);var r=0;for(var i in t.subtasks)if((t.subtasks[i].allowed_modes.includes("whole-image")||t.subtasks[i].allowed_modes.includes("global"))&&(e+='\n
\n
\n
\n
\n
\n
').concat(t.subtasks[i].display_name,'
\n
\n
\n
\n
\n
\n +\n
\n
\n
\n
\n
\n
\n '),(r+=1)>4))throw new Error("At most 4 subtasks can have allow 'whole-image' or 'global' annotations.");return e}(t),c=new i.Toolbox([],i.Toolbox.create_toolbox(t,e)),p=c.setup_toolbox_html(t,o,n,r.ULABEL_VERSION);$("#"+t.config.container_id).html(p);var f=document.getElementById(t.config.container_id);a.ULabelLoader.add_loader_div(f);var h=Object.keys(t.subtasks)[0],d=t.config.toolbox_id,g=t.subtasks[h].state.annotation_mode,_=[u("bbox","Bounding Box",s.BBOX_SVG,g,t.subtasks),u("point","Point",s.POINT_SVG,g,t.subtasks),u("polygon","Polygon",s.POLYGON_SVG,g,t.subtasks),u("tbar","T-Bar",s.TBAR_SVG,g,t.subtasks),u("polyline","Polyline",s.POLYLINE_SVG,g,t.subtasks),u("contour","Contour",s.CONTOUR_SVG,g,t.subtasks),u("bbox3","Bounding Cube",s.BBOX3_SVG,g,t.subtasks),u("whole-image","Whole Frame",s.WHOLE_IMAGE_SVG,g,t.subtasks),u("global","Global",s.GLOBAL_SVG,g,t.subtasks),u("delete_polygon","Delete",s.DELETE_POLYGON_SVG,g,t.subtasks),u("delete_bbox","Delete",s.DELETE_BBOX_SVG,g,t.subtasks)];$("#"+d+" .toolbox_inner_cls .mode-selection").append(_.join("\x3c!-- --\x3e")),t.show_annotation_mode(null),$("#"+t.config.toolbox_id+" .toolbox_inner_cls").height()>$("#"+t.config.container_id).height()&&$("#"+t.config.toolbox_id).css("overflow-y","scroll");t.toolbox=c;if(function(t){if(0==t.length)return!1;for(var e in t)if(t[e]instanceof i.ZoomPanToolboxItem)return!0;return!1}(t.toolbox.items)){if(null!=(y=t.config.initial_crop)&&("width"in y&&"height"in y&&"left"in y&&"top"in y||((0,l.log_message)("initial_crop missing necessary properties. Ignoring.",l.LogLevel.INFO),0)))document.getElementById("recenter-button").innerHTML="Initial Crop";else document.getElementById("recenter-whole-image-button").style.display="none"}var y},e.build_class_change_svg=c,e.get_idd_string=p,e.build_id_dialogs=function(t){var e='
',n=t.config.outer_diameter,i=t.config.inner_prop*n/2,r=.5*n,s=t.config.toolbox_id;for(var a in t.subtasks){var l=t.subtasks[a].state.idd_id,u=t.subtasks[a].state.idd_id_front,c=t.color_info,f=$("#dialogs__"+a),h=$("#front_dialogs__"+a),d=p(l,n,t.subtasks[a].class_ids,i,c),g=p(u,n,t.subtasks[a].class_ids,i,c),_='
'),y=JSON.parse(JSON.stringify(t.subtasks[a].class_ids));t.subtasks[a].class_defs.at(-1).id===o.DELETE_CLASS_ID&&y.push(o.DELETE_CLASS_ID);for(var m=0;m\n
').concat(x,"\n \n ")}_+="\n
",h.append(g),f.append(d),e+=_,t.subtasks[a].state.visible_dialogs[l]={left:0,top:0,pin:"center"}}$("#"+t.config.toolbox_id+" div.id-toolbox-app").html(e),$("#"+t.config.container_id+" a.id-dialog-clickable-indicator").css({height:"".concat(n,"px"),width:"".concat(n,"px"),"border-radius":"".concat(r,"px")})},e.build_edit_suggestion=function(t){for(var e in t.subtasks){var n="edit_suggestion__".concat(e),i="global_edit_suggestion__".concat(e),r=$("#dialogs__"+e);r.append('\n \n ')),$("#"+n).css({height:t.config.edit_handle_size+"px",width:t.config.edit_handle_size+"px","border-radius":t.config.edit_handle_size/2+"px"});var o="",s="";t.subtasks[e].single_class_mode||(o='--\x3e\x3c!--',s=" mcm"),r.append('\n
\n \n \n \x3c!--\n ').concat(o,'\n --\x3e\n ×\n \n
\n ')),t.subtasks[e].state.visible_dialogs[n]={left:0,top:0,pin:"center"},t.subtasks[e].state.visible_dialogs[i]={left:0,top:0,pin:"center"}}},e.build_confidence_dialog=function(t){for(var e in t.subtasks){var n="annotation_confidence__".concat(e),i="global_annotation_confidence__".concat(e),r=$("#dialogs__"+e),o=$("#global_edit_suggestion__"+e);r.append('\n

\n ')),$("#"+n).css({height:t.config.edit_handle_size+"px",width:t.config.edit_handle_size+"px"});var s="";t.subtasks[e].single_class_mode||(s=" mcm"),o.append('\n
\n

Annotation Confidence:

\n

\n N/A\n

\n
\n ')),$("#"+i).css({"background-color":"black",color:"white",opacity:"0.6",height:"3em",width:"14.5em","margin-top":"-9.5em","border-radius":"1em","font-size":"1.2em","margin-left":"-1.4em"})}};var i=n(3045),r=n(1424),o=n(5573),s=n(2748),a=n(3607),l=n(5638);function u(t,e,n,i,r){var o="",s=' href="#"';i==t&&(o=" sel",s="");var a="";for(var l in r)r[l].allowed_modes.includes(t)&&(a+=" md-en4--"+l);return'
\n \n ').concat(n,"\n \n
")}function c(t,e,n,i){var r,o,s;void 0===i&&(i={});for(var a=null!==(r=i.width)&&void 0!==r?r:500,l=null!==(o=i.inner_radius)&&void 0!==o?o:.3,u=null!==(s=i.opacity)&&void 0!==s?s:.4,c=.5*a,p=a/2,f=1/t.length,h=1-f,d=l+(c-l)/2,g=2*Math.PI*d*f,_=c-l,y=2*Math.PI*d*h,m=l+f*(c-l)/2,v=2*Math.PI*m*f,b=f*(c-l),x=2*Math.PI*m*h,w=''),E=0;E\n ')}return w+=""}function p(t,e,n,i,r){var o='\n
\n ');o+=c(n,r,t,{width:e,inner_radius:i});var s=.5*e;return o+='
')}var f=function(){function t(t){var e=this;this.label_units="",this.min="0",this.max="100",this.step="1",this.step_as_number=1,this.default_value=t.default_value,this.id=t.id,this.slider_event=t.slider_event,void 0!==t.class&&(this.class=t.class),void 0!==t.main_label&&(this.main_label=t.main_label),void 0!==t.label_units&&(this.label_units=t.label_units),void 0!==t.min&&(this.min=t.min),void 0!==t.max&&(this.max=t.max),void 0!==t.step&&(this.step=t.step),this.step_as_number=Number(this.step),this.add_styles(),$(document).on("input.ulabel","#".concat(this.id),function(t){e.updateLabel(),e.slider_event(t.currentTarget.valueAsNumber)}),$(document).on("click.ulabel","#".concat(this.id,"-inc-button"),function(){return e.incrementSlider()}),$(document).on("click.ulabel","#".concat(this.id,"-dec-button"),function(){return e.decrementSlider()})}return t.prototype.add_styles=function(){var t="slider-handler-styles";if(!document.getElementById(t)){var e=document.head||document.querySelector("head"),n=document.createElement("style");n.appendChild(document.createTextNode("\n #toolbox div.ulabel-slider-container {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin: 0 1.5rem 0.5rem;\n }\n \n #toolbox div.ulabel-slider-container label.ulabel-filter-row-distance-name-label {\n width: 100%; /* Ensure title takes up full width of container */\n font-size: 0.95rem;\n align-items: center;\n }\n \n #toolbox div.ulabel-slider-container > *:not(label.ulabel-filter-row-distance-name-label) {\n flex: 1;\n }\n \n /* \n .ulabel-night #toolbox div.ulabel-slider-container label {\n color: white;\n }\n */\n #toolbox div.ulabel-slider-container label.ulabel-slider-value-label {\n font-size: 0.9rem;\n }\n \n \n #toolbox div.ulabel-slider-container div.ulabel-slider-decrement-button-text {\n position: relative;\n bottom: 1.5px;\n }")),n.id=t,e.appendChild(n)}},t.prototype.updateLabel=function(){var t=document.querySelector("#".concat(this.id));document.querySelector("#".concat(this.id,"-value-label")).innerText=t.value+this.label_units},t.prototype.incrementSlider=function(){var t=document.querySelector("#".concat(this.id)),e=t.valueAsNumber+this.step_as_number;t.value=e.toString(),this.updateLabel(),this.slider_event(t.value)},t.prototype.decrementSlider=function(){var t=document.querySelector("#".concat(this.id)),e=t.valueAsNumber-this.step_as_number;t.value=e.toString(),this.updateLabel(),this.slider_event(t.value)},t.prototype.getSliderHTML=function(){return'\n
\n '.concat(this.main_label?'"):"",'\n \n \n
\n \n \n
\n
\n ')},t}();e.SliderHandler=f},4512:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7112));e.default=function(t,e,n){return void 0===n&&(n={}),r.default(t,e,e,n)}},4527:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(8967),r=n(8506);function o(t,e){return void 0===e&&(e={}),a(r.getGeom(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function s(t,e){void 0===e&&(e={});var n=r.getGeom(t).coordinates,o=e.properties?e.properties:"Feature"===t.type?t.properties:{},s=[];return n.forEach(function(t){s.push(a(t,o))}),i.featureCollection(s)}function a(t,e){return t.length>1?i.multiLineString(t,e):i.lineString(t[0],e)}e.default=function(t,e){void 0===e&&(e={});var n=r.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return o(n,e);case"MultiPolygon":return s(n,e);default:throw new Error("invalid poly")}},e.polygonToLine=o,e.multiPolygonToLine=s,e.coordsToLine=a},4575:function(t,e,n){"use strict";var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e0?t+n[e-1]:t}),l.forEach(function(t){t=2*t*Math.PI/l[l.length-1];var n=Math.random();a.push([n*(e.max_radial_length||10)*Math.sin(t),n*(e.max_radial_length||10)*Math.cos(t)])}),a[a.length-1]=a[0],a=a.map((s=o(e.bbox),function(t){return[t[0]+s[0],t[1]+s[1]]})),n.push(r.polygon([a]))},a=0;a0&&e-1 in t)}function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:E,constructor:S,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+O+")"+O+"*"),G=new RegExp(O+"|>"),q=new RegExp(j),U=new RegExp("^"+T+"$"),X={ID:new RegExp("^#("+T+")"),CLASS:new RegExp("^\\.("+T+")"),TAG:new RegExp("^("+T+"|[*])"),ATTR:new RegExp("^"+A),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+C+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,W=new RegExp("\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\([^\\r\\n\\f])","g"),J=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},K=function(){lt()},Z=ft(function(t){return!0===t.disabled&&I(t,"fieldset")},{dir:"parentNode",next:"legend"});try{g.apply(o=a.call(R.childNodes),R.childNodes),o[R.childNodes.length].nodeType}catch(t){g={apply:function(t,e){D.apply(t,a.call(e))},call:function(t){D.apply(t,a.call(arguments,1))}}}function Q(t,e,n,i){var r,o,s,a,u,c,h,d=e&&e.ownerDocument,m=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==m&&9!==m&&11!==m)return n;if(!i&&(lt(e),e=e||l,p)){if(11!==m&&(u=V.exec(t)))if(r=u[1]){if(9===m){if(!(s=e.getElementById(r)))return n;if(s.id===r)return g.call(n,s),n}else if(d&&(s=d.getElementById(r))&&Q.contains(e,s)&&s.id===r)return g.call(n,s),n}else{if(u[2])return g.apply(n,e.getElementsByTagName(t)),n;if((r=u[3])&&e.getElementsByClassName)return g.apply(n,e.getElementsByClassName(r)),n}if(!(E[t+" "]||f&&f.test(t))){if(h=t,d=e,1===m&&(G.test(t)||B.test(t))){for((d=H.test(t)&&at(e.parentNode)||e)==e&&_.scope||((a=e.getAttribute("id"))?a=S.escapeSelector(a):e.setAttribute("id",a=y)),o=(c=ct(t)).length;o--;)c[o]=(a?"#"+a:":scope")+" "+pt(c[o]);h=c.join(",")}try{return g.apply(n,d.querySelectorAll(h)),n}catch(e){E(t,!0)}finally{a===y&&e.removeAttribute("id")}}}return mt(t.replace(P,"$1"),e,n,i)}function tt(){var t=[];return function n(i,r){return t.push(i+" ")>e.cacheLength&&delete n[t.shift()],n[i+" "]=r}}function et(t){return t[y]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function it(t){return function(e){return I(e,"input")&&e.type===t}}function rt(t){return function(e){return(I(e,"input")||I(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Z(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function st(t){return et(function(e){return e=+e,et(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,i=t?t.ownerDocument||t:R;return i!=l&&9===i.nodeType&&i.documentElement?(u=(l=i).documentElement,p=!S.isXMLDoc(l),d=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&R!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",K),_.getById=nt(function(t){return u.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length}),_.disconnectedMatch=nt(function(t){return d.call(t,"*")}),_.scope=nt(function(){return l.querySelectorAll(":scope")}),_.cssHas=nt(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}}),_.getById?(e.filter.ID=function(t){var e=t.replace(W,J);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(W,J);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},f=[],nt(function(t){var e;u.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||f.push("\\["+O+"*(?:value|"+C+")"),t.querySelectorAll("[id~="+y+"-]").length||f.push("~="),t.querySelectorAll("a#"+y+"+*").length||f.push(".#.+[+~]"),t.querySelectorAll(":checked").length||f.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),u.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||f.push("\\["+O+"*name"+O+"*="+O+"*(?:''|\"\")")}),_.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),k=function(t,e){if(t===e)return s=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!_.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==R&&Q.contains(R,t)?-1:e===l||e.ownerDocument==R&&Q.contains(R,e)?1:r?c.call(r,t)-c.call(r,e):0:4&n?-1:1)},l):l}for(t in Q.matches=function(t,e){return Q(t,null,null,e)},Q.matchesSelector=function(t,e){if(lt(t),p&&!E[e+" "]&&(!f||!f.test(e)))try{var n=d.call(t,e);if(n||_.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){E(e,!0)}return Q(e,l,null,[t]).length>0},Q.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},Q.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var i=e.attrHandle[n.toLowerCase()],r=i&&h.call(e.attrHandle,n.toLowerCase())?i(t,n,!p):void 0;return void 0!==r?r:t.getAttribute(n)},Q.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,n=[],i=0,o=0;if(s=!_.sortStable,r=!_.sortStable&&a.call(t,0),M.call(t,k),s){for(;e=t[o++];)e===t[o]&&(i=n.push(o));for(;i--;)L.call(t,n[i],1)}return r=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(a.apply(this)))},e=S.expr={cacheLength:50,createPseudo:et,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(W,J),t[3]=(t[3]||t[4]||t[5]||"").replace(W,J),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Q.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Q.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&q.test(n)&&(e=ct(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(W,J).toLowerCase();return"*"===t?function(){return!0}:function(t){return I(t,e)}},CLASS:function(t){var e=b[t+" "];return e||(e=new RegExp("(^|"+O+")"+t+"("+O+"|$)"))&&b(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=Q.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(F," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var u,c,p,f,h,d=o!==s?"nextSibling":"previousSibling",g=e.parentNode,_=a&&e.nodeName.toLowerCase(),v=!l&&!a,b=!1;if(g){if(o){for(;d;){for(p=e;p=p[d];)if(a?I(p,_):1===p.nodeType)return!1;h=d="only"===t&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&v){for(b=(f=(u=(c=g[y]||(g[y]={}))[t]||[])[0]===m&&u[1])&&u[2],p=f&&g.childNodes[f];p=++f&&p&&p[d]||(b=f=0)||h.pop();)if(1===p.nodeType&&++b&&p===e){c[t]=[m,f,b];break}}else if(v&&(b=f=(u=(c=e[y]||(e[y]={}))[t]||[])[0]===m&&u[1]),!1===b)for(;(p=++f&&p&&p[d]||(b=f=0)||h.pop())&&(!(a?I(p,_):1===p.nodeType)||!++b||(v&&((c=p[y]||(p[y]={}))[t]=[m,b]),p!==e)););return(b-=r)===i||b%i===0&&b/i>=0}}},PSEUDO:function(t,n){var i,r=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Q.error("unsupported pseudo: "+t);return r[y]?r(n):r.length>1?(i=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et(function(t,e){for(var i,o=r(t,n),s=o.length;s--;)t[i=c.call(t,o[s])]=!(e[i]=o[s])}):function(t){return r(t,0,i)}):r}},pseudos:{not:et(function(t){var e=[],n=[],i=yt(t.replace(P,"$1"));return i[y]?et(function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:et(function(t){return function(e){return Q(t,e).length>0}}),contains:et(function(t){return t=t.replace(W,J),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}}),lang:et(function(t){return U.test(t||"")||Q.error("unsupported lang: "+t),t=t.replace(W,J).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(t){var e=i.location&&i.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===u},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return I(t,"input")&&!!t.checked||I(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return $.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){return I(t,"input")&&"button"===t.type||I(t,"button")},text:function(t){var e;return I(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:st(function(){return[0]}),last:st(function(t,e){return[e-1]}),eq:st(function(t,e,n){return[n<0?n+e:n]}),even:st(function(t,e){for(var n=0;ne?e:n;--i>=0;)t.push(i);return t}),gt:st(function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function dt(t,e,n,i,r){for(var o,s=[],a=0,l=t.length,u=null!=e;a-1&&(o[u]=!(s[u]=f))}}else h=dt(h===s?h.splice(y,h.length):h),r?r(null,s,h,l):g.apply(s,h)})}function _t(t){for(var i,r,o,s=t.length,a=e.relative[t[0].type],l=a||e.relative[" "],u=a?1:0,p=ft(function(t){return t===i},l,!0),f=ft(function(t){return c.call(i,t)>-1},l,!0),h=[function(t,e,r){var o=!a&&(r||e!=n)||((i=e).nodeType?p(t,e,r):f(t,e,r));return i=null,o}];u1&&ht(h),u>1&&pt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(P,"$1"),r,u0,o=t.length>0,s=function(s,a,u,c,f){var h,d,_,y=0,v="0",b=s&&[],x=[],w=n,E=s||o&&e.find.TAG("*",f),k=m+=null==w?1:Math.random()||.1,C=E.length;for(f&&(n=a==l||a||f);v!==C&&null!=(h=E[v]);v++){if(o&&h){for(d=0,a||h.ownerDocument==l||(lt(h),u=!p);_=t[d++];)if(_(h,a||l,u)){g.call(c,h);break}f&&(m=k)}r&&((h=!_&&h)&&y--,s&&b.push(h))}if(y+=v,r&&v!==y){for(d=0;_=i[d++];)_(b,x,a,u);if(s){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=N.call(c));x=dt(x)}g.apply(c,x),f&&!s&&x.length>0&&y+i.length>1&&S.uniqueSort(c)}return f&&(m=k,n=w),b};return r?et(s):s}(s,o)),a.selector=t}return a}function mt(t,n,i,r){var o,s,a,l,u,c="function"==typeof t&&t,f=!r&&ct(t=c.selector||t);if(i=i||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===n.nodeType&&p&&e.relative[s[1].type]){if(!(n=(e.find.ID(a.matches[0].replace(W,J),n)||[])[0]))return i;c&&(n=n.parentNode),t=t.slice(s.shift().value.length)}for(o=X.needsContext.test(t)?0:s.length;o--&&(a=s[o],!e.relative[l=a.type]);)if((u=e.find[l])&&(r=u(a.matches[0].replace(W,J),H.test(s[0].type)&&at(n.parentNode)||n))){if(s.splice(o,1),!(t=r.length&&pt(s)))return g.apply(i,r),i;break}}return(c||yt(t,f))(r,n,!p,i,!n||H.test(t)&&at(n.parentNode)||n),i}ut.prototype=e.filters=e.pseudos,e.setFilters=new ut,_.sortStable=y.split("").sort(k).join("")===y,lt(),_.sortDetached=nt(function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))}),S.find=Q,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,Q.compile=yt,Q.select=mt,Q.setDocument=lt,Q.tokenize=ct,Q.escape=S.escapeSelector,Q.getText=S.text,Q.isXML=S.isXMLDoc,Q.selectors=S.expr,Q.support=S.support,Q.uniqueSort=S.uniqueSort}();var j=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(n))break;i.push(t)}return i},F=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},z=S.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function G(t,e,n){return y(e)?S.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?S.grep(t,function(t){return t===e!==n}):"string"!=typeof e?S.grep(t,function(t){return c.call(e,t)>-1!==n}):S.filter(e,t,n)}S.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?S.find.matchesSelector(i,t)?[i]:[]:S.find.matches(t,S.grep(e,function(t){return 1===t.nodeType}))},S.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter(function(){for(e=0;e1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(G(this,t||[],!1))},not:function(t){return this.pushStack(G(this,t||[],!0))},is:function(t){return!!G(this,"string"==typeof t&&z.test(t)?S(t):t||[],!1).length}});var q,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||q,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:v,!0)),B.test(i[1])&&S.isPlainObject(e))for(i in e)y(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=v.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,q=S(v);var X=/^(?:parents|prev(?:Until|All))/,Y={children:!0,contents:!0,next:!0,prev:!0};function $(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(S(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return j(t,"parentNode")},parentsUntil:function(t,e,n){return j(t,"parentNode",n)},next:function(t){return $(t,"nextSibling")},prev:function(t){return $(t,"previousSibling")},nextAll:function(t){return j(t,"nextSibling")},prevAll:function(t){return j(t,"previousSibling")},nextUntil:function(t,e,n){return j(t,"nextSibling",n)},prevUntil:function(t,e,n){return j(t,"previousSibling",n)},siblings:function(t){return F((t.parentNode||{}).firstChild,t)},children:function(t){return F(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(I(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},function(t,e){S.fn[t]=function(n,i){var r=S.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=S.filter(i,r)),this.length>1&&(Y[t]||S.uniqueSort(r),X.test(t)&&r.reverse()),this.pushStack(r)}});var V=/[^\x20\t\r\n\f]+/g;function H(t){return t}function W(t){throw t}function J(t,e,n,i){var r;try{t&&y(r=t.promise)?r.call(t).done(e).fail(n):t&&y(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(V)||[],function(t,n){e[n]=!0}),e}(t):S.extend({},t);var e,n,i,r,o=[],s=[],a=-1,l=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred(function(n){S.each(e,function(e,i){var r=y(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(t,n,r){var o=0;function s(t,e,n,r){return function(){var a=this,l=arguments,u=function(){var i,u;if(!(t=o&&(n!==W&&(a=void 0,l=[i]),e.rejectWith(a,l))}};t?c():(S.Deferred.getErrorHook?c.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(c.error=S.Deferred.getStackHook()),i.setTimeout(c))}}return S.Deferred(function(i){e[0][3].add(s(0,i,y(r)?r:H,i.notifyWith)),e[1][3].add(s(0,i,y(t)?t:H)),e[2][3].add(s(0,i,y(n)?n:W))}).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,function(t,i){var s=i[2],a=i[5];r[i[1]]=s.add,a&&s.add(function(){n=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(i[3].fire),o[i[0]]=function(){return o[i[0]+"With"](this===o?void 0:this,arguments),this},o[i[0]+"With"]=s.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=a.call(arguments),o=S.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(J(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();for(;n--;)J(r[n],s(n),o.reject);return o.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&K.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){i.setTimeout(function(){throw t})};var Z=S.Deferred();function Q(){v.removeEventListener("DOMContentLoaded",Q),i.removeEventListener("load",Q),S.ready()}S.fn.ready=function(t){return Z.then(t).catch(function(t){S.readyException(t)}),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||Z.resolveWith(v,[S]))}}),S.ready.then=Z.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?i.setTimeout(S.ready):(v.addEventListener("DOMContentLoaded",Q),i.addEventListener("load",Q));var tt=function(t,e,n,i,r,o,s){var a=0,l=t.length,u=null==n;if("object"===w(n))for(a in r=!0,n)tt(t,e,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,y(i)||(s=!0),u&&(s?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(S(t),n)})),e))for(;a1,null,!0)},removeData:function(t){return this.each(function(){lt.remove(this,t)})}}),S.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=at.get(t,e),n&&(!i||Array.isArray(n)?i=at.access(t,e,S.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),i=n.length,r=n.shift(),o=S._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){S.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return at.get(t,n)||at.access(t,n,{empty:S.Callbacks("once memory").add(function(){at.remove(t,[e+"queue",n])})})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,It=/^$|^module$|\/(?:java|ecma)script/i;Et=v.createDocumentFragment().appendChild(v.createElement("div")),(kt=v.createElement("input")).setAttribute("type","radio"),kt.setAttribute("checked","checked"),kt.setAttribute("name","t"),Et.appendChild(kt),_.checkClone=Et.cloneNode(!0).cloneNode(!0).lastChild.checked,Et.innerHTML="",_.noCloneChecked=!!Et.cloneNode(!0).lastChild.defaultValue,Et.innerHTML="",_.option=!!Et.lastChild;var Nt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Mt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?S.merge([t],n):n}function Lt(t,e){for(var n=0,i=t.length;n",""]);var Ot=/<|&#?\w+;/;function Pt(t,e,n,i,r){for(var o,s,a,l,u,c,p=e.createDocumentFragment(),f=[],h=0,d=t.length;h-1)r&&r.push(o);else if(u=_t(o),s=Mt(p.appendChild(o),"script"),u&&Lt(s),n)for(c=0;o=s[c++];)It.test(o.type||"")&&n.push(o);return p}var Tt=/^([^.]*)(?:\.(.+)|)/;function At(){return!0}function Rt(){return!1}function Dt(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Dt(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Rt;else if(!r)return t;return 1===o&&(s=r,r=function(t){return S().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=S.guid++)),t.each(function(){S.event.add(this,e,r,i,n)})}function jt(t,e,n){n?(at.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var n,i=at.get(this,e);if(1&t.isTrigger&&this[e]){if(i)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=a.call(arguments),at.set(this,e,i),this[e](),n=at.get(this,e),at.set(this,e,!1),i!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else i&&(at.set(this,e,S.event.trigger(i[0],i.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=At)}})):void 0===at.get(t,e)&&S.event.add(t,e,At)}S.event={global:{},add:function(t,e,n,i,r){var o,s,a,l,u,c,p,f,h,d,g,_=at.get(t);if(ot(t))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&S.find.matchesSelector(gt,r),n.guid||(n.guid=S.guid++),(l=_.events)||(l=_.events=Object.create(null)),(s=_.handle)||(s=_.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(V)||[""]).length;u--;)h=g=(a=Tt.exec(e[u])||[])[1],d=(a[2]||"").split(".").sort(),h&&(p=S.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,p=S.event.special[h]||{},c=S.extend({type:h,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:d.join(".")},o),(f=l[h])||((f=l[h]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(t,i,d,s)||t.addEventListener&&t.addEventListener(h,s)),p.add&&(p.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),S.event.global[h]=!0)},remove:function(t,e,n,i,r){var o,s,a,l,u,c,p,f,h,d,g,_=at.hasData(t)&&at.get(t);if(_&&(l=_.events)){for(u=(e=(e||"").match(V)||[""]).length;u--;)if(h=g=(a=Tt.exec(e[u])||[])[1],d=(a[2]||"").split(".").sort(),h){for(p=S.event.special[h]||{},f=l[h=(i?p.delegateType:p.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)c=f[o],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(t,c));s&&!f.length&&(p.teardown&&!1!==p.teardown.call(t,d,_.handle)||S.removeEvent(t,h,_.handle),delete l[h])}else for(h in l)S.event.remove(t,h+e[u],n,i,!0);S.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=new Array(arguments.length),l=S.event.fix(t),u=(at.get(this,"events")||Object.create(null))[l.type]||[],c=S.event.special[l.type]||{};for(a[0]=l,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n-1:S.find(r,this,null,[u]).length),s[r]&&o.push(i);o.length&&a.push({elem:u,handlers:o})}return u=this,l\s*$/g;function Gt(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function qt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Xt(t,e){var n,i,r,o,s,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(r in at.remove(e,"handle events"),a)for(n=0,i=a[r].length;n1&&"string"==typeof d&&!_.checkClone&&zt.test(d))return t.each(function(r){var o=t.eq(r);g&&(e[0]=d.call(this,r,o.html())),$t(o,e,n,i)});if(f&&(o=(r=Pt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=S.map(Mt(r,"script"),qt)).length;p0&&Lt(s,!l&&Mt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=S.event.special,o=0;void 0!==(n=t[o]);o++)if(ot(n)){if(e=n[at.expando]){if(e.events)for(i in e.events)r[i]?S.event.remove(n,i):S.removeEvent(n,i,e.handle);n[at.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,function(t){return void 0===t?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return $t(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Gt(this,t).appendChild(t)})},prepend:function(){return $t(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Gt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return $t(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return $t(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Mt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return S.clone(this,t,e)})},html:function(t){return tt(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ft.test(t)&&!Nt[(Ct.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l+u}function ce(t,e,n){var i=Jt(t),r=(!_.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,i),o=r,s=Qt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Ht.test(s)){if(!n)return s;s="auto"}return(!_.boxSizingReliable()&&r||!_.reliableTrDimensions()&&I(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===S.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,i),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ue(t,e,n||(r?"border":"content"),o,i,s)+"px"}function pe(t,e,n,i,r){return new pe.prototype.init(t,e,n,i,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=rt(e),l=Wt.test(e),u=t.style;if(l||(e=re(a)),s=S.cssHooks[e]||S.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:u[e];"string"===(o=typeof n)&&(r=ht.exec(n))&&r[1]&&(n=vt(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(S.cssNumber[a]?"":"px")),_.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,i){var r,o,s,a=rt(e);return Wt.test(e)||(e=re(a)),(s=S.cssHooks[e]||S.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=Qt(t,e,i)),"normal"===r&&e in ae&&(r=ae[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),S.each(["height","width"],function(t,e){S.cssHooks[e]={get:function(t,n,i){if(n)return!oe.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ce(t,e,i):Kt(t,se,function(){return ce(t,e,i)})},set:function(t,n,i){var r,o=Jt(t),s=!_.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===S.css(t,"boxSizing",!1,o),l=i?ue(t,e,i,a,o):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ue(t,e,"border",!1,o)-.5)),l&&(r=ht.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),le(0,n,l)}}}),S.cssHooks.marginLeft=te(_.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Qt(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(t,e){S.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+dt[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=le)}),S.fn.extend({css:function(t,e){return tt(this,function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Jt(t),r=e.length;s1)}}),S.Tween=pe,pe.prototype={constructor:pe,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=pe.propHooks[this.prop];return t&&t.get?t.get(this):pe.propHooks._default.get(this)},run:function(t){var e,n=pe.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):pe.propHooks._default.set(this),this}},pe.prototype.init.prototype=pe.prototype,pe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[re(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},pe.propHooks.scrollTop=pe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=pe.prototype.init,S.fx.step={};var fe,he,de=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function _e(){he&&(!1===v.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(_e):i.setTimeout(_e,S.fx.interval),S.fx.tick())}function ye(){return i.setTimeout(function(){fe=void 0}),fe=Date.now()}function me(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=dt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function ve(t,e,n){for(var i,r=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,s=r.length;o1)},removeAttr:function(t){return this.each(function(){S.removeAttr(this,t)})}}),S.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?xe:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=S.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!_.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(V);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),xe={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(t,e){var n=we[e]||S.find.attr;we[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=we[s],we[s]=r,r=null!=n(t,e,i)?s:null,we[s]=o),r}});var Ee=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Se(t){return(t.match(V)||[]).join(" ")}function Ce(t){return t.getAttribute&&t.getAttribute("class")||""}function Ie(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[S.propFix[t]||t]})}}),S.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):Ee.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),_.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,i,r,o,s;return y(t)?this.each(function(e){S(this).addClass(t.call(this,e,Ce(this)))}):(e=Ie(t)).length?this.each(function(){if(i=Ce(this),n=1===this.nodeType&&" "+Se(i)+" "){for(o=0;o-1;)n=n.replace(" "+r+" "," ");s=Se(n),i!==s&&this.setAttribute("class",s)}}):this:this.attr("class","")},toggleClass:function(t,e){var n,i,r,o,s=typeof t,a="string"===s||Array.isArray(t);return y(t)?this.each(function(n){S(this).toggleClass(t.call(this,n,Ce(this),e),e)}):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=Ie(t),this.each(function(){if(a)for(o=S(this),r=0;r-1)return!0;return!1}});var Ne=/\r/g;S.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=y(t),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,function(t){return null==t?"":t+""})),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(Ne,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},_.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Me=i.location,Le={guid:Date.now()},Oe=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(t){return t.textContent}).join("\n"):t)),e};var Pe=/^(?:focusinfocus|focusoutblur)$/,Te=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,r){var o,s,a,l,u,c,p,f,d=[n||v],g=h.call(t,"type")?t.type:t,_=h.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=n=n||v,3!==n.nodeType&&8!==n.nodeType&&!Pe.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(_=g.split("."),g=_.shift(),_.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[S.expando]?t:new S.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=_.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),p=S.event.special[g]||{},r||!p.trigger||!1!==p.trigger.apply(n,e))){if(!r&&!p.noBubble&&!m(n)){for(l=p.delegateType||g,Pe.test(l+g)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(n.ownerDocument||v)&&d.push(a.defaultView||a.parentWindow||i)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:p.bindType||g,(c=(at.get(s,"events")||Object.create(null))[t.type]&&at.get(s,"handle"))&&c.apply(s,e),(c=u&&s[u])&&c.apply&&ot(s)&&(t.result=c.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),e)||!ot(n)||u&&y(n[g])&&!m(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=g,t.isPropagationStopped()&&f.addEventListener(g,Te),n[g](),t.isPropagationStopped()&&f.removeEventListener(g,Te),S.event.triggered=void 0,a&&(n[u]=a)),t.result}},simulate:function(t,e,n){var i=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(i,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each(function(){S.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}});var Ae=/\[\]$/,Re=/\r?\n/g,De=/^(?:submit|button|image|reset|file)$/i,je=/^(?:input|select|textarea|keygen)/i;function Fe(t,e,n,i){var r;if(Array.isArray(e))S.each(e,function(e,r){n||Ae.test(t)?i(t,r):Fe(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)});else if(n||"object"!==w(e))i(t,e);else for(r in e)Fe(t+"["+r+"]",e[r],n,i)}S.param=function(t,e){var n,i=[],r=function(t,e){var n=y(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,function(){r(this.name,this.value)});else for(n in t)Fe(n,t[n],e,r);return i.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&je.test(this.nodeName)&&!De.test(t)&&(this.checked||!St.test(t))}).map(function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(t){return{name:e.name,value:t.replace(Re,"\r\n")}}):{name:e.name,value:n.replace(Re,"\r\n")}}).get()}});var ze=/%20/g,Be=/#.*$/,Ge=/([?&])_=[^&]*/,qe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Xe=/^\/\//,Ye={},$e={},Ve="*/".concat("*"),He=v.createElement("a");function We(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(V)||[];if(y(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Je(t,e,n,i){var r={},o=t===$e;function s(a){var l;return r[a]=!0,S.each(t[a]||[],function(t,a){var u=a(e,n,i);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),s(u),!1)}),l}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Ke(t,e){var n,i,r=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&S.extend(!0,t,i),t}He.href=Me.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Me.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Me.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ke(Ke(t,S.ajaxSettings),e):Ke(S.ajaxSettings,t)},ajaxPrefilter:We(Ye),ajaxTransport:We($e),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,o,s,a,l,u,c,p,f,h=S.ajaxSetup({},e),d=h.context||h,g=h.context&&(d.nodeType||d.jquery)?S(d):S.event,_=S.Deferred(),y=S.Callbacks("once memory"),m=h.statusCode||{},b={},x={},w="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=qe.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)E.always(t[E.status]);else for(e in t)m[e]=[m[e],t[e]];return this},abort:function(t){var e=t||w;return n&&n.abort(e),k(0,e),this}};if(_.promise(E),h.url=((t||h.url||Me.href)+"").replace(Xe,Me.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(V)||[""],null==h.crossDomain){l=v.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=He.protocol+"//"+He.host!=l.protocol+"//"+l.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=S.param(h.data,h.traditional)),Je(Ye,h,e,E),u)return E;for(p in(c=S.event&&h.global)&&0===S.active++&&S.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ue.test(h.type),r=h.url.replace(Be,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(ze,"+")):(f=h.url.slice(r.length),h.data&&(h.processData||"string"==typeof h.data)&&(r+=(Oe.test(r)?"&":"?")+h.data,delete h.data),!1===h.cache&&(r=r.replace(Ge,"$1"),f=(Oe.test(r)?"&":"?")+"_="+Le.guid+++f),h.url=r+f),h.ifModified&&(S.lastModified[r]&&E.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&E.setRequestHeader("If-None-Match",S.etag[r])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ve+"; q=0.01":""):h.accepts["*"]),h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(d,E,h)||u))return E.abort();if(w="abort",y.add(h.complete),E.done(h.success),E.fail(h.error),n=Je($e,h,e,E)){if(E.readyState=1,c&&g.trigger("ajaxSend",[E,h]),u)return E;h.async&&h.timeout>0&&(a=i.setTimeout(function(){E.abort("timeout")},h.timeout));try{u=!1,n.send(b,k)}catch(t){if(u)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,s,l){var p,f,v,b,x,w=e;u||(u=!0,a&&i.clearTimeout(a),n=void 0,o=l||"",E.readyState=t>0?4:0,p=t>=200&&t<300||304===t,s&&(b=function(t,e,n){for(var i,r,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(h,E,s)),!p&&S.inArray("script",h.dataTypes)>-1&&S.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),b=function(t,e,n,i){var r,o,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=u[l+" "+o]||u["* "+o]))for(r in u)if((a=r.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[r]:!0!==u[r]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(h,b,E,p),p?(h.ifModified&&((x=E.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=x),(x=E.getResponseHeader("etag"))&&(S.etag[r]=x)),204===t||"HEAD"===h.type?w="nocontent":304===t?w="notmodified":(w=b.state,f=b.data,p=!(v=b.error))):(v=w,!t&&w||(w="error",t<0&&(t=0))),E.status=t,E.statusText=(e||w)+"",p?_.resolveWith(d,[f,w,E]):_.rejectWith(d,[E,w,v]),E.statusCode(m),m=void 0,c&&g.trigger(p?"ajaxSuccess":"ajaxError",[E,h,p?f:v]),y.fireWith(d,[E,w]),c&&(g.trigger("ajaxComplete",[E,h]),--S.active||S.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],function(t,e){S[e]=function(t,n,i,r){return y(n)&&(r=r||i,i=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:n,success:i},S.isPlainObject(t)&&t))}}),S.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(y(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return y(t)?this.each(function(e){S(this).wrapInner(t.call(this,e))}):this.each(function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=y(t);return this.each(function(n){S(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},Qe=S.ajaxSettings.xhr();_.cors=!!Qe&&"withCredentials"in Qe,_.ajax=Qe=!!Qe,S.ajaxTransport(function(t){var e,n;if(_.cors||Qe&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout(function(){e&&n()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),S.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),S.ajaxTransport("script",function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=S("