@esri/solutions-components 0.5.10 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/data/images/onboarding.png +0 -0
- package/dist/cjs/buffer-tools_4.cjs.entry.js +16 -2
- package/dist/cjs/public-notification.cjs.entry.js +16 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.css +1 -1
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +15 -1
- package/dist/collection/components/public-notification/public-notification.css +210 -203
- package/dist/collection/components/public-notification/public-notification.js +16 -1
- package/dist/collection/demos/new-public-notification.html +2 -2
- package/dist/components/map-draw-tools2.js +16 -2
- package/dist/components/public-notification.js +17 -3
- package/dist/esm/buffer-tools_4.entry.js +16 -2
- package/dist/esm/public-notification.entry.js +17 -3
- package/dist/solutions-components/demos/new-public-notification.html +2 -2
- package/dist/solutions-components/p-f3fbc327.entry.js +6 -0
- package/dist/solutions-components/{p-52b747fa.entry.js → p-f516f183.entry.js} +2 -2
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/map-draw-tools/map-draw-tools.d.ts +6 -0
- package/dist/types/components/public-notification/public-notification.d.ts +11 -0
- package/package.json +2 -2
- package/dist/solutions-components/p-cf00a2ef.entry.js +0 -6
@@ -12,7 +12,7 @@ import { d as defineCustomElement$3 } from './action.js';
|
|
12
12
|
import { d as defineCustomElement$2 } from './icon.js';
|
13
13
|
import { d as defineCustomElement$1 } from './loader.js';
|
14
14
|
|
15
|
-
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-
|
15
|
+
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__tool-section:first-of-type{display:none}";
|
16
16
|
|
17
17
|
const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
18
18
|
constructor() {
|
@@ -185,6 +185,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
185
185
|
}
|
186
186
|
};
|
187
187
|
this._sketchWidget = new this.Sketch(Object.assign(Object.assign({}, sketchOptions), { container: this._sketchElement, creationMode: "single", visibleElements: {
|
188
|
+
duplicateButton: false,
|
188
189
|
selectionTools: {
|
189
190
|
"lasso-selection": false,
|
190
191
|
"rectangle-selection": false
|
@@ -193,7 +194,8 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
193
194
|
},
|
194
195
|
undoRedoMenu: false,
|
195
196
|
settingsMenu: this.drawMode === EDrawMode.SKETCH
|
196
|
-
}
|
197
|
+
} // temp workaround since we need duplicateButton flag that is not in 4.26 types but will be in the 4.27 modules we get from IA
|
198
|
+
}));
|
197
199
|
this._sketchViewModel = new this.SketchViewModel(Object.assign({}, sketchOptions));
|
198
200
|
this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol;
|
199
201
|
this._sketchWidget.viewModel.pointSymbol = this.pointSymbol;
|
@@ -226,6 +228,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
226
228
|
});
|
227
229
|
this._sketchWidget.on("delete", () => {
|
228
230
|
this.graphics = [];
|
231
|
+
this._setDefaultCreateTool();
|
229
232
|
this.sketchGraphicsChange.emit({
|
230
233
|
graphics: this.graphics,
|
231
234
|
useOIDs: false
|
@@ -245,6 +248,7 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
245
248
|
useOIDs: false
|
246
249
|
});
|
247
250
|
});
|
251
|
+
this._setDefaultCreateTool();
|
248
252
|
}
|
249
253
|
/**
|
250
254
|
* Clear any stored graphics and remove all graphics from the graphics layer
|
@@ -257,6 +261,16 @@ const MapDrawTools = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
257
261
|
this.graphics = [];
|
258
262
|
(_a = this._sketchGraphicsLayer) === null || _a === void 0 ? void 0 : _a.removeAll();
|
259
263
|
}
|
264
|
+
/**
|
265
|
+
* Set the default create tool when we have no existing graphics
|
266
|
+
*
|
267
|
+
* @protected
|
268
|
+
*/
|
269
|
+
_setDefaultCreateTool() {
|
270
|
+
if (!this.graphics || this.graphics.length === 0) {
|
271
|
+
this._sketchWidget.viewModel.create("rectangle");
|
272
|
+
}
|
273
|
+
}
|
260
274
|
/**
|
261
275
|
* Emit the undo event
|
262
276
|
*
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
7
7
|
import { a as EExportType, b as EPageType, c as EWorkflowType } from './interfaces.js';
|
8
8
|
import { l as loadModules } from './loadModules.js';
|
9
9
|
import { g as goToSelection, h as highlightFeatures, d as defineCustomElement$5 } from './map-layer-picker2.js';
|
@@ -48,13 +48,17 @@ import { d as defineCustomElement$4 } from './map-select-tools2.js';
|
|
48
48
|
import { d as defineCustomElement$3 } from './pdf-download2.js';
|
49
49
|
import { d as defineCustomElement$2 } from './refine-selection2.js';
|
50
50
|
|
51
|
-
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}";
|
51
|
+
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.img-container{-o-object-fit:scale-down;object-fit:scale-down;width:100%;height:100%}";
|
52
52
|
|
53
53
|
const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
54
54
|
constructor() {
|
55
55
|
super();
|
56
56
|
this.__registerHost();
|
57
57
|
this.searchConfigurationChange = createEvent(this, "searchConfigurationChange", 7);
|
58
|
+
/**
|
59
|
+
* string: The url to the onboarding image
|
60
|
+
*/
|
61
|
+
this._onboardingImageUrl = "";
|
58
62
|
/**
|
59
63
|
* number: The number of selected features
|
60
64
|
*/
|
@@ -177,6 +181,7 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
177
181
|
await this._getTranslations();
|
178
182
|
await this._initModules();
|
179
183
|
this._initSymbols();
|
184
|
+
this._onboardingImageUrl = getAssetPath(`../assets/data/images/onboarding.png`);
|
180
185
|
}
|
181
186
|
/**
|
182
187
|
* Renders the component.
|
@@ -335,7 +340,16 @@ const PublicNotification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
335
340
|
*/
|
336
341
|
_getListPage() {
|
337
342
|
const hasSets = this._hasSelections();
|
338
|
-
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (
|
343
|
+
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (this._getOnboardingImage()), h("div", { class: "display-flex padding-1" }, h("calcite-button", { onClick: () => { this._setPageType(EPageType.SELECT); }, width: "full" }, this._translations.add))));
|
344
|
+
}
|
345
|
+
/**
|
346
|
+
* Display an image to help illustrate the basic workflow of the widget
|
347
|
+
*
|
348
|
+
* @returns the image node to display
|
349
|
+
* @protected
|
350
|
+
*/
|
351
|
+
_getOnboardingImage() {
|
352
|
+
return (h("div", { class: "display-flex padding-sides-1" }, h("img", { class: "img-container", src: this._onboardingImageUrl })));
|
339
353
|
}
|
340
354
|
/**
|
341
355
|
* Create the selection sets list node for the List page
|
@@ -1122,7 +1122,7 @@ const Slider = class {
|
|
1122
1122
|
};
|
1123
1123
|
Slider.style = sliderCss;
|
1124
1124
|
|
1125
|
-
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-
|
1125
|
+
const mapDrawToolsCss = ":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir=\"rtl\"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir=\"rtl\"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:\"Avenir Next\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__tool-section:first-of-type{display:none}";
|
1126
1126
|
|
1127
1127
|
const MapDrawTools = class {
|
1128
1128
|
constructor(hostRef) {
|
@@ -1294,6 +1294,7 @@ const MapDrawTools = class {
|
|
1294
1294
|
}
|
1295
1295
|
};
|
1296
1296
|
this._sketchWidget = new this.Sketch(Object.assign(Object.assign({}, sketchOptions), { container: this._sketchElement, creationMode: "single", visibleElements: {
|
1297
|
+
duplicateButton: false,
|
1297
1298
|
selectionTools: {
|
1298
1299
|
"lasso-selection": false,
|
1299
1300
|
"rectangle-selection": false
|
@@ -1302,7 +1303,8 @@ const MapDrawTools = class {
|
|
1302
1303
|
},
|
1303
1304
|
undoRedoMenu: false,
|
1304
1305
|
settingsMenu: this.drawMode === EDrawMode.SKETCH
|
1305
|
-
}
|
1306
|
+
} // temp workaround since we need duplicateButton flag that is not in 4.26 types but will be in the 4.27 modules we get from IA
|
1307
|
+
}));
|
1306
1308
|
this._sketchViewModel = new this.SketchViewModel(Object.assign({}, sketchOptions));
|
1307
1309
|
this._sketchWidget.viewModel.polylineSymbol = this.polylineSymbol;
|
1308
1310
|
this._sketchWidget.viewModel.pointSymbol = this.pointSymbol;
|
@@ -1335,6 +1337,7 @@ const MapDrawTools = class {
|
|
1335
1337
|
});
|
1336
1338
|
this._sketchWidget.on("delete", () => {
|
1337
1339
|
this.graphics = [];
|
1340
|
+
this._setDefaultCreateTool();
|
1338
1341
|
this.sketchGraphicsChange.emit({
|
1339
1342
|
graphics: this.graphics,
|
1340
1343
|
useOIDs: false
|
@@ -1354,6 +1357,7 @@ const MapDrawTools = class {
|
|
1354
1357
|
useOIDs: false
|
1355
1358
|
});
|
1356
1359
|
});
|
1360
|
+
this._setDefaultCreateTool();
|
1357
1361
|
}
|
1358
1362
|
/**
|
1359
1363
|
* Clear any stored graphics and remove all graphics from the graphics layer
|
@@ -1366,6 +1370,16 @@ const MapDrawTools = class {
|
|
1366
1370
|
this.graphics = [];
|
1367
1371
|
(_a = this._sketchGraphicsLayer) === null || _a === void 0 ? void 0 : _a.removeAll();
|
1368
1372
|
}
|
1373
|
+
/**
|
1374
|
+
* Set the default create tool when we have no existing graphics
|
1375
|
+
*
|
1376
|
+
* @protected
|
1377
|
+
*/
|
1378
|
+
_setDefaultCreateTool() {
|
1379
|
+
if (!this.graphics || this.graphics.length === 0) {
|
1380
|
+
this._sketchWidget.viewModel.create("rectangle");
|
1381
|
+
}
|
1382
|
+
}
|
1369
1383
|
/**
|
1370
1384
|
* Emit the undo event
|
1371
1385
|
*
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-d298aca9.js';
|
6
|
+
import { r as registerInstance, c as createEvent, a as getAssetPath, h, H as Host, g as getElement } from './index-d298aca9.js';
|
7
7
|
import { a as EExportType, b as EPageType, c as EWorkflowType } from './interfaces-523c6558.js';
|
8
8
|
import { l as loadModules } from './loadModules-cd3569de.js';
|
9
9
|
import { g as goToSelection, h as highlightFeatures } from './mapViewUtils-27dfdc29.js';
|
@@ -13,12 +13,16 @@ import { c as consolidateLabels, r as removeDuplicateLabels } from './downloadUt
|
|
13
13
|
import './index-4c4a4f3d.js';
|
14
14
|
import './_commonjsHelpers-d5f9d613.js';
|
15
15
|
|
16
|
-
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}";
|
16
|
+
const publicNotificationCss = ":host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir=\"rtl\"]{float:left}.float-left{float:left}.float-left[dir=\"rtl\"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir=\"rtl\"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.img-container{-o-object-fit:scale-down;object-fit:scale-down;width:100%;height:100%}";
|
17
17
|
|
18
18
|
const PublicNotification = class {
|
19
19
|
constructor(hostRef) {
|
20
20
|
registerInstance(this, hostRef);
|
21
21
|
this.searchConfigurationChange = createEvent(this, "searchConfigurationChange", 7);
|
22
|
+
/**
|
23
|
+
* string: The url to the onboarding image
|
24
|
+
*/
|
25
|
+
this._onboardingImageUrl = "";
|
22
26
|
/**
|
23
27
|
* number: The number of selected features
|
24
28
|
*/
|
@@ -141,6 +145,7 @@ const PublicNotification = class {
|
|
141
145
|
await this._getTranslations();
|
142
146
|
await this._initModules();
|
143
147
|
this._initSymbols();
|
148
|
+
this._onboardingImageUrl = getAssetPath(`../assets/data/images/onboarding.png`);
|
144
149
|
}
|
145
150
|
/**
|
146
151
|
* Renders the component.
|
@@ -299,7 +304,16 @@ const PublicNotification = class {
|
|
299
304
|
*/
|
300
305
|
_getListPage() {
|
301
306
|
const hasSets = this._hasSelections();
|
302
|
-
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (
|
307
|
+
return (h("calcite-panel", null, this._getLabel(this._translations.myLists), this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1"), hasSets ? this._getSelectionSetList() : (this._getOnboardingImage()), h("div", { class: "display-flex padding-1" }, h("calcite-button", { onClick: () => { this._setPageType(EPageType.SELECT); }, width: "full" }, this._translations.add))));
|
308
|
+
}
|
309
|
+
/**
|
310
|
+
* Display an image to help illustrate the basic workflow of the widget
|
311
|
+
*
|
312
|
+
* @returns the image node to display
|
313
|
+
* @protected
|
314
|
+
*/
|
315
|
+
_getOnboardingImage() {
|
316
|
+
return (h("div", { class: "display-flex padding-sides-1" }, h("img", { class: "img-container", src: this._onboardingImageUrl })));
|
303
317
|
}
|
304
318
|
/**
|
305
319
|
* Create the selection sets list node for the List page
|
@@ -55,12 +55,12 @@
|
|
55
55
|
|
56
56
|
<link
|
57
57
|
rel="stylesheet"
|
58
|
-
href="https://js.arcgis.com/4.
|
58
|
+
href="https://js.arcgis.com/4.27/esri/themes/light/main.css"
|
59
59
|
/>
|
60
60
|
<link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
|
61
61
|
<link rel="stylesheet" href="../solutions-components.css" type="text/css">
|
62
62
|
|
63
|
-
<script src="https://js.arcgis.com/4.
|
63
|
+
<script src="https://js.arcgis.com/4.27/"></script>
|
64
64
|
<script type="module" src="../solutions-components.esm.js"></script>
|
65
65
|
|
66
66
|
<script>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-f8be5d5f.js";import{a as n,b as o,c as d}from"./p-92de1de9.js";import{l as c}from"./p-d7ddd3a2.js";import{g as r,h}from"./p-4b426bab.js";import{s as p}from"./p-a29ba58a.js";import{g}from"./p-fc2277fe.js";import{c as b,r as m}from"./p-345f517c.js";import"./p-4ff653eb.js";import"./p-e1a4994d.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addTitle=!1,this._downloadActive=!0,this._exportType=n.PDF,this._numDuplicates=0,this._pageType=o.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);s!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popup.autoOpenEnabled=t===o.LIST&&this._popupsEnabled),t===o.EXPORT&&(this._numDuplicates=await this._getNumDuplicates()),this._clearHighlight(),i!==o.SELECT&&i!==o.REFINE||await this._clearSelection(),t!==o.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",o.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",o.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",o.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async _initModules(){const[t,i]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_getActionGroup(t,i,s){return e("calcite-action-group",{class:"action-center"+(this.showRefineSelection?" w-1-3":" w-1-2"),layout:"horizontal"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""}),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case o.LIST:i=this._getListPage();break;case o.SELECT:i=this._getSelectPage();break;case o.EXPORT:i=this._getExportPage();break;case o.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(o.SELECT)},width:"full"},this._translations.add)))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let n=!0;return i.workflowType===d.REFINE&&(n=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),n&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==d.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===d.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==d.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t)},e("calcite-segmented-control-item",{checked:this._exportType===n.PDF,class:"w-50 end-border",value:n.PDF},this._translations.pdf),e("calcite-segmented-control-item",{checked:this._exportType===n.CSV,class:"w-50",value:n.CSV},this._translations.csv))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive,onClick:()=>{this._export()},width:"full"},this._translations.export))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none";return e("div",{class:this._exportType===n.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:"padding-sides-1"},e("pdf-download",{disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.addTitle)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",placeholder:this._translations.titlePlaceholder,ref:t=>{this._title=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,n){return e("div",null,e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},t)),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:n,width:"full"},a)))}_getNotice(t,i="padding-1"){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==d.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._downloadActive=i,this._numDuplicates=await this._getNumDuplicates(),await this._highlightFeatures()}async _export(){const t=this._getSelectionIdsAndViews(this._selectionSets,!0);if(this._exportType===n.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._downloadTools.downloadPDF(t,this._removeDuplicates.checked,this._addTitle?this._title.value:"",i)}this._exportType===n.CSV&&this._downloadTools.downloadCSV(t,this._removeDuplicates.checked)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===d.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,n=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:n,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(o.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){r(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===d.REFINE?o.REFINE:o.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===o.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];p.highlightHandles.push(await h(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popup.autoOpenEnabled)}_clearHighlight(){p&&p.highlightHandles&&p.removeHandles()}async _getTranslations(){const t=await g(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.img-container{-o-object-fit:scale-down;object-fit:scale-down;width:100%;height:100%}';export{u as public_notification}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as i,c as t,h as e,H as a,g as s}from"./p-f8be5d5f.js";import{l as n}from"./p-d7ddd3a2.js";import{g as l}from"./p-fc2277fe.js";import{e as h,g as r,i as o,k as c}from"./p-dd3d070d.js";import{g as d}from"./p-d1bcb992.js";import{c as u,d as m,a as b,H as p}from"./p-bf0c6866.js";import{u as f}from"./p-c0d3537c.js";import{i as
|
6
|
+
import{r as i,c as t,h as e,H as a,g as s}from"./p-f8be5d5f.js";import{l as n}from"./p-d7ddd3a2.js";import{g as l}from"./p-fc2277fe.js";import{e as h,g as r,i as o,k as c}from"./p-dd3d070d.js";import{g as d}from"./p-d1bcb992.js";import{c as u,d as m,a as b,H as p}from"./p-bf0c6866.js";import{u as f}from"./p-c0d3537c.js";import{i as g}from"./p-89e6a976.js";import{c as v,d as x,g as k}from"./p-24cb0a19.js";import{s as _,a as w,c as y}from"./p-5b5ad89d.js";import{n as z,c as V,d as D}from"./p-0d207a2c.js";import{d as $,c as M}from"./p-56fd542b.js";import{f as H}from"./p-92de1de9.js";import{s as I}from"./p-a29ba58a.js";import"./p-e1a4994d.js";import"./p-062f1fe7.js";import"./p-631b6461.js";import"./p-4ff653eb.js";const j=class{constructor(e){i(this,e),this.bufferComplete=t(this,"bufferComplete",7),this.distanceChanged=t(this,"distanceChanged",7),this.unitChanged=t(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this.disabled=!1,this._translations=void 0}geometriesWatchHandler(){this._buffer()}disabledWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(a,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[i]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getUnits(){const i={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(i).map((t=>e("calcite-option",{label:i[t],selected:this.unit===t,value:t})))}_setDistance(i){const t=parseInt(i.target.value,10);this.distance!==t&&t>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:t}),this.distance=t,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(i){this.unitChanged.emit({oldValue:this.unit,newValue:i}),this.unit=i,this._buffer()}_buffer(){this.disabled?this.bufferComplete.emit(void 0):(this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var i;if((null===(i=this.geometries)||void 0===i?void 0:i.length)>0&&this.unit&&this.distance>0){const i=this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(i)}}),400))}_getTextBoxDisplay(){return e("div",{class:"c-container"},e("calcite-input",{class:"padding-end-1 w-50",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:i=>this._setDistance(i),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),e("calcite-select",{class:"flex-1 w-50",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:i=>{this._unitElement=i}},this._getUnits()))}_getSliderDisplay(){return e("div",null,e("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}_testAccess(i,t){switch(i){case"_setUnit":return this._setUnit(t);case"_setDistance":return this._setDistance(t)}return null}get el(){return s(this)}static get watchers(){return{geometries:["geometriesWatchHandler"],disabled:["disabledWatchHandler"]}}};
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
@@ -15,4 +15,4 @@ var C;j.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex
|
|
15
15
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
16
16
|
* v1.2.0
|
17
17
|
*/
|
18
|
-
const S="handle__label";function T(i){return Array.isArray(i)}const F=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.activeProp="value",this.guid=`calcite-slider-${d()}`,this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(T(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{o(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return z.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},z.localize(i.toString())},this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){V(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),g(this),u(this)}disconnectedCallback(){x(this),m(this),$(this),this.removeDragListeners()}componentWillLoad(){_(this),this.tickValues=this.generateTickValues(),T(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!T(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidLoad(){w(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),T(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),f(this)}render(){const i=this.el.id||this.guid,t=T(this.value)?"maxValue":"value",s=T(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),h=this.minValue||this.min,r=this.shouldUseMinValue(),o=100*this.getUnitInterval(r?this.minValue:h),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=T(this.value),f=`${S} handle__label--minValue`,v=`${S} handle__label--value`,g=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("span",{"aria-hidden":"true",class:v},n),e("span",{"aria-hidden":"true",class:`${v} static`},n),e("span",{"aria-hidden":"true",class:`${v} transformed`},n),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:v},n),e("span",{"aria-hidden":"true",class:`${v} static`},n),e("span",{"aria-hidden":"true",class:`${v} transformed`},n)),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("span",{"aria-hidden":"true",class:v},n),e("span",{"aria-hidden":"true",class:`${v} static`},n),e("span",{"aria-hidden":"true",class:`${v} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),V=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:v},n),e("span",{"aria-hidden":"true",class:`${v} static`},n),e("span",{"aria-hidden":"true",class:`${v} transformed`},n)),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle"})),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l)),H=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),I=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{"aria-label":k(this),class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=h&&i<=s;return r&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&$,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&D,this.precise&&!this.labelHandles&&b&&H,this.precise&&this.labelHandles&&b&&I,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&g,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&w,this.hasHistogram&&this.precise&&!this.labelHandles&&y,!this.hasHistogram&&this.precise&&this.labelHandles&&z,this.hasHistogram&&!this.precise&&this.labelHandles&&_,this.hasHistogram&&this.precise&&this.labelHandles&&V,e(p,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:T(this.value)?this.maxValue:this.value,highlightMin:T(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=T(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,h=this[e],{key:r}=i;if(v(r))return void i.preventDefault();let o;if("ArrowUp"===r||"ArrowRight"===r?o=h+l*(t&&"ArrowRight"===r?-1:1):"ArrowDown"===r||"ArrowLeft"===r?o=h-l*(t&&"ArrowLeft"===r?-1:1):"PageUp"===r?n&&(o=h+n):"PageDown"===r?n&&(o=h-n):"Home"===r?o=s:"End"===r&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed(D(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!o(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";T(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){await y(this);const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;T(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!T(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){o(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=M(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let h=Number(l.toFixed(D(this.step)));return this.snap&&this.step&&(h=this.getClosestStep(h)),h}getClosestStep(i){if(i=Number(this.clamp(i).toFixed(D(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed(D(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),h=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),r=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===h){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,r.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(h>0||d>0)s.style.transform=`translateX(${h+p}px)`,r.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(h<0||d<0){let i=Math.abs(h)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${h}px)`,l.style.transform=`translateX(${h}px)`,r.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=T(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return c(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return c(e,a)}static get delegatesFocus(){return!0}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};F.style='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}';const L=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.drawUndo=t(this,"drawUndo",7),this.drawRedo=t(this,"drawRedo",7),this.active=!1,this.drawMode=H.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){const i=this.drawMode===H.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return e(a,null,e("div",{class:this.drawMode===H.SKETCH?"border":"border esri-widget esri-sketch__panel"},e("div",{ref:i=>{this._sketchElement=i}}),e("div",{class:i},e("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[i,t,e]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.Sketch=t,this.SketchViewModel=e}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),I.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const i={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},i),{container:this._sketchElement,creationMode:"single",visibleElements:{selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===H.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},i)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol,this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))})),this._sketchWidget.on("update",(i=>{var t;if(this.editGraphicsEnabled){const e=null===(t=null==i?void 0:i.toolEventInfo)||void 0===t?void 0:t.type;"reshape-stop"!==e&&"move-stop"!==e||(this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){var i;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(i=this._sketchGraphicsLayer)||void 0===i||i.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};L.style=':host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__info-section>calcite-action:first-of-type{display:none}';export{j as buffer_tools,O as calcite_input_message,F as calcite_slider,L as map_draw_tools}
|
18
|
+
const S="handle__label";function T(i){return Array.isArray(i)}const F=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.activeProp="value",this.guid=`calcite-slider-${d()}`,this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(T(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{o(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return z.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},z.localize(i.toString())},this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){V(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),v(this),u(this)}disconnectedCallback(){x(this),m(this),D(this),this.removeDragListeners()}componentWillLoad(){_(this),this.tickValues=this.generateTickValues(),T(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!T(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidLoad(){w(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),T(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),f(this)}render(){const i=this.el.id||this.guid,t=T(this.value)?"maxValue":"value",s=T(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),h=this.minValue||this.min,r=this.shouldUseMinValue(),o=100*this.getUnitInterval(r?this.minValue:h),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=T(this.value),f=`${S} handle__label--minValue`,g=`${S} handle__label--value`,v=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),V=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),role:"slider",style:{right:m},tabIndex:0,ref:i=>this.maxHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle"})),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l)),H=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),I=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:i=>this.minHandle=i},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:f},l),e("span",{"aria-hidden":"true",class:`${f} static`},l),e("span",{"aria-hidden":"true",class:`${f} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{"aria-label":k(this),class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=h&&i<=s;return r&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&D,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&$,this.precise&&!this.labelHandles&&b&&H,this.precise&&this.labelHandles&&b&&I,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&w,this.hasHistogram&&this.precise&&!this.labelHandles&&y,!this.hasHistogram&&this.precise&&this.labelHandles&&z,this.hasHistogram&&!this.precise&&this.labelHandles&&_,this.hasHistogram&&this.precise&&this.labelHandles&&V,e(p,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:T(this.value)?this.maxValue:this.value,highlightMin:T(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=T(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,h=this[e],{key:r}=i;if(g(r))return void i.preventDefault();let o;if("ArrowUp"===r||"ArrowRight"===r?o=h+l*(t&&"ArrowRight"===r?-1:1):"ArrowDown"===r||"ArrowLeft"===r?o=h-l*(t&&"ArrowLeft"===r?-1:1):"PageUp"===r?n&&(o=h+n):"PageDown"===r?n&&(o=h-n):"Home"===r?o=s:"End"===r&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed($(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!o(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";T(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){await y(this);const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;T(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!T(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){o(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=M(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let h=Number(l.toFixed($(this.step)));return this.snap&&this.step&&(h=this.getClosestStep(h)),h}getClosestStep(i){if(i=Number(this.clamp(i).toFixed($(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed($(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),h=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),r=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===h){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,r.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(h>0||d>0)s.style.transform=`translateX(${h+p}px)`,r.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(h<0||d<0){let i=Math.abs(h)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${h}px)`,l.style.transform=`translateX(${h}px)`,r.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=T(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return c(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return c(e,a)}static get delegatesFocus(){return!0}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};F.style='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}';const L=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.drawUndo=t(this,"drawUndo",7),this.drawRedo=t(this,"drawRedo",7),this.active=!1,this.drawMode=H.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){const i=this.drawMode===H.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return e(a,null,e("div",{class:this.drawMode===H.SKETCH?"border":"border esri-widget esri-sketch__panel"},e("div",{ref:i=>{this._sketchElement=i}}),e("div",{class:i},e("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[i,t,e]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.Sketch=t,this.SketchViewModel=e}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),I.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const i={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},i),{container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===H.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},i)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol,this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))})),this._sketchWidget.on("update",(i=>{var t;if(this.editGraphicsEnabled){const e=null===(t=null==i?void 0:i.toolEventInfo)||void 0===t?void 0:t.type;"reshape-stop"!==e&&"move-stop"!==e||(this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this._setDefaultCreateTool(),this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._setDefaultCreateTool()}_clearSketch(){var i;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(i=this._sketchGraphicsLayer)||void 0===i||i.removeAll()}_setDefaultCreateTool(){this.graphics&&0!==this.graphics.length||this._sketchWidget.viewModel.create("rectangle")}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};L.style=':host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}.esri-sketch__section.esri-sketch__tool-section:first-of-type{display:none}';export{j as buffer_tools,O as calcite_input_message,F as calcite_slider,L as map_draw_tools}
|