@esri/solutions-components 0.8.61 → 0.8.62
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -2
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +33 -24
- package/dist/cjs/{downloadUtils-f4b01945.js → downloadUtils-85009d64.js} +5 -2
- package/dist/cjs/feature-list.cjs.entry.js +2 -2
- package/dist/cjs/{index.es-08ff626f.js → index.es-cc49d45d.js} +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/{popupUtils-64405c62.js → popupUtils-fe880b9e.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
- package/dist/cjs/{solution-store-d9f3ea44.js → solution-store-4e35404b.js} +10 -0
- package/dist/cjs/store-manager.cjs.entry.js +1 -1
- package/dist/collection/components/layer-table/layer-table.js +32 -23
- package/dist/collection/utils/downloadUtils.js +4 -1
- package/dist/collection/utils/downloadUtils.ts +4 -1
- package/dist/components/downloadUtils.js +4 -1
- package/dist/components/layer-table2.js +32 -23
- package/dist/components/solution-store.js +10 -0
- package/dist/esm/calcite-alert_4.entry.js +2 -2
- package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +33 -24
- package/dist/esm/{downloadUtils-408e0384.js → downloadUtils-f2c49e23.js} +5 -2
- package/dist/esm/feature-list.entry.js +2 -2
- package/dist/esm/{index.es-cac1405b.js → index.es-680dba03.js} +1 -1
- package/dist/esm/map-select-tools_3.entry.js +1 -1
- package/dist/esm/{popupUtils-142f616a.js → popupUtils-21b9dbe5.js} +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +1 -1
- package/dist/esm/solution-contents_3.entry.js +1 -1
- package/dist/esm/{solution-store-1c36ce1d.js → solution-store-840c5489.js} +10 -0
- package/dist/esm/store-manager.entry.js +1 -1
- package/dist/solutions-components/{p-7b9207e4.entry.js → p-1412173c.entry.js} +1 -1
- package/dist/solutions-components/{p-54562381.entry.js → p-14900698.entry.js} +1 -1
- package/dist/solutions-components/{p-67c3ac62.js → p-17946a3f.js} +2 -2
- package/dist/solutions-components/{p-120a2091.entry.js → p-1d285ae1.entry.js} +1 -1
- package/dist/solutions-components/{p-d783ae9a.entry.js → p-2a8b04de.entry.js} +1 -1
- package/dist/solutions-components/{p-742b5af7.js → p-2fb21ae5.js} +1 -1
- package/dist/solutions-components/{p-90864588.entry.js → p-42c2d9d8.entry.js} +1 -1
- package/dist/solutions-components/{p-faed40ad.entry.js → p-72347474.entry.js} +1 -1
- package/dist/solutions-components/{p-fea7535c.js → p-75cb415f.js} +1 -1
- package/dist/solutions-components/{p-057f9296.entry.js → p-8100a48d.entry.js} +1 -1
- package/dist/solutions-components/{p-6f4a40fa.entry.js → p-bf0bb8c2.entry.js} +1 -1
- package/dist/solutions-components/{p-2afdcdfc.js → p-c1936856.js} +1 -1
- package/dist/solutions-components/p-cd8d6e52.entry.js +6 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/downloadUtils.ts +4 -1
- package/dist/types/components/layer-table/layer-table.d.ts +8 -0
- package/package.json +6 -6
- package/dist/solutions-components/p-03b07165.entry.js +0 -6
@@ -13,7 +13,7 @@ import { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as
|
|
13
13
|
import { K as KindIcons } from './resources-ae36eaff.js';
|
14
14
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-4adfc8cf.js';
|
15
15
|
import { a as getAllLayers } from './mapViewUtils-e3de60cc.js';
|
16
|
-
import { P as PopupUtils } from './popupUtils-
|
16
|
+
import { P as PopupUtils } from './popupUtils-21b9dbe5.js';
|
17
17
|
import './guid-f05d01d5.js';
|
18
18
|
import './resources-1febf4c6.js';
|
19
19
|
import './key-092b6260.js';
|
@@ -21,7 +21,7 @@ import './observers-fcb1c07b.js';
|
|
21
21
|
import './esri-loader-c6842c6b.js';
|
22
22
|
import './_commonjsHelpers-089957fe.js';
|
23
23
|
import './interfaces-586e863c.js';
|
24
|
-
import './downloadUtils-
|
24
|
+
import './downloadUtils-f2c49e23.js';
|
25
25
|
import './solution-resource-3108caf7.js';
|
26
26
|
import './index-a1e91462.js';
|
27
27
|
import './restHelpersGet-5c822bcd.js';
|
@@ -21,7 +21,7 @@ import { d as dragActive, a as disconnectSortableComponent, c as connectSortable
|
|
21
21
|
import { C as CSS$5, S as SLOTS$3 } from './resources-dd68a4aa.js';
|
22
22
|
import { I as ICON_TYPES$1 } from './resources-e4b779b0.js';
|
23
23
|
import { g as getLocaleComponentStrings } from './locale-4adfc8cf.js';
|
24
|
-
import { s as state } from './solution-store-
|
24
|
+
import { s as state } from './solution-store-840c5489.js';
|
25
25
|
import { d as EUpdateType } from './interfaces-586e863c.js';
|
26
26
|
import { E as EFileType } from './solution-resource-3108caf7.js';
|
27
27
|
import './index-a1e91462.js';
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-83b693bc.js';
|
7
7
|
import { g as getLocaleComponentStrings, l as loadModules } from './locale-4adfc8cf.js';
|
8
8
|
import { q as queryFeaturesByID, g as getLayerOrTable, e as goToSelection, f as queryAllIds, i as queryAllOidsWithQueryFeatures, j as queryFeaturesByGlobalID, c as getFeatureLayerView } from './mapViewUtils-e3de60cc.js';
|
9
|
-
import { d as downloadCSV } from './downloadUtils-
|
9
|
+
import { d as downloadCSV } from './downloadUtils-f2c49e23.js';
|
10
10
|
import './esri-loader-c6842c6b.js';
|
11
11
|
import './_commonjsHelpers-089957fe.js';
|
12
12
|
import './interfaces-586e863c.js';
|
@@ -126,6 +126,10 @@ const LayerTable = class {
|
|
126
126
|
* boolean: When true the default OID provided via url param has been honored and should now be ignored
|
127
127
|
*/
|
128
128
|
this._defaultOidHonored = false;
|
129
|
+
/**
|
130
|
+
* boolean: When true the table has been successfully loaded
|
131
|
+
*/
|
132
|
+
this._loaded = false;
|
129
133
|
/**
|
130
134
|
* boolean: When true the observer has been set and we don't need to set it again
|
131
135
|
*/
|
@@ -411,7 +415,7 @@ const LayerTable = class {
|
|
411
415
|
const selected = this.selectedIds.length.toString();
|
412
416
|
const tableHeightClass = this.isMobile ? "height-full" : "height-full-adjusted";
|
413
417
|
this._validateActiveActions();
|
414
|
-
return (h(Host, { key: '
|
418
|
+
return (h(Host, { key: '9707f29bc69d0b56ae548b8004af6a0872105a40' }, h("calcite-shell", { key: 'e44e4b3dc934efec9698f6a9a24c21a1e1755e34' }, this._getTableControlRow("header"), h("div", { key: '88e82fe17e8f6c2bf01f0353c30992c108c6b9f1', class: `width-full ${tableHeightClass}` }, h("calcite-panel", { key: '463130e64abde593fafa0333daf6dabec116a33a', class: "height-full width-full" }, h("calcite-loader", { key: '2aa6e9a0ebf5508253adfb5a6d71340e7de01df2', class: loadingClass, label: this._translations.fetchingData, scale: "l" }), h("div", { key: '0d50f1bed585ab19a31d6875fab1f0fbdbc957d3', class: tableNodeClass, ref: this.onTableNodeCreate })), !this.isMobile ? (h("div", { class: "bottom-left text-color height-19" }, this._translations.recordsSelected
|
415
419
|
.replace("{{total}}", total)
|
416
420
|
.replace("{{selected}}", selected))) : undefined)), this._filterModal()));
|
417
421
|
}
|
@@ -1075,16 +1079,11 @@ const LayerTable = class {
|
|
1075
1079
|
*/
|
1076
1080
|
_resetColumnTemplates() {
|
1077
1081
|
var _a, _b;
|
1078
|
-
console.log("_resetColumnTemplates");
|
1079
1082
|
const columnTemplates = this._getColumnTemplates((_a = this._layer) === null || _a === void 0 ? void 0 : _a.id, (_b = this._layer) === null || _b === void 0 ? void 0 : _b.fields);
|
1080
1083
|
const hasChange = columnTemplates === null || columnTemplates === void 0 ? void 0 : columnTemplates.some((ct, i) => {
|
1081
1084
|
var _a;
|
1082
1085
|
return JSON.stringify((_a = this._table) === null || _a === void 0 ? void 0 : _a.tableTemplate.columnTemplates[i]) !== JSON.stringify(ct);
|
1083
1086
|
});
|
1084
|
-
console.log(this._table);
|
1085
|
-
console.log(columnTemplates);
|
1086
|
-
console.log(hasChange);
|
1087
|
-
console.log(!this._columnsInfo);
|
1088
1087
|
if (this._table && columnTemplates && (hasChange || !this._columnsInfo)) {
|
1089
1088
|
this._table.tableTemplate = new this.TableTemplate({
|
1090
1089
|
columnTemplates
|
@@ -1098,9 +1097,7 @@ const LayerTable = class {
|
|
1098
1097
|
*/
|
1099
1098
|
async _resetTable() {
|
1100
1099
|
var _a;
|
1101
|
-
|
1102
|
-
console.log(this._table);
|
1103
|
-
console.log(this._layer);
|
1100
|
+
this._loaded = false;
|
1104
1101
|
this._clearSelection();
|
1105
1102
|
this._allIds = await queryAllIds(this._layer);
|
1106
1103
|
if (!this._table) {
|
@@ -1115,10 +1112,26 @@ const LayerTable = class {
|
|
1115
1112
|
this._checkEditEnabled();
|
1116
1113
|
this._table.editingEnabled = this._editEnabled && this.enableInlineEdit;
|
1117
1114
|
await this._table.when();
|
1118
|
-
|
1115
|
+
// This is a workaround.
|
1116
|
+
// In some cases the first time the app is loaded this._table.state === "loaded" is not being hit.
|
1117
|
+
// When this issue occurs we will wait for 1 second and attempt to finish the loading process
|
1118
|
+
setTimeout(() => {
|
1119
|
+
if (!this._loaded) {
|
1120
|
+
console.log(`table.state: ${this._table.state}`);
|
1121
|
+
void this.finishLoading();
|
1122
|
+
}
|
1123
|
+
}, 1000);
|
1119
1124
|
await this.reactiveUtils.once(() => this._table.state === "loaded")
|
1120
1125
|
.then(async () => {
|
1121
|
-
|
1126
|
+
await this.finishLoading();
|
1127
|
+
});
|
1128
|
+
}
|
1129
|
+
/**
|
1130
|
+
* Finish the table loading tasks
|
1131
|
+
*/
|
1132
|
+
async finishLoading() {
|
1133
|
+
try {
|
1134
|
+
this._loaded = true;
|
1122
1135
|
this._table.highlightIds.removeAll();
|
1123
1136
|
this._table.clearSelectionFilter();
|
1124
1137
|
this._resetColumnTemplates();
|
@@ -1127,7 +1140,10 @@ const LayerTable = class {
|
|
1127
1140
|
await this._sortTable();
|
1128
1141
|
this._initToolInfos();
|
1129
1142
|
this._updateToolbar();
|
1130
|
-
}
|
1143
|
+
}
|
1144
|
+
catch (e) {
|
1145
|
+
console.log(e);
|
1146
|
+
}
|
1131
1147
|
}
|
1132
1148
|
/**
|
1133
1149
|
* Update the current IDs when that layers data is modified
|
@@ -1222,23 +1238,18 @@ const LayerTable = class {
|
|
1222
1238
|
* Sort the table with the configured field and the sort order
|
1223
1239
|
*/
|
1224
1240
|
async _sortTable() {
|
1225
|
-
var _a, _b, _c, _d, _e, _f
|
1226
|
-
console.log("_sortTable");
|
1227
|
-
console.log(this._table);
|
1228
|
-
console.log(this._layer);
|
1229
|
-
console.log((_b = (_a = this.mapInfo) === null || _a === void 0 ? void 0 : _a.layerOptions) === null || _b === void 0 ? void 0 : _b.layers);
|
1230
|
-
console.log((_d = (_c = this.mapInfo) === null || _c === void 0 ? void 0 : _c.layerOptions) === null || _d === void 0 ? void 0 : _d.layers);
|
1241
|
+
var _a, _b, _c, _d, _e, _f;
|
1231
1242
|
//By default sort the table using objectIdField and in descending order
|
1232
|
-
let sortField = (
|
1243
|
+
let sortField = (_a = this._layer) === null || _a === void 0 ? void 0 : _a.objectIdField;
|
1233
1244
|
let sortOrder = 'desc';
|
1234
1245
|
let configuredLayer;
|
1235
1246
|
//get the sortField and sortOrder from the configuration
|
1236
|
-
if (((
|
1247
|
+
if (((_d = (_c = (_b = this.mapInfo) === null || _b === void 0 ? void 0 : _b.layerOptions) === null || _c === void 0 ? void 0 : _c.layers) === null || _d === void 0 ? void 0 : _d.length) > 0 && ((_e = this._layer) === null || _e === void 0 ? void 0 : _e.id)) {
|
1237
1248
|
configuredLayer = this.mapInfo.layerOptions.layers.filter((layer) => layer.id === this._layer.id);
|
1238
1249
|
if (configuredLayer && configuredLayer.length > 0) {
|
1239
1250
|
configuredLayer = configuredLayer[0];
|
1240
1251
|
//if sort field is defined and sortField is available in the fields then use it
|
1241
|
-
if (configuredLayer.sortField && ((
|
1252
|
+
if (configuredLayer.sortField && ((_f = configuredLayer.fields) === null || _f === void 0 ? void 0 : _f.includes(configuredLayer.sortField))) {
|
1242
1253
|
sortField = configuredLayer.sortField;
|
1243
1254
|
}
|
1244
1255
|
//use sort order if configured
|
@@ -1246,10 +1257,8 @@ const LayerTable = class {
|
|
1246
1257
|
}
|
1247
1258
|
}
|
1248
1259
|
if (this._table && this._layer) {
|
1249
|
-
console.log("has layer and has table");
|
1250
1260
|
await this._table.when();
|
1251
1261
|
await this._layer.when(() => {
|
1252
|
-
console.log("sort on this._layer.when");
|
1253
1262
|
this._table.sortColumn(sortField, sortOrder);
|
1254
1263
|
});
|
1255
1264
|
}
|
@@ -1510,7 +1510,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
|
|
1510
1510
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1511
1511
|
* ====================================================================
|
1512
1512
|
*/
|
1513
|
-
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-
|
1513
|
+
function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-680dba03.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
1514
1514
|
/** ====================================================================
|
1515
1515
|
* @license
|
1516
1516
|
* jsPDF XMP metadata plugin
|
@@ -2935,7 +2935,10 @@ function _prepareAttributeValue(attributeValue, attributeType, attributeDomain,
|
|
2935
2935
|
value = intl.formatNumber(value, numberFormatIntlOptions);
|
2936
2936
|
}
|
2937
2937
|
else {
|
2938
|
-
value = intl.formatNumber(value
|
2938
|
+
value = intl.formatNumber(value, {
|
2939
|
+
maximumFractionDigits: 100,
|
2940
|
+
maximumSignificantDigits: 21
|
2941
|
+
});
|
2939
2942
|
}
|
2940
2943
|
break;
|
2941
2944
|
}
|
@@ -5,11 +5,11 @@
|
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-83b693bc.js';
|
7
7
|
import { l as loadModules, g as getLocaleComponentStrings } from './locale-4adfc8cf.js';
|
8
|
-
import { P as PopupUtils } from './popupUtils-
|
8
|
+
import { P as PopupUtils } from './popupUtils-21b9dbe5.js';
|
9
9
|
import { g as getLayerOrTable, c as getFeatureLayerView, h as highlightFeatures } from './mapViewUtils-e3de60cc.js';
|
10
10
|
import './esri-loader-c6842c6b.js';
|
11
11
|
import './_commonjsHelpers-089957fe.js';
|
12
|
-
import './downloadUtils-
|
12
|
+
import './downloadUtils-f2c49e23.js';
|
13
13
|
import './solution-resource-3108caf7.js';
|
14
14
|
import './index-a1e91462.js';
|
15
15
|
import './restHelpersGet-5c822bcd.js';
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-089957fe.js';
|
7
|
-
import { b as _typeof$1 } from './downloadUtils-
|
7
|
+
import { b as _typeof$1 } from './downloadUtils-f2c49e23.js';
|
8
8
|
import './index-83b693bc.js';
|
9
9
|
import './locale-4adfc8cf.js';
|
10
10
|
import './esri-loader-c6842c6b.js';
|
@@ -8,7 +8,7 @@ import { a as getComponentClosestLanguage, l as loadModules, g as getLocaleCompo
|
|
8
8
|
import { e as goToSelection, h as highlightFeatures, k as queryObjectIds, l as getQueryGeoms, c as getFeatureLayerView, m as queryFeaturesByGeometry, n as getIdSets, o as highlightAllFeatures } from './mapViewUtils-e3de60cc.js';
|
9
9
|
import { a as EWorkflowType, e as ESelectionMode, f as EDrawMode } from './interfaces-586e863c.js';
|
10
10
|
import { s as state } from './publicNotificationStore-08faccff.js';
|
11
|
-
import { d as downloadCSV, a as downloadPDF } from './downloadUtils-
|
11
|
+
import { d as downloadCSV, a as downloadPDF } from './downloadUtils-f2c49e23.js';
|
12
12
|
import './esri-loader-c6842c6b.js';
|
13
13
|
import './_commonjsHelpers-089957fe.js';
|
14
14
|
import './index-d97f4f15.js';
|
@@ -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 { _ as _prepareAttributeValue } from './downloadUtils-
|
6
|
+
import { _ as _prepareAttributeValue } from './downloadUtils-f2c49e23.js';
|
7
7
|
import { l as loadModules } from './locale-4adfc8cf.js';
|
8
8
|
|
9
9
|
/** @license
|
@@ -8,7 +8,7 @@ import { b as EExportType, c as EPageType, a as EWorkflowType } from './interfac
|
|
8
8
|
import { l as loadModules, g as getLocaleComponentStrings } from './locale-4adfc8cf.js';
|
9
9
|
import { e as goToSelection, h as highlightFeatures } from './mapViewUtils-e3de60cc.js';
|
10
10
|
import { s as state } from './publicNotificationStore-08faccff.js';
|
11
|
-
import { c as consolidateLabels, r as removeDuplicateLabels } from './downloadUtils-
|
11
|
+
import { c as consolidateLabels, r as removeDuplicateLabels } from './downloadUtils-f2c49e23.js';
|
12
12
|
import './esri-loader-c6842c6b.js';
|
13
13
|
import './_commonjsHelpers-089957fe.js';
|
14
14
|
import './index-d97f4f15.js';
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-83b693bc.js';
|
7
7
|
import { g as getSolutionVariables, a as getOrganizationVariables, b as getInventoryItems } from './templates-824ea028.js';
|
8
|
-
import { s as state } from './solution-store-
|
8
|
+
import { s as state } from './solution-store-840c5489.js';
|
9
9
|
import './solution-resource-3108caf7.js';
|
10
10
|
import { r as request, N as NODEJS_DEFAULT_REFERER_HEADER, c as cleanUrl, e as encodeQueryString, A as ArcGISAuthError, a as getProp } from './restHelpersGet-5c822bcd.js';
|
11
11
|
import './index-a1e91462.js';
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-83b693bc.js';
|
7
|
-
import { s as state } from './solution-store-
|
7
|
+
import { s as state } from './solution-store-840c5489.js';
|
8
8
|
import { g as getLocaleComponentStrings } from './locale-4adfc8cf.js';
|
9
9
|
import { n as nodeListToArray } from './common-96e3ddb0.js';
|
10
10
|
import './index-d97f4f15.js';
|
@@ -173,6 +173,16 @@ function updateItem$1(requestOptions) {
|
|
173
173
|
if (requestOptions.params.extent && isBBox(requestOptions.params.extent)) {
|
174
174
|
requestOptions.params.extent = bboxToString(requestOptions.params.extent);
|
175
175
|
}
|
176
|
+
/* istanbul ignore if */
|
177
|
+
if (requestOptions.params.file &&
|
178
|
+
requestOptions.params.file.constructor &&
|
179
|
+
requestOptions.params.file.constructor.name === 'ReadStream') {
|
180
|
+
// dataSize is not an official parameter for the ArcGIS REST API but is needed
|
181
|
+
// to encode the ReadStream with an appropriate length. This is to overcome
|
182
|
+
// the form-data library bug:
|
183
|
+
// https://github.com/form-data/form-data/issues/508
|
184
|
+
requestOptions.params.dataSize = requestOptions.dataSize;
|
185
|
+
}
|
176
186
|
return request(url, requestOptions);
|
177
187
|
});
|
178
188
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
6
|
import { r as registerInstance, c as createEvent, g as getElement } from './index-83b693bc.js';
|
7
|
-
import { s as state } from './solution-store-
|
7
|
+
import { s as state } from './solution-store-840c5489.js';
|
8
8
|
import { c as getFeatureServices, d as getSpatialReferenceInfo } from './templates-824ea028.js';
|
9
9
|
import './index-d97f4f15.js';
|
10
10
|
import './interfaces-586e863c.js';
|
@@ -3,4 +3,4 @@
|
|
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 t,c as e,h as i,H as a,g as s}from"./p-fa1ceaf9.js";import{s as l}from"./p-
|
6
|
+
import{r as t,c as e,h as i,H as a,g as s}from"./p-fa1ceaf9.js";import{s as l}from"./p-c1936856.js";import{g as c}from"./p-c0bf1d9f.js";import{n}from"./p-eed41e1a.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-3d7cff5e.js";import"./p-d4056c1c.js";import"./p-a230b270.js";import"./p-a0300d31.js";import"./p-0a24ad5f.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"7546d1fe9d944520db9f8f81600fb7cf0655f1ab"},i("calcite-tree",{key:"94bea7616cd3bdbb9fbcaddd49bb394e11bcf88b"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"16de446a44799754d7066eb5cc587585fc9e37c8"},i("div",{key:"ddb7c1e6c86657502dc4b293d495f3b4dee594cf",class:"configuration-container"},i("div",{key:"016954a98a5eb229a1f9eb2a4b9260daff3593bf",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const d=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"8c5f34b7d44429ed0395ae48956161caf7e62111"},i("label",{key:"69f1178da58409888f0b5b15ae4ffd224bb999d4",class:"switch-label"},i("calcite-switch",{key:"279795c5e21b914c595ea95219e3f589f7270ac4",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"516e621ad3e2f6f881b0fbc0a80d98f1f3b7eecd",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"19b05ffa3e80d5e33521d0b6ee8438d882f9481d"},this._translations.spatialReferenceInfo,i("label",{key:"0766edb36aa3e8853bfd4754b9ea7aa955d7d987",class:"spatial-ref-default"},i("spatial-ref",{key:"9f1b37a12e18b5ba3c2d2b4b372f01a4f69ded28",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services)))}solutionStoreHasChanges(){this.services=l.getStoreInfo("featureServices").map((t=>t.name))}spatialReferenceChange(t){this.value=t.detail.newValue,l.setStoreInfo("defaultWkid",t.detail.newValue);const e=l.getStoreInfo("spatialReferenceInfo");e.spatialReference=t.detail.newValue,l.setStoreInfo("spatialReferenceInfo",e)}_getFeatureServices(t){const e=l.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),i("ul",{class:"spatial-ref-services-list"},a.map((t=>i("li",{class:"spatial-ref-services-list-item"},i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))))):null}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_updateEnabledServices(t,e){var i,a;const s=l.getStoreInfo("spatialReferenceInfo"),c=void 0!==(null===(i=t.detail)||void 0===i?void 0:i.switched)?t.detail.switched:void 0===(null===(a=t.target)||void 0===a?void 0:a.checked)||t.target.checked;s.services[e]=c,l.setStoreInfo("spatialReferenceInfo",s),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:c})}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_updateStore(){const t=l.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,l.setStoreInfo("spatialReferenceInfo",t)}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};d.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:0}.spatial-ref-services-list-item{margin-top:0.25rem}";export{r as solution_contents,o as solution_item,d as solution_spatial_ref}
|
@@ -3,4 +3,4 @@
|
|
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 t,c as i,a as s,h as e,H as a,g as l}from"./p-fa1ceaf9.js";import{b as o,c as n,a as h}from"./p-c1cf3ebc.js";import{l as c,g as d}from"./p-c0bf1d9f.js";import{e as r,h as p}from"./p-996c1ac5.js";import{s as g}from"./p-c4ddb206.js";import{c as b,r as m}from"./p-67c3ac62.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-8c6d9b5a.js";import"./p-3d7cff5e.js";import"./p-a230b270.js";import"./p-a0300d31.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,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.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=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._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.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),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(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.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,{key:"329b485ac7b134bf2ae1758c07a2ca7988706cb5"},e("calcite-shell",{key:"d8280c38878b047cdaa55beb31d8895a420f3661"},e("calcite-action-bar",{key:"a83fcca2612f13b3f0220b3015a96750223f016b",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_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"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},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 n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.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","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",role:"presentation",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 o=!0;return i.workflowType===h.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&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!==h.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===h.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(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&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,"padding-1","word-wrap-anywhere"),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,locale:this.locale,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",flipRtl:!("he"===this.locale.toLowerCase()),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),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},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",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.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",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${a}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${a}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),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.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),e("div",{class:`padding-top-sides-1 ${i}`},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),e("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),e("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},e("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_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,locale:this.locale,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,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,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!==h.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._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.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._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===h.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,o=""){return e("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.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===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(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.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(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-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{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-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{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{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-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-color-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{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
|
6
|
+
import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-fa1ceaf9.js";import{b as o,c as n,a as h}from"./p-c1cf3ebc.js";import{l as c,g as d}from"./p-c0bf1d9f.js";import{e as r,h as p}from"./p-996c1ac5.js";import{s as g}from"./p-c4ddb206.js";import{c as b,r as m}from"./p-17946a3f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-8c6d9b5a.js";import"./p-3d7cff5e.js";import"./p-a230b270.js";import"./p-a0300d31.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,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.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=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._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.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),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(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.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,{key:"329b485ac7b134bf2ae1758c07a2ca7988706cb5"},e("calcite-shell",{key:"d8280c38878b047cdaa55beb31d8895a420f3661"},e("calcite-action-bar",{key:"a83fcca2612f13b3f0220b3015a96750223f016b",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_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"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},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 n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.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","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",role:"presentation",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 o=!0;return i.workflowType===h.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&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!==h.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===h.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(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&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,"padding-1","word-wrap-anywhere"),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,locale:this.locale,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",flipRtl:!("he"===this.locale.toLowerCase()),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),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},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",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.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",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${a}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${a}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),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.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),e("div",{class:`padding-top-sides-1 ${i}`},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),e("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),e("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},e("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_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,locale:this.locale,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,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,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!==h.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._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.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._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===h.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,o=""){return e("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.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===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(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.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(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-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{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-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{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{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-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-color-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{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
|
@@ -310,7 +310,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
|
|
310
310
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
311
311
|
* ====================================================================
|
312
312
|
*/
|
313
|
-
function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-
|
313
|
+
function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-75cb415f.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
|
314
314
|
/** ====================================================================
|
315
315
|
* @license
|
316
316
|
* jsPDF XMP metadata plugin
|
@@ -486,4 +486,4 @@ function(t,n){const i=n.map((t=>Object.values(t).map((t=>`"${t}"`)).join(",")+"\
|
|
486
486
|
* See the License for the specific language governing permissions and
|
487
487
|
* limitations under the License.
|
488
488
|
*/
|
489
|
-
function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(Mi(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function Ai(t,i,r,e=!1,s="",o=""){let a=await Li(t,i);const u=Mi(i);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,i,r,e="",s=""){!async function(t,i,r,e="",s=""){const o=new mi;await o.initialize({pageType:"ANSI_A"},n("../assets/arcgis-pdf-creator/"),"en",t);const a=new bi;await a.initialize(o);const u=r.labelSpec;let c=1;if(s){const t=u.pageProperties,n=f.getPageSize(t.pageType);o.drawImage(s,{x:t.leftMargin,y:t.topMargin,width:n.width-t.leftMargin-t.rightMargin,height:n.height-t.topMargin-t.bottomMargin}),e&&a.drawSupplementalText(e,0,-.1),i.length>0&&(o.addPage(),++c)}await a.addLabelsToDoc(i,u,c,e),o.save()}(t,i,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/ /gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}function qi(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=e(e({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:pi({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return s(o(t.url)+"/queryRelatedRecords",n)}(Object.assign(Object.assign({},t),{params:{resultOffset:i}})).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?qi(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function ji(t,n,r){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),r)){const u=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===u){const i=n.popupTemplate.content[0].relationshipId,e=n.relationships.find((t=>t.id===i));let s=t.layers.toArray().concat(t.tables.toArray());if(s=s.filter((t=>"feature"===t.type&&t.layerId===e.relatedTableId)),s.length>0)o=await ji(t,s[0],r),o.relationshipId=i.toString();else{s=t.layers.toArray().concat(t.tables.toArray());const e=[];let u;s=s.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return e.push(a(n)),!0}return!1})),(await Promise.all(e)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===i))||(u=ji(t,s[e],r),0))))?(o=await u,o.relationshipId=i.toString()):o.labelFormat=Si(n.popupTemplate.fieldInfos)}}else"fields"===u?(o.labelFormat=Si(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===u?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===u?await async function(t){const[n]=await i(["esri/arcade"]),r=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:r})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function Mi(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Ei(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return null==n?void 0:n.toString()}{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i)}return i}}export{Ei as _,Ai as a,c as b,Li as c,gi as d,yi as r}
|
489
|
+
function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(Mi(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function Ai(t,i,r,e=!1,s="",o=""){let a=await Li(t,i);const u=Mi(i);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,i,r,e="",s=""){!async function(t,i,r,e="",s=""){const o=new mi;await o.initialize({pageType:"ANSI_A"},n("../assets/arcgis-pdf-creator/"),"en",t);const a=new bi;await a.initialize(o);const u=r.labelSpec;let c=1;if(s){const t=u.pageProperties,n=f.getPageSize(t.pageType);o.drawImage(s,{x:t.leftMargin,y:t.topMargin,width:n.width-t.leftMargin-t.rightMargin,height:n.height-t.topMargin-t.bottomMargin}),e&&a.drawSupplementalText(e,0,-.1),i.length>0&&(o.addPage(),++c)}await a.addLabelsToDoc(i,u,c,e),o.save()}(t,i,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/ /gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}function qi(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=e(e({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:pi({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return s(o(t.url)+"/queryRelatedRecords",n)}(Object.assign(Object.assign({},t),{params:{resultOffset:i}})).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?qi(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function ji(t,n,r){var e,s;let o={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(o.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),r)){const u=null===(s=null===(e=n.popupTemplate)||void 0===e?void 0:e.content[0])||void 0===s?void 0:s.type;if("relationship"===u){const i=n.popupTemplate.content[0].relationshipId,e=n.relationships.find((t=>t.id===i));let s=t.layers.toArray().concat(t.tables.toArray());if(s=s.filter((t=>"feature"===t.type&&t.layerId===e.relatedTableId)),s.length>0)o=await ji(t,s[0],r),o.relationshipId=i.toString();else{s=t.layers.toArray().concat(t.tables.toArray());const e=[];let u;s=s.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return e.push(a(n)),!0}return!1})),(await Promise.all(e)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===i))||(u=ji(t,s[e],r),0))))?(o=await u,o.relationshipId=i.toString()):o.labelFormat=Si(n.popupTemplate.fieldInfos)}}else"fields"===u?(o.labelFormat=Si(n.popupTemplate.fieldInfos),0===o.labelFormat.format.length&&(o.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):o.labelFormat="text"===u?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===u?await async function(t){const[n]=await i(["esri/arcade"]),r=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:r})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(o)}function Mi(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Ei(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return null==n?void 0:n.toString()}{let i=t;switch(n){case"date":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(null==r?void 0:r.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i,{maximumFractionDigits:100,maximumSignificantDigits:21})}return i}}export{Ei as _,Ai as a,c as b,Li as c,gi as d,yi as r}
|