@esri/solutions-components 0.11.32 → 0.11.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/cjs/{asyncToGenerator-c7fc3ee4.js → asyncToGenerator-ccb3278b.js} +1 -1
  2. package/dist/cjs/basemap-gallery_7.cjs.entry.js +14 -9
  3. package/dist/cjs/buffer-tools_2.cjs.entry.js +1 -1
  4. package/dist/cjs/card-manager_3.cjs.entry.js +90 -13
  5. package/dist/cjs/consent-manager.cjs.entry.js +3 -3
  6. package/dist/cjs/create-feature_4.cjs.entry.js +7 -7
  7. package/dist/cjs/create-related-feature_3.cjs.entry.js +1 -1
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  9. package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
  10. package/dist/cjs/delete-dialog.cjs.entry.js +1 -1
  11. package/dist/cjs/{downloadUtils-c7dac47d.js → downloadUtils-fefa863b.js} +3 -3
  12. package/dist/cjs/feature-list.cjs.entry.js +4 -4
  13. package/dist/cjs/{index.es-3c2404c3.js → index.es-0441a948.js} +2 -2
  14. package/dist/cjs/json-editor_7.cjs.entry.js +1 -1
  15. package/dist/cjs/map-layer-picker.cjs.entry.js +1 -1
  16. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  17. package/dist/cjs/{popupUtils-27f6cf2a.js → popupUtils-a68a20db.js} +2 -2
  18. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  19. package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
  20. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  21. package/dist/cjs/solution-item-accordion.cjs.entry.js +1 -1
  22. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  23. package/dist/collection/components/basemap-gallery/basemap-gallery.js +13 -8
  24. package/dist/collection/components/card-manager/card-manager.js +1 -1
  25. package/dist/collection/components/edit-card/edit-card.js +1 -1
  26. package/dist/collection/components/info-card/info-card.js +2 -2
  27. package/dist/collection/components/layer-table/layer-table.js +86 -9
  28. package/dist/components/basemap-gallery2.js +13 -8
  29. package/dist/components/card-manager2.js +1 -1
  30. package/dist/components/edit-card2.js +1 -1
  31. package/dist/components/info-card2.js +2 -2
  32. package/dist/components/layer-table2.js +87 -10
  33. package/dist/esm/{asyncToGenerator-96b2368d.js → asyncToGenerator-48cd21fe.js} +1 -1
  34. package/dist/esm/basemap-gallery_7.entry.js +14 -9
  35. package/dist/esm/buffer-tools_2.entry.js +1 -1
  36. package/dist/esm/card-manager_3.entry.js +90 -13
  37. package/dist/esm/consent-manager.entry.js +3 -3
  38. package/dist/esm/create-feature_4.entry.js +7 -7
  39. package/dist/esm/create-related-feature_3.entry.js +1 -1
  40. package/dist/esm/crowdsource-manager.entry.js +1 -1
  41. package/dist/esm/crowdsource-reporter.entry.js +1 -1
  42. package/dist/esm/delete-dialog.entry.js +1 -1
  43. package/dist/esm/{downloadUtils-a9fc6dd2.js → downloadUtils-7ef5420f.js} +3 -3
  44. package/dist/esm/feature-list.entry.js +4 -4
  45. package/dist/esm/{index.es-87662946.js → index.es-c379ea10.js} +2 -2
  46. package/dist/esm/json-editor_7.entry.js +1 -1
  47. package/dist/esm/map-layer-picker.entry.js +1 -1
  48. package/dist/esm/map-select-tools_3.entry.js +3 -3
  49. package/dist/esm/{popupUtils-78f2029e.js → popupUtils-ef89df87.js} +2 -2
  50. package/dist/esm/public-notification.entry.js +3 -3
  51. package/dist/esm/solution-configuration.entry.js +1 -1
  52. package/dist/esm/solution-contents_3.entry.js +1 -1
  53. package/dist/esm/solution-item-accordion.entry.js +1 -1
  54. package/dist/esm/spatial-ref.entry.js +1 -1
  55. package/dist/solutions-components/p-035a1d38.entry.js +6 -0
  56. package/dist/solutions-components/{p-c83b1a4a.entry.js → p-11ad8edc.entry.js} +1 -1
  57. package/dist/solutions-components/{p-f6d19f6d.entry.js → p-1325fa9e.entry.js} +1 -1
  58. package/dist/solutions-components/{p-60b1fe27.entry.js → p-2be59c38.entry.js} +1 -1
  59. package/dist/solutions-components/{p-455c19fa.js → p-4379cc5f.js} +2 -2
  60. package/dist/solutions-components/{p-0a60707c.entry.js → p-5096280f.entry.js} +1 -1
  61. package/dist/solutions-components/p-51033697.entry.js +6 -0
  62. package/dist/solutions-components/p-51e04c86.js +21 -0
  63. package/dist/solutions-components/{p-30b5dcaf.entry.js → p-605597cf.entry.js} +1 -1
  64. package/dist/solutions-components/{p-d65f8b73.js → p-62a0aa8e.js} +1 -1
  65. package/dist/solutions-components/{p-a38eee28.entry.js → p-681a41f3.entry.js} +1 -1
  66. package/dist/solutions-components/{p-dc188d13.js → p-6d1ee086.js} +1 -1
  67. package/dist/solutions-components/{p-50b4945e.entry.js → p-7eec82e3.entry.js} +1 -1
  68. package/dist/solutions-components/{p-5b481f0d.entry.js → p-8b05b49c.entry.js} +1 -1
  69. package/dist/solutions-components/{p-6dc629dc.entry.js → p-93ebcb9b.entry.js} +1 -1
  70. package/dist/solutions-components/{p-b04179db.entry.js → p-b1f11c67.entry.js} +1 -1
  71. package/dist/solutions-components/{p-1aad0b63.entry.js → p-b3b5dca4.entry.js} +1 -1
  72. package/dist/solutions-components/{p-b8e4345e.entry.js → p-c45ba7dd.entry.js} +1 -1
  73. package/dist/solutions-components/{p-4a2870b0.entry.js → p-de3ba7be.entry.js} +1 -1
  74. package/dist/solutions-components/{p-7f36cfb0.entry.js → p-debeb4dc.entry.js} +1 -1
  75. package/dist/solutions-components/{p-f8854c5e.entry.js → p-e68f5f54.entry.js} +1 -1
  76. package/dist/solutions-components/{p-f3ba92d5.entry.js → p-f2cfed3a.entry.js} +1 -1
  77. package/dist/solutions-components/solutions-components.esm.js +1 -1
  78. package/dist/solutions-components_commit.txt +6 -6
  79. package/dist/types/components/layer-table/layer-table.d.ts +34 -0
  80. package/package.json +1 -1
  81. package/dist/solutions-components/p-0def29e6.entry.js +0 -6
  82. package/dist/solutions-components/p-31159fc6.js +0 -21
  83. package/dist/solutions-components/p-76126e43.entry.js +0 -6
  84. /package/dist/cjs/{locale-809dbc6e.js → locale-81070bd9.js} +0 -0
  85. /package/dist/cjs/{typeof-2a7e2dec.js → typeof-920a4426.js} +0 -0
  86. /package/dist/esm/{locale-fa8258bf.js → locale-4be8e04f.js} +0 -0
  87. /package/dist/esm/{typeof-ef2a007d.js → typeof-2511410e.js} +0 -0
  88. /package/dist/solutions-components/{p-57be3b9d.js → p-8a74a780.js} +0 -0
  89. /package/dist/solutions-components/{p-4fe489cf.js → p-af7e43e0.js} +0 -0
@@ -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{t}from"./p-4fe489cf.js";import{a as n}from"./p-934e8935.js";import{l as i}from"./p-57be3b9d.js";import{q as r}from"./p-5693ce7a.js";import"./p-4f236b5d.js";import{g as e}from"./p-570b13d9.js";import{a as s,r as o,c as a}from"./p-0668e30d.js";
6
+ import{t}from"./p-af7e43e0.js";import{a as n}from"./p-934e8935.js";import{l as i}from"./p-8a74a780.js";import{q as r}from"./p-5693ce7a.js";import"./p-4f236b5d.js";import{g as e}from"./p-570b13d9.js";import{a as s,r as o,c as a}from"./p-0668e30d.js";
7
7
  /* @preserve
8
8
  * arcgis-pdf-creator v0.0.1
9
9
  * Thu Apr 27 2023 17:20:32 GMT-0700 (Pacific Daylight Time)
@@ -309,7 +309,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
309
309
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
310
310
  * ====================================================================
311
311
  */
312
- function(){function t(){return(tt.canvg?Promise.resolve(tt.canvg):import("./p-dc188d13.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}It.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw it.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw it.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)}))}}(),It.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},It.API.viewerPreferences=function(n,i){var r;n=n||{},i=i||!1;var e,s,o,a={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}},u=Object.keys(a),f=[],c=0,h=0,l=0;function d(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(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,"reset"===n||!0===i){var v=u.length;for(l=0;l<v;l+=1)r[u[l]].value=r[u[l]].defaultValue,r[u[l]].explicitSet=!1}if("object"===t(n))for(s in n)if(o=n[s],d(u,s)&&void 0!==o){if("boolean"===r[s].type&&"boolean"==typeof o)r[s].value=o;else if("name"===r[s].type&&d(r[s].valueSet,o))r[s].value=o;else if("integer"===r[s].type&&Number.isInteger(o))r[s].value=o;else if("array"===r[s].type){for(c=0;c<o.length;c+=1)if(e=!0,1===o[c].length&&"number"==typeof o[c][0])f.push(String(o[c]-1));else if(o[c].length>1){for(h=0;h<o[c].length;h+=1)"number"!=typeof o[c][h]&&(e=!1);!0===e&&f.push([o[c][0]-1,o[c][1]-1].join(" "))}r[s].value="["+f.join(" ")+"]"}else r[s].value=r[s].defaultValue;r[s].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in r)!0===r[t].explicitSet&&n.push("name"===r[t].type?"/"+t+" /"+r[t].value:"/"+t+" "+r[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this
312
+ function(){function t(){return(tt.canvg?Promise.resolve(tt.canvg):import("./p-6d1ee086.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}It.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw it.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw it.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)}))}}(),It.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},It.API.viewerPreferences=function(n,i){var r;n=n||{},i=i||!1;var e,s,o,a={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}},u=Object.keys(a),f=[],c=0,h=0,l=0;function d(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(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,"reset"===n||!0===i){var v=u.length;for(l=0;l<v;l+=1)r[u[l]].value=r[u[l]].defaultValue,r[u[l]].explicitSet=!1}if("object"===t(n))for(s in n)if(o=n[s],d(u,s)&&void 0!==o){if("boolean"===r[s].type&&"boolean"==typeof o)r[s].value=o;else if("name"===r[s].type&&d(r[s].valueSet,o))r[s].value=o;else if("integer"===r[s].type&&Number.isInteger(o))r[s].value=o;else if("array"===r[s].type){for(c=0;c<o.length;c+=1)if(e=!0,1===o[c].length&&"number"==typeof o[c][0])f.push(String(o[c]-1));else if(o[c].length>1){for(h=0;h<o[c].length;h+=1)"number"!=typeof o[c][h]&&(e=!1);!0===e&&f.push([o[c][0]-1,o[c][1]-1].join(" "))}r[s].value="["+f.join(" ")+"]"}else r[s].value=r[s].defaultValue;r[s].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in r)!0===r[t].explicitSet&&n.push("name"===r[t].type?"/"+t+" /"+r[t].value:"/"+t+" "+r[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this
313
313
  /** ====================================================================
314
314
  * @license
315
315
  * jsPDF XMP metadata plugin
@@ -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,g as i,h as s,H as a}from"./p-934e8935.js";import{g as o}from"./p-57be3b9d.js";import"./p-d4056c1c.js";const c=class{constructor(i){t(this,i),this.editsComplete=e(this,"editsComplete",7),this.deleteDialogClose=e(this,"deleteDialogClose",7),this.ids=[],this.layer=void 0,this.locale=void 0,this.open=!1,this._isDeleting=!1,this._translations=void 0}get el(){return i(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;deleteDialogClose;async componentWillLoad(){await this._getTranslations()}render(){const t=1===this.ids.length?this._translations?.confirmSingle:this._translations?.confirmMultiple;return s(a,{key:"c75cf86cce1b728837422e4102fd9cdffc33c78a"},s("calcite-dialog",{key:"026e1b0a55ebd740f2352da820d5b15afa050f78",heading:this._translations?.deleteFeature,kind:"danger",modal:!0,onCalciteDialogClose:()=>this._close(),open:this.open,widthScale:"s"},s("div",{key:"3f8e4aef2995387b758f1af8e1443253207998bc"},t),s("calcite-button",{key:"3005fafc853db910adc787290a328dcc161401bb",appearance:"outline",kind:"danger",onClick:()=>this._close(),slot:"footer-end",width:"full"},this._translations?.cancel),s("calcite-button",{key:"42e9da99a45f416fa9b9b5cfefdb10b045593ecb",kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"footer-end",width:"full"},this._translations?.delete)))}async _deleteFeatures(){this._isDeleting=!0;const t=this.ids.map((t=>({objectId:t})));await this.layer.applyEdits({deleteFeatures:t}),this._isDeleting=!1,this._close(),this.editsComplete.emit("delete")}_close(){this.open=!1,this.deleteDialogClose.emit()}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};c.style=":host{display:block}.delete-modal{position:fixed}";export{c as delete_dialog}
6
+ import{r as t,c as e,g as i,h as s,H as a}from"./p-934e8935.js";import{g as o}from"./p-8a74a780.js";import"./p-d4056c1c.js";const c=class{constructor(i){t(this,i),this.editsComplete=e(this,"editsComplete",7),this.deleteDialogClose=e(this,"deleteDialogClose",7),this.ids=[],this.layer=void 0,this.locale=void 0,this.open=!1,this._isDeleting=!1,this._translations=void 0}get el(){return i(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;deleteDialogClose;async componentWillLoad(){await this._getTranslations()}render(){const t=1===this.ids.length?this._translations?.confirmSingle:this._translations?.confirmMultiple;return s(a,{key:"c75cf86cce1b728837422e4102fd9cdffc33c78a"},s("calcite-dialog",{key:"026e1b0a55ebd740f2352da820d5b15afa050f78",heading:this._translations?.deleteFeature,kind:"danger",modal:!0,onCalciteDialogClose:()=>this._close(),open:this.open,widthScale:"s"},s("div",{key:"3f8e4aef2995387b758f1af8e1443253207998bc"},t),s("calcite-button",{key:"3005fafc853db910adc787290a328dcc161401bb",appearance:"outline",kind:"danger",onClick:()=>this._close(),slot:"footer-end",width:"full"},this._translations?.cancel),s("calcite-button",{key:"42e9da99a45f416fa9b9b5cfefdb10b045593ecb",kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"footer-end",width:"full"},this._translations?.delete)))}async _deleteFeatures(){this._isDeleting=!0;const t=this.ids.map((t=>({objectId:t})));await this.layer.applyEdits({deleteFeatures:t}),this._isDeleting=!1,this._close(),this.editsComplete.emit("delete")}_close(){this.open=!1,this.deleteDialogClose.emit()}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};c.style=":host{display:block}.delete-modal{position:fixed}";export{c as delete_dialog}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as t,g as i,h as s,H as e,c as a}from"./p-934e8935.js";import{l as h,g as n}from"./p-8a74a780.js";import"./p-d4056c1c.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}get el(){return i(this)}BasemapGallery;PortalBasemapsSource;_basemapElement;async basemapConfigWatchHandler(){if(this.basemapWidget?.source){const t=this.basemapWidget?.source;t.query=this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,await t.refresh()}}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"cc7e423a47742c0f5c3a5023b77157af09e56433"},s("div",{key:"9b41466e49c93e533f1d2a621707c5189c5092b3",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){if(this.BasemapGallery){const i=new this.PortalBasemapsSource({query:this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await i.refresh(),this.basemapWidget?(this.basemapWidget.view=t,this.basemapWidget.source=i):this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:i})}}static get watchers(){return{basemapConfig:["basemapConfigWatchHandler"],mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}get el(){return i(this)}FloorFilter;_floorFilterElement;reactiveUtils;_facilityHandle;_levelHandle;_siteHandle;async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}facilityChanged;levelChanged;siteChanged;async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"dd7fa68ddc1e417cb8924549e50e81742f9e891a"},s("div",{key:"294837a32ed7e8f955bce7dc2403895c7dd9984f",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=t?.map;await i.when((()=>{t&&this.enabled&&this.FloorFilter&&i?.floorInfo&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),this._facilityHandle?.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),this._levelHandle?.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),this._siteHandle?.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};r.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}Fullscreen;_fullscreenElement;_fullscreenStateChangeHandle;reactiveUtils;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}fullscreenStateChange;async componentWillLoad(){await this._initModules()}render(){return s(e,{key:"7eec3dc5ab76a4ad8fdd24d8d18f8e6cf2820dde"},s("div",{key:"2093cc2a6a3678209e61eea63ebde2f69ec00011",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}get el(){return i(this)}Legend;_legendElement;async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"768d9d69042516c6d4edc55fcb0af23f90d33e6e"},s("div",{key:"e1147cf58240e7a6fcb9a00fce3649a380755e3d",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,respectLayerDefinitionExpression:!0,view:t}))}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.beforeMapInfoChange=a(this,"beforeMapInfoChange",7),this.mapInfoChange=a(this,"mapInfoChange",7),this.locale=void 0,this.mapInfos=[],this.isMapLayout=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}get el(){return i(this)}_list;_loadedId="";_skipEditCheck=!1;_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t,i=!1){this._skipEditCheck=i;const s=this.mapInfos?.filter((i=>i.id===t));t&&s?.length>0&&this._webMapSelected(s[0]),this._skipEditCheck=!1}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}beforeMapInfoChange;mapInfoChange;async componentWillLoad(){await this._getTranslations()}render(){return s(e,{key:"6b4b2bc101fa29a1eaadfdcc772131b7c40cedec"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){const t="map-picker-expand-toggle";return s("div",{class:"width-full"},s("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",iconStart:"map",id:t,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},this._webMapInfo?.name),s("calcite-tooltip",{placement:"bottom","reference-element":t},s("span",null,this._translations.switchMap)))}_getToolbar(){return s("div",{class:"display-flex border-right"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list border-bottom-1 adjusted-height "+(this.isMapLayout?"width-26":"width-full"):"display-none"},s("calcite-list",{id:"mapList",label:"",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){const i=this._loadedId;this._loadedId=t.id,this._skipEditCheck?this._webMapInfo=t:this.beforeMapInfoChange.emit({currentId:i,mapInfo:t,ref:this.el}).defaultPrevented||(this._webMapInfo=t),this._mapListExpanded=!1}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],locale:["localeWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.width-26{width:26% !important}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.border-right{border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}.adjusted-height{max-height:calc(100% - 52px);overflow-y:auto}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}FeatureLayer;Search;_searchElement;_searchResult;async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return s(e,{key:"36e0fb49fdedbe9e8789fba37f86a2f2d57b4e45"},s("div",{key:"796ee258723e9277dc98323ba76def22bd7dca3a",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return s?.length>0?(t.includeDefaultSources=!1,s.forEach((t=>{if(t.hasOwnProperty("layer")){const s=t,e=s.layer?.id,a=e?i.map.findLayerById(e):null,h=s?.layer?.url;a?s.layer=a:h&&(s.layer=new this.FeatureLayer(h))}})),s?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const m=class{constructor(i){t(this,i),this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.locale=void 0,this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}get el(){return i(this)}Expand;_basemapElement;_floorFilterElement;_fullscreenElement;_legendElement;_searchElement;_widgets=[];async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._hasFloorInfo=this.mapView?.map?.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",i=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",r=this.enableSingleExpand?"margin-top-1-2":"",c=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],l=this.stackTools?"box-shadow":"";return s(e,{key:"6a707a10b3cbe094548a863b13d0852969c46f94"},s("div",{key:"c1e349ba8577a87f967b31a7a042be30cb933d34",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?s("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,s("div",{key:"7120793f9d707fb0d1914f5aeffb3293532ab891",class:`${r} ${l} ${t}`},this._getMapWidgets(c))),s("basemap-gallery",{key:"11e280302f6b1f5287aa83c7eb33542f3a9d87ab",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),s("map-search",{key:"c3afd22dc8d652877f48a6def87e486546993d61",class:i,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),s("map-legend",{key:"b8fad3cdbc3b96b4f3441316651ad78b4ed3de65",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),s("map-fullscreen",{key:"e34111225f1ec80fedfd548196e407786d28200b",class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),s("floor-filter",{key:"2db5c7e6182d77786b162692169263495b2752f5",class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){const t=document.getElementsByClassName("esri-zoom")[0]?.children[0],i=document.getElementsByClassName("esri-zoom")[0]?.children[1];if(t&&i){const s="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";t.style.width=s,t.style.height=s,i.style.width=s,i.style.height=s}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,this._legendElement?.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,this._searchElement?.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,this._fullscreenElement?.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,this._basemapElement?.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,this._floorFilterElement?.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,i,e,a){return s("div",null,s("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,disabled:i,icon:t,id:t,onClick:a,scale:"s",text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},s("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};m.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{o as basemap_gallery,r as floor_filter,c as map_fullscreen,l as map_legend,d as map_picker,p as map_search,m as map_tools}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{_ as t}from"./p-4379cc5f.js";import{l as s}from"./p-8a74a780.js";
7
+ /** @license
8
+ * Copyright 2022 Esri
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */class i{arcade;intl;async getPopupTitle(s,i){this.arcade||await this._initModules();let a={};for(const[t,i]of Object.entries(s.attributes))a={...a,[`{${t.toUpperCase()}}`]:i};const e=s.layer,o=this._removeTags(e?.popupTemplate?.title);if(o.includes("{expression/expr")&&null!=e?.popupTemplate?.expressionInfos)for(let t=0;t<e.popupTemplate?.expressionInfos.length;t++){const o=e.popupTemplate.expressionInfos[t],n=this.arcade.createArcadeProfile("popup");try{const t=await this.arcade.createArcadeExecutor(o.expression,n),r=await t.executeAsync({$feature:s,$layer:e,$map:i});null==r&&""===r||(a[`{expression/${o.name}}`.toUpperCase()]=r)}catch(t){console.error(t);continue}}return e.popupTemplate?.fieldInfos&&e.fields.forEach((i=>{const o=s.attributes[i.name],n=e.popupTemplate.fieldInfos.find((t=>t.fieldName.toLowerCase()===i.name.toLowerCase())),r=t(o,i.type,i.domain,n?.format,this.intl);a[`{${i.name.toUpperCase()}}`]=r??o})),o?.replace(/{.*?}/g,(t=>null!=a[t.toUpperCase()]?a[t.toUpperCase()]:""))}_removeTags(t){return null==t||""===t?"":t.toString().replace(/(<([^>]+)>)/gi,"")}async _initModules(){const[t,i]=await s(["esri/arcade","esri/intl"]);this.arcade=t,this.intl=i}}export{i as P}
@@ -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,g as e,h as s,F as a,H as h}from"./p-934e8935.js";import{l as o,g as n}from"./p-57be3b9d.js";import{a as c,g as d}from"./p-5693ce7a.js";import{P as r}from"./p-31159fc6.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-455c19fa.js";import"./p-4fe489cf.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const l=class{constructor(e){t(this,e),this.success=i(this,"success",7),this.fail=i(this,"fail",7),this.drawComplete=i(this,"drawComplete",7),this.editingAttachment=i(this,"editingAttachment",7),this.progressStatus=i(this,"progressStatus",7),this.modeChanged=i(this,"modeChanged",7),this.customizeSubmit=!1,this.enableSearch=!1,this.enableSnapping=!1,this.floorLevel=void 0,this.formElements=void 0,this.isMobile=void 0,this.locale=void 0,this.mapView=void 0,this.searchConfiguration=void 0,this.selectedLayerId=void 0,this.showGuidingMsg=!0,this.submitNewReportsMessage=void 0,this._currentPage="templatePicker",this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}Editor;ExpressionInfo;FeatureLayer;FieldElement;FormTemplate;MapView;Search;_addingAttachment;_calciteNotice;_container;_editor;_isSubmitBtnClicked=!1;_mapViewContainer;reactiveUtils;_search;_searchDiv;_selectedLayer;_updatedMapView;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&(this._editor.viewModel.sketchViewModel&&this._editor.viewModel.sketchViewModel?.destroy(),this._editor.destroy(),this.enableSnapping&&(this.mapView.ui.view.grid=null))}render(){const t="drawing"===this._currentPage?"":"display-none",i=this._editorLoading?"":"display-none",e=this._editorLoading?"display-none":"",h=this.isMobile?"show-map":"display-none";let o=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?o=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(o=this._translations.provideDetailsMsg),s(a,{key:"3a448bdb1ffdef55993b20f99b3f1bd1643b6e2f"},this.showGuidingMsg&&"templatePicker"!==this._currentPage&&s("calcite-notice",{key:"5a9f000003d75c93ff613f1a4ddba14711653173",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},s("div",{key:"751a2c932838a798b102e14340cba2103abdf971",slot:"message"},o)),s("calcite-loader",{key:"e6ae257cd070bc9d7ea55c725ecf95d096effbc0",class:i,label:"",scale:"s"}),s("div",{key:"c25373774f6b87f7a6db4febd62a25b870d9be79",class:e,id:"feature-form"}),this.enableSearch&&s("div",{key:"3deb4ffc1f8a633d92e3c27f64247a6f21c58e56",class:`search-widget ${t} ${e}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),s("div",{key:"c72a6826cddbac45675a788e941a6cabd320740a",class:`${h}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,i,e,s,a,h,n]=await o(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=i,this.Search=e,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=h,this.MapView=n}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none"),this.enableSnapping||this._container.classList.add("hide-editor-toolbar");const i=await c(this._updatedMapView);this._selectedLayer=await d(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||i.forEach((async i=>{t.push({layer:i,enabled:"feature"===i?.type&&i?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{settingsMenu:this.enableSnapping,snappingControls:this.enableSnapping,createFeaturesSection:!0,editFeaturesSection:!1,flow:!0,sketch:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(e);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(50),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(100),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const h=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(h)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const e=this._editor.viewModel.featureTemplatesViewModel.items[0].items;this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===e.length&&this._editor.viewModel.featureTemplatesViewModel.select(e[0]);const s=e.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&i(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let i=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(i=t.results[0].results[0]?.feature.geometry)}));const e=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&i&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",i),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_getSearchConfig(t,i){const e=t.sources;return e?.length>0?(t.includeDefaultSources=!1,e.forEach((t=>{if(t.hasOwnProperty("layer")){const e=t,s=e.layer?.id,a=s?i.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const i=this._selectedLayer;if(i?.floorInfo?.floorField){const e=i.fields.find((t=>t.name===i.floorInfo.floorField));if(e&&!i?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(e.name,t),e.editable=!1;else if(i.formTemplate&&this.formElements){const e=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:i.floorInfo.floorField,editableExpression:"false",fieldName:i.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:e.name});this._updatedMapView.map.editableLayers.forEach((t=>{const i=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const h=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[e].concat(i)});t.formTemplate=h}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const i=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");i?.querySelector("header")?.setAttribute("style","display: none"),i?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((i=>setTimeout(i,t)))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};l.style=":host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const p=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7),this.deleteDialog=void 0,this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this.locale=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._supportsDelete=void 0,this._translations=void 0}get el(){return e(this)}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;async componentWillLoad(){await this._getTranslations()}render(){return s(h,{key:"a8b845e5a7283318d4e313914e8bf992c5405d82"},"button"===this.buttonType?s("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):s("calcite-action",{appearance:"solid",disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},s("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage(),s("calcite-tooltip",{key:"63e746d5066e96a13066cae6d3ad0b23c81437dc",placement:"bottom","reference-element":"button"===this.buttonType?"solutions-delete":this.icon},s("span",{key:"9f6708e8ff0255d6634c69cb66d9544dc5b053ba"},this._translations.delete)))}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){this._supportsDelete=this.layer?.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete,this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){return this.deleteDialog?this.deleteDialog:s("delete-dialog",{id:"solution-delete-dialog",ids:this.ids,layer:this.layer,locale:this.locale,onDeleteDialogClose:()=>this._confirmDelete=!1,open:this._confirmDelete})}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"],locale:["localeWatchHandler"]}}};p.style=":host{display:block}.delete-modal{position:fixed}";const b=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editorInitialized=i(this,"editorInitialized",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this.enableEditGeometry=!1,this.enableSnapping=!1,this.graphicIndex=0,this.graphics=void 0,this.locale=void 0,this.mapView=void 0,this.open=!1,this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.length>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}closeEdit;editorInitialized;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{setTimeout((()=>{this.editsComplete.emit()}),50)})))}render(){const t=this._editorLoading?"display-none":"position-absolute",i=this._editorLoading?"":"display-none";return s(h,{key:"d67dbfb453966623d26a1567df84bc58024305d7"},s("div",{key:"9cd13eaf0125ab39e1d24398ccfda17c9534317a",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)),s("div",{key:"6cb4122611d8d8595cd85cd07224baa374066658",class:"position-absolute"},s("div",{key:"c4498b1ecd165fa594d9d1cef43f01643b5e3efb",class:t,id:"feature-form",ref:t=>this._editContainer=t}),s("calcite-loader",{key:"febb4d5c9a662ec9ffa6955114c8476c498116ee",class:i,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await o(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=await c(this.mapView),e=this.enableSnapping&&this.enableEditGeometry,s=i.map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({view:this.mapView,layerInfos:s,visibleElements:{flow:!0,settingsMenu:e,sketch:!1,snappingControls:e},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this.enableSnapping||t.classList.add("hide-editor-toolbar"),this._editContainer.appendChild(t),this.editorInitialized.emit(this._editor)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.length>0&&this.refreshGraphics.emit(this.graphics),this.enableSnapping&&(this.mapView.ui.view.grid=null),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};b.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-editor__panel-content{padding-block:10px !important}";const f=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.clearSelection=i(this,"clearSelection",7),this.selectionChanged=i(this,"selectionChanged",7),this.enableEditGeometry=!1,this.enableSnapping=!1,this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.locale=void 0,this.paginationEnabled=!0,this.position="absolute",this.showCloseBtn=!1,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0,this._navigatedToRelatedFeature=void 0}get el(){return e(this)}Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;_relatedFeature;async graphicsWatchHandler(){this._navigatedToRelatedFeature&&this._features&&(this._features.clear(),this._features.close(),this._count="",this._navigatedToRelatedFeature=!1),await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}popupClosed;clearSelection;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.viewModel&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this._navigatedToRelatedFeature||(this.graphics=[...t.detail])}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new r}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",i=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",e=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",a=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",o=this._features?.features?.length<2||this._navigatedToRelatedFeature,n=this.isMobile?"display-none":"",c=this._features?.selectedFeature?.getObjectId(),d=parseInt(c?.toString(),10)>-1?[c]:[],r=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete,l=this._relatedFeature?[this._relatedFeature]:this.graphics,p=this._navigatedToRelatedFeature?0:this._features?.selectedFeatureIndex;return s(h,{key:"b62820abf5a5ce69261a7170dbc102ee8f656907"},s("calcite-shell",{key:"6c26e6c6e0247f96183ab7d300d2591c5beb5b94",style:{position:this.position}},this._getHeader(),s("calcite-loader",{key:"fc153dc30be352de54fd2d197e154cd09a8f39f2",class:t,label:this._translations.fetchingData}),s("div",{key:"8faba972e54dbc4086a5c74187279149c7bbfe6e",class:"esri-widget feature-node "+i,id:this._featuresNodeId}),s("div",{key:"3374bace58475d983d0b6b57c1c45faa6bddef6e",class:`${a} width-100`,slot:"footer"},this.allowEditing&&s("div",{key:"567ed97ca7a9a1d7245caa21ca23effe728b0ac9",class:"display-flex top-border padding-1-2"},s("calcite-button",{key:"caae5c4c5834bf7658bbe12c329ead2f8150f8cd",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&r?s("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:d,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,s("calcite-tooltip",{key:"57681bf90ac5d7c2a4bc9d3e15e3a93a675fbed1",placement:"bottom","reference-element":"solutions-edit"},s("span",{key:"018a661cd5f88ea5be62acbe762308ef25e7b681"},this._translations.edit)),this.isMobile&&r?s("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},s("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!o&&s("div",{key:"92ba3836a0b5fcd2717966ef6162e10968d43126",class:`display-flex padding-1-2 button-container top-border ${n}`},s("div",{key:"bf23c4f203efcea7c613d77d86efada639fa7c1b"},s("calcite-button",{key:"a416b24f360374e73679df9027b13f7651dbb723",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),s("calcite-tooltip",{key:"8849ca323a75d2fd21393a133f49c1ea201178d4",placement:"top","reference-element":"solutions-back"},s("span",{key:"84cd60a8c7a5678d99e2d803ebb705e986591cb5"},this._translations.back))),s("calcite-action",{key:"7d4e9984eda51a7b9d67bcc2bce3b258566bbeee",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},s("span",{key:"a14051ff8801623cc1dda9895f9bf98b5b4b8a36",class:"pagination-count"},this._count)),s("div",{key:"65bd33feeee7e1606548a9b21b9a3d1b78bc8931"},s("calcite-button",{key:"228969faa39e600546e8b9a00c888df4d00a6477",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),s("calcite-tooltip",{key:"8f343657583d421b7dbbd79067af998d11c30855",placement:"top","reference-element":"solutions-next"},s("span",{key:"98fc622e0ba9ae3878ac0cbc8c2c119fe5b4b489"},this._translations.next))))),s("edit-card",{key:"c99b429d633117c673a7c8effc7cb689233bce1e",class:e,enableEditGeometry:this.enableEditGeometry,enableSnapping:this.enableSnapping,graphicIndex:p,graphics:l,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{key:"82ac3ceb259b6f87b8bbbb196fcf61de705ed019",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{key:"f113eb60f51d3b1d9fddf9c58e89c792e41e95b5",slot:"title"},this._translations.editDisabled),s("div",{key:"c010ac376e6e3497d86326bcb1e16976a4a026cd",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await o(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features.clear(),this._features.close()),this._count=this._getCount()}async _initFeaturesWidget(){return void 0!==this.isMobile?await(this.mapView?.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=this.showCloseBtn,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:this._featuresNodeId,visibleElements:{actionBar:!1,closeButton:this.showCloseBtn,featureMenuHeading:!1,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{this._count=this._getCount(),t||(this._showListView=t)})),this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})),this.reactiveUtils.watch((()=>this._features.selectedDrillInFeature),(t=>{t?(this._relatedFeature=t,this._navigatedToRelatedFeature=!0):(this._relatedFeature=null,this._navigatedToRelatedFeature=!1)})),this.el.querySelector("#"+this._featuresNodeId).addEventListener("calciteFlowItemClose",(()=>{this.clearSelection.emit()})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?s("calcite-panel",{class:"border-width-0",slot:"header"},s("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),s("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),i=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",i)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};f.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}";export{l as create_feature,p as delete_button,b as edit_card,f as info_card}
6
+ import{r as t,c as i,g as e,h as s,F as a,H as h}from"./p-934e8935.js";import{l as o,g as n}from"./p-8a74a780.js";import{a as c,g as d}from"./p-5693ce7a.js";import{P as r}from"./p-51e04c86.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-4379cc5f.js";import"./p-af7e43e0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const l=class{constructor(e){t(this,e),this.success=i(this,"success",7),this.fail=i(this,"fail",7),this.drawComplete=i(this,"drawComplete",7),this.editingAttachment=i(this,"editingAttachment",7),this.progressStatus=i(this,"progressStatus",7),this.modeChanged=i(this,"modeChanged",7),this.customizeSubmit=!1,this.enableSearch=!1,this.enableSnapping=!1,this.floorLevel=void 0,this.formElements=void 0,this.isMobile=void 0,this.locale=void 0,this.mapView=void 0,this.searchConfiguration=void 0,this.selectedLayerId=void 0,this.showGuidingMsg=!0,this.submitNewReportsMessage=void 0,this._currentPage="templatePicker",this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}Editor;ExpressionInfo;FeatureLayer;FieldElement;FormTemplate;MapView;Search;_addingAttachment;_calciteNotice;_container;_editor;_isSubmitBtnClicked=!1;_mapViewContainer;reactiveUtils;_search;_searchDiv;_selectedLayer;_updatedMapView;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&(this._editor.viewModel.sketchViewModel&&this._editor.viewModel.sketchViewModel?.destroy(),this._editor.destroy(),this.enableSnapping&&(this.mapView.ui.view.grid=null))}render(){const t="drawing"===this._currentPage?"":"display-none",i=this._editorLoading?"":"display-none",e=this._editorLoading?"display-none":"",h=this.isMobile?"show-map":"display-none";let o=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?o=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(o=this._translations.provideDetailsMsg),s(a,{key:"3a448bdb1ffdef55993b20f99b3f1bd1643b6e2f"},this.showGuidingMsg&&"templatePicker"!==this._currentPage&&s("calcite-notice",{key:"5a9f000003d75c93ff613f1a4ddba14711653173",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},s("div",{key:"751a2c932838a798b102e14340cba2103abdf971",slot:"message"},o)),s("calcite-loader",{key:"e6ae257cd070bc9d7ea55c725ecf95d096effbc0",class:i,label:"",scale:"s"}),s("div",{key:"c25373774f6b87f7a6db4febd62a25b870d9be79",class:e,id:"feature-form"}),this.enableSearch&&s("div",{key:"3deb4ffc1f8a633d92e3c27f64247a6f21c58e56",class:`search-widget ${t} ${e}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),s("div",{key:"c72a6826cddbac45675a788e941a6cabd320740a",class:`${h}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,i,e,s,a,h,n]=await o(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=i,this.Search=e,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=h,this.MapView=n}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none"),this.enableSnapping||this._container.classList.add("hide-editor-toolbar");const i=await c(this._updatedMapView);this._selectedLayer=await d(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||i.forEach((async i=>{t.push({layer:i,enabled:"feature"===i?.type&&i?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{settingsMenu:this.enableSnapping,snappingControls:this.enableSnapping,createFeaturesSection:!0,editFeaturesSection:!1,flow:!0,sketch:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(e);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(50),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(100),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const h=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(h)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const e=this._editor.viewModel.featureTemplatesViewModel.items[0].items;this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===e.length&&this._editor.viewModel.featureTemplatesViewModel.select(e[0]);const s=e.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&i(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let i=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(i=t.results[0].results[0]?.feature.geometry)}));const e=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&i&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",i),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_getSearchConfig(t,i){const e=t.sources;return e?.length>0?(t.includeDefaultSources=!1,e.forEach((t=>{if(t.hasOwnProperty("layer")){const e=t,s=e.layer?.id,a=s?i.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const i=this._selectedLayer;if(i?.floorInfo?.floorField){const e=i.fields.find((t=>t.name===i.floorInfo.floorField));if(e&&!i?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(e.name,t),e.editable=!1;else if(i.formTemplate&&this.formElements){const e=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:i.floorInfo.floorField,editableExpression:"false",fieldName:i.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:e.name});this._updatedMapView.map.editableLayers.forEach((t=>{const i=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const h=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[e].concat(i)});t.formTemplate=h}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const i=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");i?.querySelector("header")?.setAttribute("style","display: none"),i?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((i=>setTimeout(i,t)))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};l.style=":host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const p=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7),this.deleteDialog=void 0,this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this.locale=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._supportsDelete=void 0,this._translations=void 0}get el(){return e(this)}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;async componentWillLoad(){await this._getTranslations()}render(){return s(h,{key:"a8b845e5a7283318d4e313914e8bf992c5405d82"},"button"===this.buttonType?s("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):s("calcite-action",{appearance:"solid",disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},s("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage(),s("calcite-tooltip",{key:"63e746d5066e96a13066cae6d3ad0b23c81437dc",placement:"bottom","reference-element":"button"===this.buttonType?"solutions-delete":this.icon},s("span",{key:"9f6708e8ff0255d6634c69cb66d9544dc5b053ba"},this._translations.delete)))}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){this._supportsDelete=this.layer?.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete,this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){return this.deleteDialog?this.deleteDialog:s("delete-dialog",{id:"solution-delete-dialog",ids:this.ids,layer:this.layer,locale:this.locale,onDeleteDialogClose:()=>this._confirmDelete=!1,open:this._confirmDelete})}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"],locale:["localeWatchHandler"]}}};p.style=":host{display:block}.delete-modal{position:fixed}";const b=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editorInitialized=i(this,"editorInitialized",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this.enableEditGeometry=!1,this.enableSnapping=!1,this.graphicIndex=0,this.graphics=void 0,this.locale=void 0,this.mapView=void 0,this.open=!1,this._editorLoading=!1,this._translations=void 0}get el(){return e(this)}_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.length>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}closeEdit;editorInitialized;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{setTimeout((()=>{this.editsComplete.emit()}),50)})))}render(){const t=this._editorLoading?"display-none":"position-absolute",i=this._editorLoading?"":"display-none";return s(h,{key:"5d0380d4dbd7412c90e6e3b9aa28b580bf5a6ac4"},s("div",{key:"29825ee6c26acce86fcb6678d3e3db957358e314",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)),s("div",{key:"35fc876d6857fb72c8808cff311e894dd9890afe",class:"position-absolute"},s("div",{key:"c95f3453d5fc4dac7ba5f1e7db69490405861059",class:t,id:"feature-form",ref:t=>this._editContainer=t}),s("calcite-loader",{key:"211fd81ec4b13a731a895c882fafcb438fbf235c",class:i,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await o(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=await c(this.mapView),e=this.enableSnapping&&this.enableEditGeometry,s=i.map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({view:this.mapView,layerInfos:s,visibleElements:{flow:!0,settingsMenu:e,sketch:!1,snappingControls:e},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this.enableSnapping||t.classList.add("hide-editor-toolbar"),this._editContainer.appendChild(t),this.editorInitialized.emit(this._editor)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.length>0&&this.refreshGraphics.emit(this.graphics),this.enableSnapping&&(this.mapView.ui.view.grid=null),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};b.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-editor__panel-content{padding-block:10px !important}";const f=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.clearSelection=i(this,"clearSelection",7),this.selectionChanged=i(this,"selectionChanged",7),this.enableEditGeometry=!1,this.enableSnapping=!1,this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.locale=void 0,this.paginationEnabled=!0,this.position="absolute",this.showCloseBtn=!1,this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0,this._navigatedToRelatedFeature=void 0}get el(){return e(this)}Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;_relatedFeature;async graphicsWatchHandler(){this._navigatedToRelatedFeature&&this._features&&(this._features.clear(),this._features.close(),this._count="",this._navigatedToRelatedFeature=!1),await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}popupClosed;clearSelection;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.viewModel&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this._navigatedToRelatedFeature||(this.graphics=[...t.detail])}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new r}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",i=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",e=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",a=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",o=this._features?.features?.length<2||this._navigatedToRelatedFeature,n=this.isMobile?"display-none":"",c=this._features?.selectedFeature?.getObjectId(),d=parseInt(c?.toString(),10)>-1?[c]:[],r=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete,l=this._relatedFeature?[this._relatedFeature]:this.graphics,p=this._navigatedToRelatedFeature?0:this._features?.selectedFeatureIndex;return s(h,{key:"b62820abf5a5ce69261a7170dbc102ee8f656907"},s("calcite-shell",{key:"6c26e6c6e0247f96183ab7d300d2591c5beb5b94",style:{position:this.position}},this._getHeader(),s("calcite-loader",{key:"fc153dc30be352de54fd2d197e154cd09a8f39f2",class:t,label:this._translations.fetchingData}),s("div",{key:"8faba972e54dbc4086a5c74187279149c7bbfe6e",class:"esri-widget feature-node "+i,id:this._featuresNodeId}),s("div",{key:"3374bace58475d983d0b6b57c1c45faa6bddef6e",class:`${a} width-100`,slot:"footer"},this.allowEditing&&s("div",{key:"567ed97ca7a9a1d7245caa21ca23effe728b0ac9",class:"display-flex top-border padding-1-2"},s("calcite-button",{key:"caae5c4c5834bf7658bbe12c329ead2f8150f8cd",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&r?s("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:d,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,s("calcite-tooltip",{key:"57681bf90ac5d7c2a4bc9d3e15e3a93a675fbed1",placement:"bottom","reference-element":"solutions-edit"},s("span",{key:"018a661cd5f88ea5be62acbe762308ef25e7b681"},this._translations.edit)),this.isMobile&&r?s("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},s("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!o&&s("div",{key:"92ba3836a0b5fcd2717966ef6162e10968d43126",class:`display-flex padding-1-2 button-container top-border ${n}`},s("div",{key:"bf23c4f203efcea7c613d77d86efada639fa7c1b"},s("calcite-button",{key:"a416b24f360374e73679df9027b13f7651dbb723",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),s("calcite-tooltip",{key:"8849ca323a75d2fd21393a133f49c1ea201178d4",placement:"top","reference-element":"solutions-back"},s("span",{key:"84cd60a8c7a5678d99e2d803ebb705e986591cb5"},this._translations.back))),s("calcite-action",{key:"7d4e9984eda51a7b9d67bcc2bce3b258566bbeee",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},s("span",{key:"a14051ff8801623cc1dda9895f9bf98b5b4b8a36",class:"pagination-count"},this._count)),s("div",{key:"65bd33feeee7e1606548a9b21b9a3d1b78bc8931"},s("calcite-button",{key:"228969faa39e600546e8b9a00c888df4d00a6477",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),s("calcite-tooltip",{key:"8f343657583d421b7dbbd79067af998d11c30855",placement:"top","reference-element":"solutions-next"},s("span",{key:"98fc622e0ba9ae3878ac0cbc8c2c119fe5b4b489"},this._translations.next))))),s("edit-card",{key:"c99b429d633117c673a7c8effc7cb689233bce1e",class:e,enableEditGeometry:this.enableEditGeometry,enableSnapping:this.enableSnapping,graphicIndex:p,graphics:l,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{key:"82ac3ceb259b6f87b8bbbb196fcf61de705ed019",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{key:"f113eb60f51d3b1d9fddf9c58e89c792e41e95b5",slot:"title"},this._translations.editDisabled),s("div",{key:"c010ac376e6e3497d86326bcb1e16976a4a026cd",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await o(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features?.clear(),this._features?.close()),this._count=this._getCount()}async _initFeaturesWidget(){return void 0!==this.isMobile?await(this.mapView?.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=this.showCloseBtn,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:this._featuresNodeId,visibleElements:{actionBar:!1,closeButton:this.showCloseBtn,featureMenuHeading:!1,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{this._count=this._getCount(),t||(this._showListView=t)})),this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})),this.reactiveUtils.watch((()=>this._features.selectedDrillInFeature),(t=>{t?(this._relatedFeature=t,this._navigatedToRelatedFeature=!0):(this._relatedFeature=null,this._navigatedToRelatedFeature=!1)})),this.el.querySelector("#"+this._featuresNodeId).addEventListener("calciteFlowItemClose",(()=>{this.clearSelection.emit()})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?s("calcite-panel",{class:"border-width-0",slot:"header"},s("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),s("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),i=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",i)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};f.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}";export{l as create_feature,p as delete_button,b as edit_card,f as info_card}
@@ -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{g as r}from"./p-d4056c1c.js";import{_ as t}from"./p-4fe489cf.js";var n,o,e={exports:{}},i={exports:{}},u={exports:{}};o=t.exports.default,(n=u).exports=function(r,t){if("object"!=o(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var e=n.call(r,t||"default");if("object"!=o(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)},n.exports.__esModule=!0,n.exports.default=n.exports,function(r){var n=t.exports.default,o=u.exports;r.exports=function(r){var t=o(r,"string");return"symbol"==n(t)?t:t+""},r.exports.__esModule=!0,r.exports.default=r.exports}(i),function(r){var t=i.exports;r.exports=function(r,n,o){return(n=t(n))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r},r.exports.__esModule=!0,r.exports.default=r.exports}(e);const a=r(e.exports);var c={exports:{}};!function(r){function t(r,t,n,o,e,i,u){try{var a=r[i](u),c=a.value}catch(r){return void n(r)}a.done?t(c):Promise.resolve(c).then(o,e)}r.exports=function(r){return function(){var n=this,o=arguments;return new Promise((function(e,i){var u=r.apply(n,o);function a(r){t(u,e,i,a,c,"next",r)}function c(r){t(u,e,i,a,c,"throw",r)}a(void 0)}))}},r.exports.__esModule=!0,r.exports.default=r.exports}(c);const f=r(c.exports);export{f as _,a,e as d}
6
+ import{g as r}from"./p-d4056c1c.js";import{_ as t}from"./p-af7e43e0.js";var n,o,e={exports:{}},i={exports:{}},u={exports:{}};o=t.exports.default,(n=u).exports=function(r,t){if("object"!=o(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var e=n.call(r,t||"default");if("object"!=o(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)},n.exports.__esModule=!0,n.exports.default=n.exports,function(r){var n=t.exports.default,o=u.exports;r.exports=function(r){var t=o(r,"string");return"symbol"==n(t)?t:t+""},r.exports.__esModule=!0,r.exports.default=r.exports}(i),function(r){var t=i.exports;r.exports=function(r,n,o){return(n=t(n))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r},r.exports.__esModule=!0,r.exports.default=r.exports}(e);const a=r(e.exports);var c={exports:{}};!function(r){function t(r,t,n,o,e,i,u){try{var a=r[i](u),c=a.value}catch(r){return void n(r)}a.done?t(c):Promise.resolve(c).then(o,e)}r.exports=function(r){return function(){var n=this,o=arguments;return new Promise((function(e,i){var u=r.apply(n,o);function a(r){t(u,e,i,a,c,"next",r)}function c(r){t(u,e,i,a,c,"throw",r)}a(void 0)}))}},r.exports.__esModule=!0,r.exports.default=r.exports}(c);const f=r(c.exports);export{f as _,a,e as d}
@@ -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,g as s,a as e,h as a,H as l}from"./p-934e8935.js";import{b as o,c as n,a as h}from"./p-80cb7c73.js";import{l as c,g as r}from"./p-57be3b9d.js";import{e as d,h as p}from"./p-5693ce7a.js";import{s as g}from"./p-5e7369d1.js";import{c as b,r as m}from"./p-455c19fa.js";import"./p-d4056c1c.js";import"./p-c6e42ad1.js";import"./p-4fe489cf.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const f=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),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.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.initialNotice="",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}get el(){return s(this)}_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popupEnabled),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){if(this._checkPopups(),this.mapView?.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()}searchConfigurationChange;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=e("assets/data/images/onboarding.png")}render(){return a(l,{key:"48d98f3f0d6230fdec6227f7ba81250d38204d1c"},a("calcite-shell",{key:"cff88c2774df83a9b8af62910cfa4075ec8d61c0"},a("calcite-action-bar",{key:"eab17f993ae13af3f8bd06f8b0a66542799ea6f7",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"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===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"===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 a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("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(),i=t?this._translations.listHasSetsTip:""!==this.initialNotice?this.initialNotice:this._translations.selectLayerAndAdd;return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(i,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1",label:""},this._selectionSets.reduce(((t,i,s)=>{const e=this._getSelectionSetIds(i);let l=!0;return i.workflowType===h.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.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 a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableLayerFeaturesOnLoad:this.enableLayerFeaturesOnLoad,enableSearchDistance:this.enableSearchDistance,enableSearchDistanceOnLoad:this.enableSearchDistanceOnLoad,enableSketchTools:this.enableSketchTools,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,searchDistanceEnabled:this.enableSearchDistanceOnLoad,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol,useLayerFeaturesEnabled:this.enableLayerFeaturesOnLoad})),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 a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",overlayPositioning:"fixed",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("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:"",e=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${e}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${e}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,locale:this.locale,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",overlayPositioning:"fixed",referenceElement:"list-graphics-icon"},a("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 a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("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,e,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:s,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},e))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),e=i.workflowType!==h.REFINE||s.length>0;return!this._downloadActive&&i.download&&e&&(this._downloadActive=!0),e&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list",label:""},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))))))),t}),[])||a("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=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)=>{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 s=i?.layerView?.layer.id;t=this._updateExportInfos(t,s,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,e,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:e,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(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.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){d(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(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};f.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}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}';export{f as public_notification}
6
+ import{r as t,c as i,g as s,a as e,h as a,H as l}from"./p-934e8935.js";import{b as o,c as n,a as h}from"./p-80cb7c73.js";import{l as c,g as r}from"./p-8a74a780.js";import{e as d,h as p}from"./p-5693ce7a.js";import{s as g}from"./p-5e7369d1.js";import{c as b,r as m}from"./p-4379cc5f.js";import"./p-d4056c1c.js";import"./p-c6e42ad1.js";import"./p-af7e43e0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const f=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),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.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.initialNotice="",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}get el(){return s(this)}_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popupEnabled),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){if(this._checkPopups(),this.mapView?.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()}searchConfigurationChange;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=e("assets/data/images/onboarding.png")}render(){return a(l,{key:"48d98f3f0d6230fdec6227f7ba81250d38204d1c"},a("calcite-shell",{key:"cff88c2774df83a9b8af62910cfa4075ec8d61c0"},a("calcite-action-bar",{key:"eab17f993ae13af3f8bd06f8b0a66542799ea6f7",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"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===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"===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 a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("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(),i=t?this._translations.listHasSetsTip:""!==this.initialNotice?this.initialNotice:this._translations.selectLayerAndAdd;return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(i,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1",label:""},this._selectionSets.reduce(((t,i,s)=>{const e=this._getSelectionSetIds(i);let l=!0;return i.workflowType===h.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.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 a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableLayerFeaturesOnLoad:this.enableLayerFeaturesOnLoad,enableSearchDistance:this.enableSearchDistance,enableSearchDistanceOnLoad:this.enableSearchDistanceOnLoad,enableSketchTools:this.enableSketchTools,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,searchDistanceEnabled:this.enableSearchDistanceOnLoad,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol,useLayerFeaturesEnabled:this.enableLayerFeaturesOnLoad})),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 a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",overlayPositioning:"fixed",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("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:"",e=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${e}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${e}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,locale:this.locale,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",overlayPositioning:"fixed",referenceElement:"list-graphics-icon"},a("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 a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("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,e,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:s,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},e))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),e=i.workflowType!==h.REFINE||s.length>0;return!this._downloadActive&&i.download&&e&&(this._downloadActive=!0),e&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list",label:""},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))))))),t}),[])||a("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=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)=>{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 s=i?.layerView?.layer.id;t=this._updateExportInfos(t,s,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,e,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:e,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(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.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){d(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(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};f.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}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}';export{f as public_notification}