@esri/solutions-components 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +2 -2
- package/dist/cjs/buffer-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-alert_4.cjs.entry.js +12 -10
- package/dist/cjs/calcite-block_5.cjs.entry.js +4 -4
- package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-flow_6.cjs.entry.js +2 -2
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +5 -5
- package/dist/cjs/card-manager_3.cjs.entry.js +7 -6
- package/dist/cjs/{common-4d4cf291.js → common-61b41813.js} +1 -1
- package/dist/cjs/consent-manager.cjs.entry.js +2 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +5 -6
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +2 -2
- package/dist/cjs/{downloadUtils-48ffc5b3.js → downloadUtils-b757205e.js} +5 -5
- package/dist/cjs/feature-list.cjs.entry.js +6 -6
- package/dist/cjs/{helpers-6f7660d4.js → helpers-1deec961.js} +1 -1
- package/dist/cjs/{index.es-9e361fa2.js → index.es-6c8b7d64.js} +5 -5
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-create.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-export-views.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-export.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-header.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-popover.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-sign-in.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-splash.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-time-filter.cjs.entry.js +4 -4
- package/dist/cjs/{languageSwitcher-f0bb94fa.js → languageSwitcher-dc2dd354.js} +1 -1
- package/dist/cjs/{languageUtil-f22ce913.js → languageUtil-a3e1eafd.js} +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +2 -2
- package/dist/cjs/{loadModules-36d49819.js → loadModules-8567855e.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-2dc1252d.js → locale-4e7fe921.js} +1 -1
- package/dist/cjs/{locale-239118c6.js → locale-a1bcb6eb.js} +2 -2
- package/dist/cjs/map-select-tools_3.cjs.entry.js +33 -24
- package/dist/cjs/{popupUtils-b771f498.js → popupUtils-2b5ec788.js} +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +13 -10
- package/dist/cjs/{restHelpersGet-88ba0e25.js → restHelpersGet-bf484fda.js} +24 -20
- package/dist/cjs/solution-configuration.cjs.entry.js +6 -6
- package/dist/cjs/solution-contents_3.cjs.entry.js +6 -6
- package/dist/cjs/{solution-resource-16c7510c.js → solution-resource-57cf345b.js} +1 -1
- package/dist/cjs/{solution-store-747a28ab.js → solution-store-71bb46fa.js} +65 -58
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +4 -4
- package/dist/cjs/store-manager.cjs.entry.js +4 -4
- package/dist/cjs/{templates-2f44c01b.js → templates-e4b98319.js} +2 -2
- package/dist/cjs/{utils-e486aa01.js → utils-b43fe04f.js} +1 -1
- package/dist/collection/components/card-manager/card-manager.js +20 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +3 -22
- package/dist/collection/components/edit-card/edit-card.js +21 -2
- package/dist/collection/components/info-card/info-card.js +21 -2
- package/dist/collection/components/map-select-tools/map-select-tools.js +81 -18
- package/dist/collection/components/public-notification/public-notification.js +62 -5
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/utils/interfaces.ts +3 -0
- package/dist/collection/utils/pdfUtils.js +1 -1
- package/dist/collection/utils/pdfUtils.ts +1 -1
- package/dist/components/card-manager2.js +3 -1
- package/dist/components/crowdsource-manager.js +3 -5
- package/dist/components/downloadUtils.js +1 -1
- package/dist/components/edit-card2.js +4 -2
- package/dist/components/info-card2.js +4 -2
- package/dist/components/map-select-tools2.js +30 -18
- package/dist/components/public-notification.js +11 -5
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/restHelpersGet.js +23 -19
- package/dist/components/solution-resource.js +1 -1
- package/dist/components/solution-store.js +63 -56
- package/dist/esm/basemap-gallery_7.entry.js +2 -2
- package/dist/esm/buffer-tools_3.entry.js +2 -2
- package/dist/esm/calcite-action-pad_2.entry.js +2 -2
- package/dist/esm/calcite-alert_4.entry.js +12 -10
- package/dist/esm/calcite-block_5.entry.js +4 -4
- package/dist/esm/calcite-dropdown-group_2.entry.js +2 -2
- package/dist/esm/calcite-flow_6.entry.js +2 -2
- package/dist/esm/calcite-shell-panel_14.entry.js +5 -5
- package/dist/esm/card-manager_3.entry.js +7 -6
- package/dist/esm/{common-3b99e350.js → common-1618d62f.js} +1 -1
- package/dist/esm/consent-manager.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +5 -6
- package/dist/esm/crowdsource-reporter.entry.js +2 -2
- package/dist/esm/{downloadUtils-abb8cda2.js → downloadUtils-16c51b10.js} +5 -5
- package/dist/esm/feature-list.entry.js +6 -6
- package/dist/esm/{helpers-62213648.js → helpers-2298687e.js} +1 -1
- package/dist/esm/{index.es-9283e62c.js → index.es-d950915a.js} +5 -5
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +5 -5
- package/dist/esm/instant-apps-control-panel.entry.js +2 -2
- package/dist/esm/instant-apps-create.entry.js +4 -4
- package/dist/esm/instant-apps-export-views.entry.js +4 -4
- package/dist/esm/instant-apps-export.entry.js +4 -4
- package/dist/esm/instant-apps-header.entry.js +2 -2
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend.entry.js +5 -5
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +4 -4
- package/dist/esm/instant-apps-language-switcher.entry.js +6 -6
- package/dist/esm/instant-apps-language-translator.entry.js +6 -6
- package/dist/esm/instant-apps-measurement.entry.js +4 -4
- package/dist/esm/instant-apps-popover.entry.js +4 -4
- package/dist/esm/instant-apps-scoreboard.entry.js +4 -4
- package/dist/esm/instant-apps-sign-in.entry.js +4 -4
- package/dist/esm/instant-apps-splash.entry.js +4 -4
- package/dist/esm/instant-apps-time-filter.entry.js +4 -4
- package/dist/esm/{languageSwitcher-b665499d.js → languageSwitcher-9db90f1e.js} +1 -1
- package/dist/esm/{languageUtil-a3e6adf6.js → languageUtil-2b6e191a.js} +1 -1
- package/dist/esm/layout-manager.entry.js +2 -2
- package/dist/esm/{loadModules-9c062d08.js → loadModules-03ba7abe.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-e758c2ee.js → locale-7162b55a.js} +1 -1
- package/dist/esm/{locale-35ebf4af.js → locale-adb5ff0b.js} +2 -2
- package/dist/esm/map-select-tools_3.entry.js +33 -24
- package/dist/esm/{popupUtils-9b2b0aba.js → popupUtils-44f11275.js} +2 -2
- package/dist/esm/public-notification.entry.js +13 -10
- package/dist/esm/{restHelpersGet-788d7f7b.js → restHelpersGet-0a15c2f4.js} +24 -20
- package/dist/esm/solution-configuration.entry.js +6 -6
- package/dist/esm/solution-contents_3.entry.js +6 -6
- package/dist/esm/{solution-resource-966f8511.js → solution-resource-ab63a236.js} +1 -1
- package/dist/esm/{solution-store-0586e891.js → solution-store-e2690620.js} +65 -58
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +4 -4
- package/dist/esm/store-manager.entry.js +4 -4
- package/dist/esm/{templates-9330d7b8.js → templates-9556eb87.js} +2 -2
- package/dist/esm/{utils-72a48b01.js → utils-178e7afe.js} +1 -1
- package/dist/solutions-components/{p-71452a4e.entry.js → p-002c97df.entry.js} +1 -1
- package/dist/solutions-components/{p-08b0e478.js → p-00b26aac.js} +2 -2
- package/dist/solutions-components/{p-f2ac5d0e.js → p-1904654e.js} +1 -1
- package/dist/solutions-components/{p-e9aba912.entry.js → p-1b9aa18e.entry.js} +1 -1
- package/dist/solutions-components/p-235bf02e.entry.js +6 -0
- package/dist/solutions-components/{p-beeccd19.entry.js → p-24b3aedc.entry.js} +1 -1
- package/dist/solutions-components/p-2727a29c.entry.js +6 -0
- package/dist/solutions-components/{p-f067a46c.js → p-2fa78dd8.js} +1 -1
- package/dist/solutions-components/{p-c742acd9.js → p-2fc63144.js} +1 -1
- package/dist/solutions-components/{p-65283b75.entry.js → p-3438cbc4.entry.js} +1 -1
- package/dist/solutions-components/{p-1176ec70.entry.js → p-38cfa3cd.entry.js} +1 -1
- package/dist/solutions-components/p-3b426576.entry.js +6 -0
- package/dist/solutions-components/{p-de30afd0.entry.js → p-425a1dab.entry.js} +1 -1
- package/dist/solutions-components/{p-29962ae5.entry.js → p-4848b48f.entry.js} +1 -1
- package/dist/solutions-components/{p-73ef6866.js → p-4b3cc01f.js} +3 -3
- package/dist/solutions-components/{p-65581d83.js → p-4cd4cb85.js} +1 -1
- package/dist/solutions-components/{p-2d03b0d7.entry.js → p-5b818d29.entry.js} +1 -1
- package/dist/solutions-components/{p-787a4789.entry.js → p-5c999087.entry.js} +1 -1
- package/dist/solutions-components/{p-32f5c6ec.entry.js → p-69cfa9e6.entry.js} +1 -1
- package/dist/solutions-components/{p-51cfb4a6.entry.js → p-6b30ca36.entry.js} +1 -1
- package/dist/solutions-components/{p-4b843bc0.entry.js → p-6de944af.entry.js} +1 -1
- package/dist/solutions-components/{p-4a0838c0.entry.js → p-78712b70.entry.js} +1 -1
- package/dist/solutions-components/{p-ee87a7b0.entry.js → p-7af4c00e.entry.js} +3 -3
- package/dist/solutions-components/{p-09d62c22.js → p-7bfecd07.js} +1 -1
- package/dist/solutions-components/{p-07053ee3.entry.js → p-80e6c7cb.entry.js} +1 -1
- package/dist/solutions-components/{p-ef493a84.entry.js → p-86e6b5b3.entry.js} +1 -1
- package/dist/solutions-components/{p-81f62cf5.entry.js → p-88d4db61.entry.js} +1 -1
- package/dist/solutions-components/{p-13f83a1a.entry.js → p-8a6fa619.entry.js} +1 -1
- package/dist/solutions-components/{p-e05894a6.entry.js → p-8b999a2b.entry.js} +1 -1
- package/dist/solutions-components/{p-614edd9f.entry.js → p-8e8b92b4.entry.js} +1 -1
- package/dist/solutions-components/{p-a759e0e5.js → p-90d6755b.js} +1 -1
- package/dist/solutions-components/{p-f4828ba4.entry.js → p-932f22b5.entry.js} +1 -1
- package/dist/solutions-components/{p-afad4f05.js → p-a091bc9a.js} +1 -1
- package/dist/solutions-components/{p-a7b05a79.entry.js → p-a22b8cc1.entry.js} +1 -1
- package/dist/solutions-components/{p-a7710355.js → p-a860f365.js} +8 -7
- package/dist/solutions-components/{p-2cff27c5.js → p-a8e6463b.js} +2 -2
- package/dist/solutions-components/{p-7efb5ef0.entry.js → p-a9818be2.entry.js} +1 -1
- package/dist/solutions-components/{p-3e84a420.entry.js → p-ab2adcaf.entry.js} +1 -1
- package/dist/solutions-components/{p-4c0b8e55.entry.js → p-abc9e858.entry.js} +1 -1
- package/dist/solutions-components/{p-af2c8aa9.js → p-ac122d9e.js} +1 -1
- package/dist/solutions-components/{p-ed9b7fa1.entry.js → p-b19ca04e.entry.js} +1 -1
- package/dist/solutions-components/{p-fb0fdc0d.entry.js → p-b7cec3bd.entry.js} +1 -1
- package/dist/solutions-components/p-b80bcd0b.entry.js +6 -0
- package/dist/solutions-components/{p-92744164.entry.js → p-b850796d.entry.js} +1 -1
- package/dist/solutions-components/{p-7c583516.js → p-badcaf04.js} +1 -1
- package/dist/solutions-components/{p-a2150807.entry.js → p-c6473b38.entry.js} +1 -1
- package/dist/solutions-components/{p-f341b87e.entry.js → p-d57736d0.entry.js} +1 -1
- package/dist/solutions-components/{p-09b47605.js → p-d7868dd4.js} +1 -1
- package/dist/solutions-components/{p-f7d822f7.entry.js → p-d8047d8f.entry.js} +1 -1
- package/dist/solutions-components/{p-386429a4.entry.js → p-dc17b638.entry.js} +1 -1
- package/dist/solutions-components/{p-02d3d3e9.entry.js → p-e3e593db.entry.js} +2 -2
- package/dist/solutions-components/{p-00786a30.entry.js → p-edd70ba3.entry.js} +1 -1
- package/dist/solutions-components/{p-6f836c0a.entry.js → p-ef6567ae.entry.js} +1 -1
- package/dist/solutions-components/{p-0bf41dfd.entry.js → p-f59b4183.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +3 -0
- package/dist/solutions-components/utils/pdfUtils.ts +1 -1
- package/dist/types/components/card-manager/card-manager.d.ts +4 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +0 -4
- package/dist/types/components/edit-card/edit-card.d.ts +4 -0
- package/dist/types/components/info-card/info-card.d.ts +4 -0
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +12 -0
- package/dist/types/components/public-notification/public-notification.d.ts +12 -0
- package/dist/types/components.d.ts +72 -8
- package/dist/types/utils/interfaces.d.ts +3 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-2977bdbf.entry.js +0 -6
- package/dist/solutions-components/p-d0432926.entry.js +0 -6
- package/dist/solutions-components/p-d1fd4a53.entry.js +0 -6
- package/dist/solutions-components/p-f26423c7.entry.js +0 -6
- package/dist/solutions-components_commit.txt +0 -8
- /package/dist/cjs/{esri-loader-a56cbcbe.js → esri-loader-08dc41bd.js} +0 -0
- /package/dist/esm/{esri-loader-781d738a.js → esri-loader-c6842c6b.js} +0 -0
- /package/dist/solutions-components/{p-6a68306c.js → p-0a24ad5f.js} +0 -0
- /package/dist/solutions-components/{p-659678f1.js → p-9fe07c30.js} +0 -0
@@ -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 a,c as t,h as n,H as s,F as e,g as i}from"./p-f4c4a2b7.js";import{g as r,a as l,s as o,E as c,b as p,l as g,c as u}from"./p-afad4f05.js";import{l as d}from"./p-65581d83.js";import{c as h}from"./p-09d62c22.js";import{g as v,f as m}from"./p-c742acd9.js";import"./p-dcc35070.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";const _="instant-apps-language-translator",b={BASE:_,header:`${_}__header`,headerText:`${_}__header-text`,savingIndicator:`${_}__saving-indicator`,closeButton:`${_}__close-button`,headerTip:`${_}__header-tip`,topBar:`${_}__top-bar`,topBarSection:`${_}__top-bar-section`,collapseSearchContainer:`${_}__collapse-search-container`,userLangText:`${_}__user-lang-text`,lastItem:`${_}--last-item`,writingIcon:`${_}__writing-icon`},f=class{constructor(n){a(this,n),this.translatorDataUpdated=t(this,"translatorDataUpdated",7),this.portalItem=void 0,this.appSettings=void 0,this.locales=void 0,this.open=!1,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0,this.saving=!1,this.messages=void 0,this.isCollapse=!0}handleT9nItemUpdate(){this.translatorDataUpdated.emit()}handleLocaleChange(){this.initUIData(),this.initSelectLanguage()}handleAppSettings(){this.initUIData(),this.initSelectLanguage()}async componentDidLoad(){this.initialize()}async initialize(){const[a,t]=await d(["esri/intl","esri/request"]);this.intl=a,this.request=t,await this.initMessages(),this.initUIData(),this.initPortalItemResourceT9nData(),this.initSelectLanguage()}async initMessages(){try{const{el:a}=this,t=await r(a);return this.messages=t,Promise.resolve()}catch(a){return Promise.reject()}}initUIData(){const{appSettings:a,locales:t}=this,n=l(a,t);o.set("uiData",n)}initSelectLanguage(){var a,t;if(!this.intl)return;const{locales:n}=this,s=null!==(t=null===(a=null==n?void 0:n[0])||void 0===a?void 0:a.locale)&&void 0!==t?t:this.intl.getLocale(),e=o.get("currentLanguage");0===this.locales.filter((a=>a.locale===e)).length&&o.set("currentLanguage",s)}async initPortalItemResourceT9nData(){try{const a=await v(this.portalItem);o.set("portalItemResource",a);const t=await m(this.request,a);o.set("portalItemResourceT9n",null!=t?t:{})}catch(a){}}render(){return n(s,{key:"23aee2b74a94bcc3caae9aee35ab7d1f2f378a04"},this.renderModal(),this.renderPopoverTip())}renderModal(){return n("calcite-modal",{open:this.open,scale:"l",fullscreen:!0,onCalciteModalClose:this.close.bind(this)},this.renderHeader(),this.renderContent(),this.renderPrimaryButton())}renderPopoverTip(){var a;return n("calcite-popover",{label:"",referenceElement:"headerTip",placement:"trailing","auto-close":!0,closable:!0},n("div",{class:b.headerTip},null===(a=this.messages)||void 0===a?void 0:a.headerTip))}renderHeader(){const a=o.get("saving");return n("header",{class:b.header,slot:"header"},this.renderHeaderText(),a?this.renderSavingIndicator():null)}renderHeaderText(){const{messages:a}=this;return n("div",{class:b.headerText},n("span",null,null==a?void 0:a.header),n("calcite-button",{id:"headerTip",appearance:"transparent"},n("calcite-icon",{icon:c.Popover,scale:"s"})))}renderSavingIndicator(){var a;const t=o.get("saving"),s=null===(a=this.messages)||void 0===a?void 0:a.saving;return n("div",{class:b.savingIndicator},t?n("calcite-loader",{label:s,inline:!0}):null,n("span",null,s))}renderContent(){const a=p(this.locales);return n("div",{slot:"content"},this.renderTopBar(),(null==a?void 0:a.length)>0?this.renderUIData():this.renderNotice())}renderTopBar(){return n("div",{class:b.topBar},this.renderLeadingTopBarSection(),this.renderTrailingTopBarSection())}renderLeadingTopBarSection(){return n("div",{class:b.topBarSection},this.renderUserLocale(),this.renderCollapseSearchContainer())}renderUserLocale(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.languages,s=h();return n("div",{class:b.userLangText},null==t?void 0:t[s])}renderCollapseSearchContainer(){return n("div",{class:b.collapseSearchContainer},this.renderExpandCollapseButton(),this.renderSearch())}renderExpandCollapseButton(){const{isCollapse:a,messages:t}=this,s=a?null==t?void 0:t.collapseAll:null==t?void 0:t.expandAll;return n(e,null,n("slot",{name:"primary-custom-action"}),n("slot",{name:"secondary-custom-action"}),n("calcite-button",{onClick:this.handleExpandCollapseAll.bind(this),appearance:"transparent","icon-start":c.ExpandCollapse},s))}renderSearch(){var a;return n("instant-apps-language-translator-search",{onSuggestionSelected:this.onSuggestionSelect.bind(this),t9nPlaceholder:null===(a=this.messages)||void 0===a?void 0:a.searchPlaceholder})}renderTrailingTopBarSection(){return n("div",{class:b.topBarSection},this.renderLanguageSelection(),n("slot",{name:"translation-custom-action"}))}renderLanguageSelection(){var a;return n("calcite-label",{layout:"inline"},null===(a=this.messages)||void 0===a?void 0:a.translatedLanguage,n("calcite-select",{label:"",onCalciteSelectChange:this.handleLanguageSelection.bind(this)},this.renderTranslatedLangOptions()))}renderTranslatedLangOptions(){const a=o.get("uiData"),t=null==a?void 0:a.get("locales"),s=p(t);return null==s?void 0:s.map((a=>{const{messages:t}=this,s=null==t?void 0:t.translatedLanguageNames,e=null==t?void 0:t.languages;return n("calcite-option",{key:`translated-lang-option-${a}`,value:a},`${null==s?void 0:s[a]} - ${null==e?void 0:e[a]}`)}))}renderUIData(){if(!(null==g?void 0:g.uiData))return;const a=u();return n("div",null,null==a?void 0:a.map(((t,n)=>this.renderUIDataItem(t,n,a.length))))}renderNotice(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.noLanguage;return n("calcite-notice",{open:!0,icon:"exclamation-mark-triangle",kind:"warning"},n("div",{slot:"title"},null==t?void 0:t.title),n("div",{slot:"message"},null==t?void 0:t.message))}renderUIDataItem(a,t,s){var e,i;const r=null===(i=null===(e=this.appSettings)||void 0===e?void 0:e.translatedLanguageLabels)||void 0===i?void 0:i[g.currentLanguage],l=`${t===s-1?b.lastItem:""}`,o=this.appSettings.content.filter((t=>t.id===a))[0];return n("instant-apps-language-translator-item",{key:`${a}-${t}`,class:l,fieldName:a,translatedLanguageLabels:r,setting:o,userLocaleInputOnChangeCallback:this.userLocaleInputOnChangeCallback,translatedLocaleInputOnChangeCallback:this.translatedLocaleInputOnChangeCallback})}renderPrimaryButton(){var a;return n("calcite-button",{onClick:()=>this.open=!1,slot:"primary",class:b.closeButton},null===(a=this.messages)||void 0===a?void 0:a.close)}handleExpandCollapseAll(){this.isCollapse=!this.isCollapse;const a=new Map(g.uiData);u().forEach((t=>a.get(t).expanded=this.isCollapse)),o.set("uiData",a)}onSuggestionSelect(a){const t=a.detail,n=new Map(g.uiData);u().forEach((a=>{n.get(a).selected=a===t})),o.set("uiData",n)}close(){this.open=!1}handleLanguageSelection(a){o.set("currentLanguage",a.target.value)}async getTranslationData(){return o.get("portalItemResourceT9n")}async setTranslationData(a){return o.set("portalItemResourceT9n",a)}async getPortalItemResource(){return o.get("portalItemResource")}async batchWriteToPortalItemResource(a){o.set("saving",!0);try{const t=await this.getPortalItemResource(),n=JSON.stringify(a),s=new Blob([n],{type:"application/json"});return await t.update(s),setTimeout((()=>o.set("saving",!1)),1500),this.translatorDataUpdated.emit(),Promise.resolve()}catch(a){return console.error("Error writing to portal item resource: ",a),o.set("saving",!1),Promise.reject()}}get el(){return i(this)}static get watchers(){return{locales:["handleLocaleChange"],appSettings:["handleAppSettings"]}}};f.style=".sc-instant-apps-language-translator-h{display:block}.sc-instant-apps-language-translator-h calcite-modal.sc-instant-apps-language-translator{--calcite-modal-content-padding:0}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header.sc-instant-apps-language-translator{display:flex;justify-content:space-between;width:100%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-text.sc-instant-apps-language-translator{font-size:18px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__saving-indicator.sc-instant-apps-language-translator{display:flex;align-items:center;font-size:14.5px;color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__writing-icon.sc-instant-apps-language-translator{display:flex;justify-content:center;align-items:center;margin-right:5px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__close-button.sc-instant-apps-language-translator{width:175px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-tip.sc-instant-apps-language-translator{padding:20px;max-width:45vw}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator{display:flex;width:100%;position:sticky;top:0;background:var(--calcite-color-foreground-1);z-index:1}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator calcite-label.sc-instant-apps-language-translator{--calcite-label-margin-bottom:0;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator{box-sizing:border-box;display:flex;align-items:center;width:50%;padding:0.5%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__user-lang-text.sc-instant-apps-language-translator{font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:first-child{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:nth-child(2) calcite-select.sc-instant-apps-language-translator{width:255px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator calcite-input.sc-instant-apps-language-translator{width:300px;margin-left:30px}.ck.ck-reset.ck-editor.ck-rounded-corners.sc-instant-apps-language-translator{margin-top:10px !important;margin-left:55px !important}.ck-editor__editable.sc-instant-apps-language-translator{height:70px !important;font-size:0.875rem !important;line-height:1.375 !important}.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:first-child,.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:last-child{--ck-spacing-large:0.5rem !important}";export{f as instant_apps_language_translator}
|
6
|
+
import{r as a,c as t,h as n,H as s,F as e,g as i}from"./p-f4c4a2b7.js";import{g as r,a as l,s as o,E as c,b as p,l as g,c as u}from"./p-a091bc9a.js";import{l as d}from"./p-4cd4cb85.js";import{c as h}from"./p-7bfecd07.js";import{g as v,f as m}from"./p-2fc63144.js";import"./p-dcc35070.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const _="instant-apps-language-translator",b={BASE:_,header:`${_}__header`,headerText:`${_}__header-text`,savingIndicator:`${_}__saving-indicator`,closeButton:`${_}__close-button`,headerTip:`${_}__header-tip`,topBar:`${_}__top-bar`,topBarSection:`${_}__top-bar-section`,collapseSearchContainer:`${_}__collapse-search-container`,userLangText:`${_}__user-lang-text`,lastItem:`${_}--last-item`,writingIcon:`${_}__writing-icon`},f=class{constructor(n){a(this,n),this.translatorDataUpdated=t(this,"translatorDataUpdated",7),this.portalItem=void 0,this.appSettings=void 0,this.locales=void 0,this.open=!1,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0,this.saving=!1,this.messages=void 0,this.isCollapse=!0}handleT9nItemUpdate(){this.translatorDataUpdated.emit()}handleLocaleChange(){this.initUIData(),this.initSelectLanguage()}handleAppSettings(){this.initUIData(),this.initSelectLanguage()}async componentDidLoad(){this.initialize()}async initialize(){const[a,t]=await d(["esri/intl","esri/request"]);this.intl=a,this.request=t,await this.initMessages(),this.initUIData(),this.initPortalItemResourceT9nData(),this.initSelectLanguage()}async initMessages(){try{const{el:a}=this,t=await r(a);return this.messages=t,Promise.resolve()}catch(a){return Promise.reject()}}initUIData(){const{appSettings:a,locales:t}=this,n=l(a,t);o.set("uiData",n)}initSelectLanguage(){var a,t;if(!this.intl)return;const{locales:n}=this,s=null!==(t=null===(a=null==n?void 0:n[0])||void 0===a?void 0:a.locale)&&void 0!==t?t:this.intl.getLocale(),e=o.get("currentLanguage");0===this.locales.filter((a=>a.locale===e)).length&&o.set("currentLanguage",s)}async initPortalItemResourceT9nData(){try{const a=await v(this.portalItem);o.set("portalItemResource",a);const t=await m(this.request,a);o.set("portalItemResourceT9n",null!=t?t:{})}catch(a){}}render(){return n(s,{key:"23aee2b74a94bcc3caae9aee35ab7d1f2f378a04"},this.renderModal(),this.renderPopoverTip())}renderModal(){return n("calcite-modal",{open:this.open,scale:"l",fullscreen:!0,onCalciteModalClose:this.close.bind(this)},this.renderHeader(),this.renderContent(),this.renderPrimaryButton())}renderPopoverTip(){var a;return n("calcite-popover",{label:"",referenceElement:"headerTip",placement:"trailing","auto-close":!0,closable:!0},n("div",{class:b.headerTip},null===(a=this.messages)||void 0===a?void 0:a.headerTip))}renderHeader(){const a=o.get("saving");return n("header",{class:b.header,slot:"header"},this.renderHeaderText(),a?this.renderSavingIndicator():null)}renderHeaderText(){const{messages:a}=this;return n("div",{class:b.headerText},n("span",null,null==a?void 0:a.header),n("calcite-button",{id:"headerTip",appearance:"transparent"},n("calcite-icon",{icon:c.Popover,scale:"s"})))}renderSavingIndicator(){var a;const t=o.get("saving"),s=null===(a=this.messages)||void 0===a?void 0:a.saving;return n("div",{class:b.savingIndicator},t?n("calcite-loader",{label:s,inline:!0}):null,n("span",null,s))}renderContent(){const a=p(this.locales);return n("div",{slot:"content"},this.renderTopBar(),(null==a?void 0:a.length)>0?this.renderUIData():this.renderNotice())}renderTopBar(){return n("div",{class:b.topBar},this.renderLeadingTopBarSection(),this.renderTrailingTopBarSection())}renderLeadingTopBarSection(){return n("div",{class:b.topBarSection},this.renderUserLocale(),this.renderCollapseSearchContainer())}renderUserLocale(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.languages,s=h();return n("div",{class:b.userLangText},null==t?void 0:t[s])}renderCollapseSearchContainer(){return n("div",{class:b.collapseSearchContainer},this.renderExpandCollapseButton(),this.renderSearch())}renderExpandCollapseButton(){const{isCollapse:a,messages:t}=this,s=a?null==t?void 0:t.collapseAll:null==t?void 0:t.expandAll;return n(e,null,n("slot",{name:"primary-custom-action"}),n("slot",{name:"secondary-custom-action"}),n("calcite-button",{onClick:this.handleExpandCollapseAll.bind(this),appearance:"transparent","icon-start":c.ExpandCollapse},s))}renderSearch(){var a;return n("instant-apps-language-translator-search",{onSuggestionSelected:this.onSuggestionSelect.bind(this),t9nPlaceholder:null===(a=this.messages)||void 0===a?void 0:a.searchPlaceholder})}renderTrailingTopBarSection(){return n("div",{class:b.topBarSection},this.renderLanguageSelection(),n("slot",{name:"translation-custom-action"}))}renderLanguageSelection(){var a;return n("calcite-label",{layout:"inline"},null===(a=this.messages)||void 0===a?void 0:a.translatedLanguage,n("calcite-select",{label:"",onCalciteSelectChange:this.handleLanguageSelection.bind(this)},this.renderTranslatedLangOptions()))}renderTranslatedLangOptions(){const a=o.get("uiData"),t=null==a?void 0:a.get("locales"),s=p(t);return null==s?void 0:s.map((a=>{const{messages:t}=this,s=null==t?void 0:t.translatedLanguageNames,e=null==t?void 0:t.languages;return n("calcite-option",{key:`translated-lang-option-${a}`,value:a},`${null==s?void 0:s[a]} - ${null==e?void 0:e[a]}`)}))}renderUIData(){if(!(null==g?void 0:g.uiData))return;const a=u();return n("div",null,null==a?void 0:a.map(((t,n)=>this.renderUIDataItem(t,n,a.length))))}renderNotice(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.noLanguage;return n("calcite-notice",{open:!0,icon:"exclamation-mark-triangle",kind:"warning"},n("div",{slot:"title"},null==t?void 0:t.title),n("div",{slot:"message"},null==t?void 0:t.message))}renderUIDataItem(a,t,s){var e,i;const r=null===(i=null===(e=this.appSettings)||void 0===e?void 0:e.translatedLanguageLabels)||void 0===i?void 0:i[g.currentLanguage],l=`${t===s-1?b.lastItem:""}`,o=this.appSettings.content.filter((t=>t.id===a))[0];return n("instant-apps-language-translator-item",{key:`${a}-${t}`,class:l,fieldName:a,translatedLanguageLabels:r,setting:o,userLocaleInputOnChangeCallback:this.userLocaleInputOnChangeCallback,translatedLocaleInputOnChangeCallback:this.translatedLocaleInputOnChangeCallback})}renderPrimaryButton(){var a;return n("calcite-button",{onClick:()=>this.open=!1,slot:"primary",class:b.closeButton},null===(a=this.messages)||void 0===a?void 0:a.close)}handleExpandCollapseAll(){this.isCollapse=!this.isCollapse;const a=new Map(g.uiData);u().forEach((t=>a.get(t).expanded=this.isCollapse)),o.set("uiData",a)}onSuggestionSelect(a){const t=a.detail,n=new Map(g.uiData);u().forEach((a=>{n.get(a).selected=a===t})),o.set("uiData",n)}close(){this.open=!1}handleLanguageSelection(a){o.set("currentLanguage",a.target.value)}async getTranslationData(){return o.get("portalItemResourceT9n")}async setTranslationData(a){return o.set("portalItemResourceT9n",a)}async getPortalItemResource(){return o.get("portalItemResource")}async batchWriteToPortalItemResource(a){o.set("saving",!0);try{const t=await this.getPortalItemResource(),n=JSON.stringify(a),s=new Blob([n],{type:"application/json"});return await t.update(s),setTimeout((()=>o.set("saving",!1)),1500),this.translatorDataUpdated.emit(),Promise.resolve()}catch(a){return console.error("Error writing to portal item resource: ",a),o.set("saving",!1),Promise.reject()}}get el(){return i(this)}static get watchers(){return{locales:["handleLocaleChange"],appSettings:["handleAppSettings"]}}};f.style=".sc-instant-apps-language-translator-h{display:block}.sc-instant-apps-language-translator-h calcite-modal.sc-instant-apps-language-translator{--calcite-modal-content-padding:0}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header.sc-instant-apps-language-translator{display:flex;justify-content:space-between;width:100%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-text.sc-instant-apps-language-translator{font-size:18px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__saving-indicator.sc-instant-apps-language-translator{display:flex;align-items:center;font-size:14.5px;color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__writing-icon.sc-instant-apps-language-translator{display:flex;justify-content:center;align-items:center;margin-right:5px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__close-button.sc-instant-apps-language-translator{width:175px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-tip.sc-instant-apps-language-translator{padding:20px;max-width:45vw}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator{display:flex;width:100%;position:sticky;top:0;background:var(--calcite-color-foreground-1);z-index:1}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator calcite-label.sc-instant-apps-language-translator{--calcite-label-margin-bottom:0;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator{box-sizing:border-box;display:flex;align-items:center;width:50%;padding:0.5%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__user-lang-text.sc-instant-apps-language-translator{font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:first-child{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:nth-child(2) calcite-select.sc-instant-apps-language-translator{width:255px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator calcite-input.sc-instant-apps-language-translator{width:300px;margin-left:30px}.ck.ck-reset.ck-editor.ck-rounded-corners.sc-instant-apps-language-translator{margin-top:10px !important;margin-left:55px !important}.ck-editor__editable.sc-instant-apps-language-translator{height:70px !important;font-size:0.875rem !important;line-height:1.375 !important}.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:first-child,.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:last-child{--ck-spacing-large:0.5rem !important}";export{f as instant_apps_language_translator}
|
@@ -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{g as t}from"./p-d4056c1c.js";import{a as n}from"./p-f4c4a2b7.js";import{l as i}from"./p-
|
6
|
+
import{g as t}from"./p-d4056c1c.js";import{a as n}from"./p-f4c4a2b7.js";import{l as i}from"./p-d7868dd4.js";import{q as r}from"./p-eb483242.js";import"./p-9fe07c30.js";import{_ as e,r as s,c as o,g as a}from"./p-badcaf04.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)
|
@@ -310,7 +310,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
|
|
310
310
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
311
311
|
* ====================================================================
|
312
312
|
*/
|
313
|
-
function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-
|
313
|
+
function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-90d6755b.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
|
314
314
|
/** ====================================================================
|
315
315
|
* @license
|
316
316
|
* jsPDF XMP metadata plugin
|
@@ -486,4 +486,4 @@ function(t,n){const i=n.map((t=>Object.values(t).map((t=>`"${t}"`)).join(",")+"\
|
|
486
486
|
* See the License for the specific language governing permissions and
|
487
487
|
* limitations under the License.
|
488
488
|
*/
|
489
|
-
function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(Mi(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function Ai(t,i,r,e=!1,s="",o=""){let a=await Li(t,i);const u=Mi(i);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,i,r,e="",s=""){!async function(t,i,r,e="",s=""){const o=new mi;await o.initialize({pageType:"ANSI_A"},n("../assets/arcgis-pdf-creator/"),"en",t);const a=new bi;await a.initialize(o);const u=r.labelSpec;let c=1;if(s){const t=u.pageProperties,n=f.getPageSize(t.pageType);o.drawImage(s,{x:t.leftMargin,y:t.topMargin,width:n.width-t.leftMargin-t.rightMargin,height:n.height-t.topMargin-t.bottomMargin}),e&&a.drawSupplementalText(e,0,-.1),i.length>0&&(o.addPage(),++c)}await a.addLabelsToDoc(i,u,c,e),o.save()}(t,i,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/ /gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}function qi(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=e(e({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:pi({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return s(o(t.url)+"/queryRelatedRecords",n)}({...t,params:{resultOffset:i}}).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?qi(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function ji(t,n,r){let e={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(e.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),r)){const s=n.popupTemplate?.content[0]?.type;if("relationship"===s){const i=n.popupTemplate.content[0].relationshipId,s=n.relationships.find((t=>t.id===i));let o=t.layers.toArray().concat(t.tables.toArray());if(o=o.filter((t=>"feature"===t.type&&t.layerId===s.relatedTableId)),o.length>0)e=await ji(t,o[0],r),e.relationshipId=i.toString();else{o=t.layers.toArray().concat(t.tables.toArray());const s=[];let u;o=o.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return s.push(a(n)),!0}return!1})),(await Promise.all(s)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===i))||(u=ji(t,o[e],r),0))))?(e=await u,e.relationshipId=i.toString()):e.labelFormat=Si(n.popupTemplate.fieldInfos)}}else"fields"===s?(e.labelFormat=Si(n.popupTemplate.fieldInfos),0===e.labelFormat.format.length&&(e.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):e.labelFormat="text"===s?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===s?await async function(t){const[n]=await i(["esri/arcade"]),r=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:r})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(e)}function Mi(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Ei(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return n?.toString()}{let i=t;switch(n){case"date":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i?.toString(),{maximumFractionDigits:100})}return i}}export{Ei as _,Ai as a,c as b,Li as c,gi as d,yi as r}
|
489
|
+
function(t,n){const i=document.createElement("a");void 0!==i.download&&(i.href=URL.createObjectURL(new Blob(n,{type:"text/csv;charset=utf-8;"})),i.download=`${t}.csv`||"export.csv",i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i))}(t,i)}(xi(Mi(n,new RegExp(`\\b${i}\\b`))),c),c=[])})),Promise.resolve()}async function Ai(t,i,r,e=!1,s="",o=""){let a=await Li(t,i);const u=Mi(i);return a=a.map((t=>t.filter((t=>t.length>0)))).filter((t=>t.length>0)),a=e?yi(a):a,function(t,i,r,e="",s=""){!async function(t,i,r,e="",s=""){const o=new mi;await o.initialize({pageType:"ANSI_A"},n("../solutions-components/assets/arcgis-pdf-creator/"),"en",t);const a=new bi;await a.initialize(o);const u=r.labelSpec;let c=1;if(s){const t=u.pageProperties,n=f.getPageSize(t.pageType);o.drawImage(s,{x:t.leftMargin,y:t.topMargin,width:n.width-t.leftMargin-t.rightMargin,height:n.height-t.topMargin-t.bottomMargin}),e&&a.drawSupplementalText(e,0,-.1),i.length>0&&(o.addPage(),++c)}await a.addLabelsToDoc(i,u,c,e),o.save()}(t,i,r,e,s)}(s||xi(u),a,r,s,o),Promise.resolve()}function yi(t){const n=t.map((t=>JSON.stringify(t))),i=new Set(n);return Array.from(i,(t=>JSON.parse(t)))}function ki(t){for(t=(t=(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,Ni)).replace(/<p[^>]*>/gi,Ni).trim().replace(/^\|/,"")).replace(/<\/p>/gi,"")).replace(/\n/gi,"|")).replace(/<[\s.]*[^<>]*\/?>/gi,"").replace(/\xA0/gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/ /gi," ")).replace(/\s*\|\s*/g,"|");t.match(/\|\|/);)t=t.replace(/\|\|/,"|");return(t=t.replace(/^\|/,"")).replace(/\|$/,"")}function Si(t,n=!1){const i=[];return t.forEach((t=>{(t.visible||n)&&i.push(`{${t.fieldName}}`)})),{type:"pattern",format:i.join(Ni)}}function xi(t){return t.length>0?t.join(", "):"download"}function qi(t,n=[],i=0){return function(t){var n=function(t,n,i){var r=e(e({params:{}},i),t);return r.params=["objectIds","relationshipId","definitionExpression","outFields"].reduce((function(n,i){return(t[i]||"boolean"==typeof t[i])&&(n[i]=t[i]),n}),r.params),["params","httpMethod","rawResponse","authentication","portal","fetch","maxUrlLength","headers"].reduce((function(t,n){return r[n]&&(t[n]=r[n]),t}),{})}(t,0,{httpMethod:"GET",params:pi({definitionExpression:"1=1",outFields:"*",relationshipId:0},t.params)});return s(o(t.url)+"/queryRelatedRecords",n)}({...t,params:{resultOffset:i}}).then((r=>(n.push(...r.relatedRecordGroups),r.exceededTransferLimit?qi(t,n,i+r.relatedRecordGroups.length):Promise.resolve(n))))}async function ji(t,n,r){let e={layer:n,attributeFormats:{},relationshipId:void 0,labelFormat:{type:"unsupported",format:void 0}};if(n.popupEnabled&&(n.popupTemplate.fieldInfos.forEach((t=>{t.format&&(e.attributeFormats[t.fieldName.toLowerCase()]=t.format)})),r)){const s=n.popupTemplate?.content[0]?.type;if("relationship"===s){const i=n.popupTemplate.content[0].relationshipId,s=n.relationships.find((t=>t.id===i));let o=t.layers.toArray().concat(t.tables.toArray());if(o=o.filter((t=>"feature"===t.type&&t.layerId===s.relatedTableId)),o.length>0)e=await ji(t,o[0],r),e.relationshipId=i.toString();else{o=t.layers.toArray().concat(t.tables.toArray());const s=[];let u;o=o.filter((t=>{if("feature"===t.type&&t.layerId!=n.layerId&&t.url){const n=t.url+"/"+t.layerId.toString();return s.push(a(n)),!0}return!1})),(await Promise.all(s)).some(((n,e)=>!(!n.relationships||!n.relationships.some((t=>t.id===i))||(u=ji(t,o[e],r),0))))?(e=await u,e.relationshipId=i.toString()):e.labelFormat=Si(n.popupTemplate.fieldInfos)}}else"fields"===s?(e.labelFormat=Si(n.popupTemplate.fieldInfos),0===e.labelFormat.format.length&&(e.labelFormat=n.popupTemplate.title&&"string"==typeof n.popupTemplate.title?{type:"pattern",format:n.popupTemplate.title}:Si(n.popupTemplate.fieldInfos,!0))):e.labelFormat="text"===s?{type:"pattern",format:ki(n.popupTemplate.content[0].text)}:"expression"===s?await async function(t){const[n]=await i(["esri/arcade"]),r=await n.createArcadeExecutor(t.expression,{variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"}]});return Promise.resolve({type:"executor",format:r})}(n.popupTemplate.content[0].expressionInfo):Si(n.popupTemplate.fieldInfos)}return Promise.resolve(e)}function Mi(t,n=/.+/){let i=[];return Object.keys(t).forEach((r=>{const e=t[r];n.test(r)&&(i=i.concat(e.selectionSetNames))})),i}function Ei(t,n,i,r,e){if(null==t)return"";if(i&&"coded-value"===i.type){const n=i.getName(t);return n?.toString()}{let i=t;switch(n){case"date":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDate(i,t)}else i=e.formatDate(i);i=i.replace(/\xe2\x80\xaf/g,"");break;case"date-only":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatDateOnly(i,t)}else i=e.formatDateOnly(i);break;case"time-only":if(r?.dateFormat){const t=e.convertDateFormatToIntlOptions(r.dateFormat);i=e.formatTimeOnly(i,t)}else i=e.formatTimeOnly(i);break;case"double":case"integer":case"long":case"small-integer":if(r){const t=e.convertNumberFormatToIntlOptions(r);i=e.formatNumber(i,t)}else i=e.formatNumber(i?.toString(),{maximumFractionDigits:100})}return i}}export{Ei as _,Ai as a,c as b,Li as c,gi as d,yi as r}
|
@@ -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{e as
|
6
|
+
import{e as a}from"./p-0a24ad5f.js";const s=async(s,t)=>(a.exports.setDefaultOptions({url:"https://js.arcgis.com/4.30/"}),(await a.exports.loadModules(s,t)).map((a=>a.__esModule&&a.default?a.default:a)));export{s as l}
|
@@ -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,h as i,H as s,g as l}from"./p-f4c4a2b7.js";import{g as o}from"./p-
|
6
|
+
import{r as t,h as i,H as s,g as l}from"./p-f4c4a2b7.js";import{g as o}from"./p-7bfecd07.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const a=class{constructor(i){t(this,i),this.messages=void 0,this.view=void 0}render(){var t,l,o,a,e,n,d;const h="2d"!==(null===(t=null==this?void 0:this.view)||void 0===t?void 0:t.type)&&(null==this?void 0:this.view)?this._getSceneViewCommands():this._getMapViewCommands(),r=this._isMacLike()?"Option":"Alt";return i(s,{key:"f8e209f996c4743ad1bfc91deef5952c8ac34f90"},i("calcite-block",{key:"b0a69ae1ba6c989c344daa2d2fa51e6943ff6e49",open:!0,class:"instant-apps-keyboard-shortcuts__content",heading:null===(o=null===(l=null==this?void 0:this.messages)||void 0===l?void 0:l.generalShortcuts)||void 0===o?void 0:o.label},i("table",{key:"5820bb1e99ba3ffc926dea0c60ae6cba9fb71461"},this.renderTableHeader(),i("tr",{key:"b3664317e370d732f405325f6094f5ed2baad197"},i("td",{key:"3e3367b5fe5e8e5f3deddbb850acdf8c6eae9841"},`${r} + M`),i("td",{key:"a426d5c5514d99dec89e8d8298b00cfb7addfb06"},null===(e=null===(a=null==this?void 0:this.messages)||void 0===a?void 0:a.generalShortcuts)||void 0===e?void 0:e.title))),i("calcite-label",{key:"b33865ff795dac7277db16c128abc4b8667b2faf"},null===(d=null===(n=null==this?void 0:this.messages)||void 0===n?void 0:n.generalShortcuts)||void 0===d?void 0:d.title),i("table",{key:"72cbeee022de4c2c895eb78a94cf708d3f2f653c"},this.renderTableHeader(),h.map((t=>i("tr",null,i("td",null,t.alias),i("td",null,t.title)))))))}componentDidLoad(){o(this)}renderTableHeader(){var t,s;return(null==this?void 0:this.messages)?i("tr",null,i("th",null,null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.generalShortcuts.shortcut),i("th",null,null===(s=null==this?void 0:this.messages)||void 0===s?void 0:s.generalShortcuts.action)):null}_getMapViewCommands(){return(null==this?void 0:this.messages)?[{alias:null==this?void 0:this.messages.mapShortcuts.arrowKeys,title:null==this?void 0:this.messages.mapShortcuts.nudge},{alias:"N",title:null==this?void 0:this.messages.mapShortcuts.N},{alias:"A",title:null==this?void 0:this.messages.mapShortcuts.A},{alias:"D",title:null==this?void 0:this.messages.mapShortcuts.D},{alias:"+",title:null==this?void 0:this.messages.mapShortcuts.plus},{alias:"-",title:null==this?void 0:this.messages.mapShortcuts.minus}]:[]}_getSceneViewCommands(){var t;const i="global"===(null===(t=null==this?void 0:this.view)||void 0===t?void 0:t.viewingMode),s=(null==this?void 0:this.messages)?[{alias:null==this?void 0:this.messages.mapShortcuts.arrowKeys,title:null==this?void 0:this.messages.mapShortcuts.nudge,show:!!i},{alias:"P",title:null==this?void 0:this.messages.sceneShortcuts.P,show:!0},{alias:"N",title:null==this?void 0:this.messages.sceneShortcuts.N,show:!0},{alias:"W",title:null==this?void 0:this.messages.sceneShortcuts.W,show:!0},{alias:"A",title:null==this?void 0:this.messages.sceneShortcuts.A,show:!0},{alias:"D",title:null==this?void 0:this.messages.sceneShortcuts.D,show:!0},{alias:"S",title:null==this?void 0:this.messages.sceneShortcuts.S,show:!0},{alias:"J",title:null==this?void 0:this.messages.sceneShortcuts.globalCommands.J,show:!!i},{alias:"U",title:null==this?void 0:this.messages.sceneShortcuts.globalCommands.U,show:!!i}]:[];return(null==this?void 0:this.messages)?null==s?void 0:s.filter((t=>t.show)):[]}_isMacLike(){return/(Mac)/i.test(navigator.platform)}get el(){return l(this)}};a.style=":host .instant-apps-keyboard-shortcuts__content{display:flex;flex-direction:column;font-family:var(--calcite-sans-family);font-size:0.875rem;background-color:var(--calcite-color-background);color:var(--calcite-color-text-1);width:auto;padding:0.5em;margin-bottom:0;overflow:auto}:host .instant-apps-keyboard-shortcuts__content table{border:none;border-collapse:collapse;width:100%;margin-bottom:1em}:host .instant-apps-keyboard-shortcuts__content table td,:host .instant-apps-keyboard-shortcuts__content table th{border:solid 1px var(--calcite-color-border-1);padding:0.5rem 0.75rem 0.5rem 0.75rem;white-space:normal}:host .instant-apps-keyboard-shortcuts__content table td:lang(ja),:host .instant-apps-keyboard-shortcuts__content table td:lang(ja-JP),:host .instant-apps-keyboard-shortcuts__content table th:lang(ja-JP),:host .instant-apps-keyboard-shortcuts__content table th:lang(ja){white-space:nowrap}:host .instant-apps-keyboard-shortcuts__content tr:nth-child(even){background-color:var(--calcite-color-foreground-2)}:host .instant-apps-keyboard-shortcuts__content tr th{padding:0.5em 0.7em;font-weight:400}";export{a as instant_apps_keyboard_shortcuts}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as e,h as i,f as a,g as s,H as n,d as o,F as l}from"./p-f4c4a2b7.js";import{c,d as r}from"./p-8e22949b.js";import{a as h,i as d,h as b,s as p,n as u,d as f,B as m,t as v,e as g,g as w}from"./p-dd119c31.js";import{c as y,d as x}from"./p-291217a6.js";import{c as k}from"./p-088941fa.js";import{c as z,s as C,d as _,u as T}from"./p-1586a4c7.js";import{C as I}from"./p-5e4643ec.js";import{g as L}from"./p-ac58e523.js";import{c as H,a as S,b as j}from"./p-e3196917.js";import{c as A}from"./p-901c7dc6.js";import{c as D,d as E,I as W,u as F}from"./p-77dc9d68.js";import{g as R}from"./p-9cb9c763.js";import{s as M,a as $,c as B}from"./p-d351bd0a.js";import{q as N,m as O,d as P,a as U,s as V,h as J,b as q,g as G,k as K,t as X,i as Y,c as Q,f as Z,e as tt,n as et,r as it,j as at,l as st,o as nt,p as ot,L as lt}from"./p-7a607331.js";import{d as ct,c as rt}from"./p-ea66beec.js";import{C as ht,S as dt}from"./p-e1c0122d.js";import{I as bt}from"./p-d7716f27.js";import{g as pt}from"./p-
|
6
|
+
import{r as t,c as e,h as i,f as a,g as s,H as n,d as o,F as l}from"./p-f4c4a2b7.js";import{c,d as r}from"./p-8e22949b.js";import{a as h,i as d,h as b,s as p,n as u,d as f,B as m,t as v,e as g,g as w}from"./p-dd119c31.js";import{c as y,d as x}from"./p-291217a6.js";import{c as k}from"./p-088941fa.js";import{c as z,s as C,d as _,u as T}from"./p-1586a4c7.js";import{C as I}from"./p-5e4643ec.js";import{g as L}from"./p-ac58e523.js";import{c as H,a as S,b as j}from"./p-e3196917.js";import{c as A}from"./p-901c7dc6.js";import{c as D,d as E,I as W,u as F}from"./p-77dc9d68.js";import{g as R}from"./p-9cb9c763.js";import{s as M,a as $,c as B}from"./p-d351bd0a.js";import{q as N,m as O,d as P,a as U,s as V,h as J,b as q,g as G,k as K,t as X,i as Y,c as Q,f as Z,e as tt,n as et,r as it,j as at,l as st,o as nt,p as ot,L as lt}from"./p-7a607331.js";import{d as ct,c as rt}from"./p-ea66beec.js";import{C as ht,S as dt}from"./p-e1c0122d.js";import{I as bt}from"./p-d7716f27.js";import{g as pt}from"./p-d7868dd4.js";import{s as ut}from"./p-a860f365.js";import{d as ft}from"./p-80cb7c73.js";import{E as mt}from"./p-9fe07c30.js";import"./p-545b56c7.js";import"./p-e756a5dc.js";import"./p-c95c9472.js";import"./p-eecd63c7.js";import"./p-c8d3207e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";import"./p-badcaf04.js";
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
@@ -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,h as e}from"./p-f4c4a2b7.js";import{l as a,g as h}from"./p-
|
6
|
+
import{r as t,c as i,g as s,h as e}from"./p-f4c4a2b7.js";import{l as a,g as h}from"./p-d7868dd4.js";import{P as c}from"./p-00b26aac.js";import{g as n,c as o,h as r}from"./p-eb483242.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-4b3cc01f.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";import"./p-80cb7c73.js";const l=class{constructor(s){t(this,s),this.featureSelect=i(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.sortingInfo=void 0,this.whereClause=void 0,this.textSize="large",this.showInitialLoading=!0,this.showErrorWhenNoFeatures=!0,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}get el(){return s(this)}Color;_popupUtils;_selectedLayer;_highlightHandle;_pagination;async selectedLayerWatchHandler(){this._selectedLayer=await n(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async refresh(){await this.initializeFeatureItems()}featureSelect;async componentWillLoad(){await this.initModules(),await this._getTranslations(),this._isLoading=this.showInitialLoading,this._popupUtils=new c,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await n(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return e("calcite-panel",{key:"3d7b707a73bb6c4d566515e50cf2baa155e60816","full-height":!0,"full-width":!0},this._isLoading&&e("calcite-loader",{key:"50294111fb6c1e52e727b03e54ca83fc498ca3b9",label:"",scale:"m"}),this.showErrorWhenNoFeatures&&0===this._featureItems.length&&!this._isLoading&&e("calcite-notice",{key:"8dd48fc33e2a9825a95b0d0d50424baf431fed55",class:"error-msg",icon:"feature-details",kind:"info",open:!0},e("div",{key:"6ff0dc700cdf40fe6929a9777bca8ebc6325f1ed",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),e("calcite-list",{key:"2412a7b41ab87bfee803460bdea0395ca609d55a","selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&e("div",{key:"4216b02c264cf88472082f1c6f3cd466bd77d166",class:"width-full",slot:"footer"},e("calcite-pagination",{key:"2bb39768d0fbd0d863b075b0e2e6b750c5f7c2a1",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,ref:t=>this._pagination=t,"start-item":"1","total-items":this._featuresCount})))}async initModules(){const[t]=await a(["esri/Color"]);this.Color=t}getWhereCondition(){let t="1=1";return this.whereClause&&(t=this.whereClause),this._selectedLayer?.definitionExpression&&(t=t+" AND "+this._selectedLayer.definitionExpression),t}async initializeFeatureItems(){if(this._selectedLayer){this._pagination?.goTo("start"),this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const t={where:this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(t),this._isLoading=!1}}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.clearHighlights(),this.highlightOnMap){const i=Number(t.target.value),s=await o(this.mapView,this.selectedLayerId);this._highlightHandle=await r([i],s,this.mapView,!0)}await this.emitSelectedFeature(i)}async emitSelectedFeature(t){const i=t.layer,s=i.createQuery();s.returnGeometry=!0,s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this.featureSelect.emit(e.features[0])}async onFeatureHover(t){if(this.clearHighlights(),this.highlightOnHover){const i=t.getObjectId(),s=await o(this.mapView,this.selectedLayerId);s.highlightOptions={color:new this.Color("#FFFF00")},this._highlightHandle=s.highlight([i])}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(t){const i=this._selectedLayer,s=this.sortingInfo?.field?this.sortingInfo.field:i.objectIdField,e=this.sortingInfo?.order?this.sortingInfo.order:"desc",a={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:this.getWhereCondition(),outSpatialReference:this.mapView.spatialReference.toJSON()};s&&e&&(a.orderByFields=[s.toString()+" "+e]);const h=await i.queryFeatures(a);return await this.createFeatureItem(h)}async createFeatureItem(t){const i=t?.features,s=i.map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(s)}getFeatureItem(t,i){const s=t.attributes[this._selectedLayer.objectIdField].toString();return e("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},onMouseLeave:()=>{this.clearHighlights()},onMouseOver:()=>{this.onFeatureHover(t)},value:s},e("div",{class:"small"===this.textSize?"feature-list-popup-title-small":"feature-list-popup-title",slot:"content-start"},i=i??s),e("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"],sortingInfo:["sortingInfoWatchHandler"],whereClause:["whereClauseHandler"]}}};l.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px;white-space:pre-line}.feature-list-popup-title-small{font-size:small;padding:10px 12px;white-space:pre-line}";export{l as feature_list}
|
@@ -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 o,h as
|
6
|
+
import{r as t,c as o,h as e,H as i,g as a}from"./p-f4c4a2b7.js";import{g as c}from"./p-7bfecd07.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const l=class{constructor(e){t(this,e),this.measureActive=o(this,"measureActive",7),this.messages=void 0,this.view=void 0,this.areaUnit=void 0,this.linearUnit=void 0,this.coordinateFormat=void 0,this.activeToolType=void 0,this.closable=!1}async componentWillLoad(){c(this)}componentDidLoad(){}render(){var t;return e(i,{key:"0af812b1330d8e6dc26319b6c19ccc94b3704759"},e("calcite-panel",{key:"61a7c3c7e880ddb4aeeeac24ac0c37eeedb96a0c",heading:null===(t=null==this?void 0:this.messages)||void 0===t?void 0:t.label,closable:this.closable},e("div",{key:"835e5e4f7a90618eb37a65bdca38e7ec684f54d1"},this.renderActionPad()),this.renderMeasureToolPanel()))}renderMeasureToolPanel(){const{view:t,coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:c}=this;return e("calcite-panel",{class:"instant-apps-measurement__content"},e("instant-apps-measurement-tool",{ref:t=>{this.measureTool=t},view:t,measureConfiguration:{coordinateFormat:o,areaUnit:i,linearUnit:a,activeToolType:c}}))}renderActionPad(){const{messages:t,activeToolType:o}=this;return e("calcite-action-pad",{"expand-disabled":!0,layout:"horizontal",position:"end"},e("calcite-action",{class:"distance"===o?"active-tool":"",text:null==t?void 0:t.line,icon:"measure",scale:"m","data-value":"distance",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.line)),e("calcite-action",{class:"area"===o?"active-tool":"",text:null==t?void 0:t.area,scale:"m",icon:"measure-area","data-value":"area",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.area)),e("calcite-action",{class:"point"===o?"active-tool":"",text:null==t?void 0:t.point,scale:"m",icon:"pin-plus","data-value":"point",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.point)),e("calcite-action",{text:null==t?void 0:t.clear,scale:"m",icon:"trash","data-value":"clear",onClick:this._handleToolClick.bind(this)},e("calcite-tooltip",{"close-on-click":!0,placement:"bottom",slot:"tooltip"},null==t?void 0:t.clear)))}_handleToolClick(t){var o,e,i,a;if(!(null==this?void 0:this.measureTool))return;const c=null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.dataset.value;this.measureTool.activeTool=c;const l=document.getElementsByClassName("active-tool");for(let t=0;t<(null==l?void 0:l.length);t++)null===(i=null===(e=l[t])||void 0===e?void 0:e.classList)||void 0===i||i.remove("active-tool");null===(a=null==t?void 0:t.target)||void 0===a||a.classList.add("active-tool"),this.measureActive.emit(void 0!==c&&"clear"!==c)}get el(){return a(this)}};l.style=".sc-instant-apps-measurement-h .sc-instant-apps-measurement.sc-instant-apps-measurement{background:var(--calcite-color-foreground-1)}.sc-instant-apps-measurement-h .active-tool.sc-instant-apps-measurement{--calcite-color-foreground-1:#c7eaff}";export{l as instant_apps_measurement}
|
@@ -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 e,c as n,h as t,g as i}from"./p-f4c4a2b7.js";import{v as a,g as s}from"./p-
|
6
|
+
import{r as e,c as n,h as t,g as i}from"./p-f4c4a2b7.js";import{v as a,g as s}from"./p-1904654e.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";const p=class{constructor(t){e(this,t),this.groupLayerCaptionElementExpandUpdatedEvent=n(this,"groupLayerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,n,i,p;const l=a(this.activeLayerInfo),{expanded:c}=this,r=c?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(n=this.messages)||void 0===n?void 0:n.expand,d=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return t("header",{key:"09f5ee7f348855813f75b775b87f2f9de12e3792",class:`instant-apps-interactive-legend__header ${s(this.el)}`,style:{borderLeft:"1px solid var(--calcite-color-border-3)"}},t("span",{key:"2a720ba9d488b06550ed955d84a150501aa03a2f"},t("span",{key:"17c9b3a7e76ad853844d1c4cdbfd4aa74470a524",class:"instant-apps-interactive-legend__header-action-container"},t("calcite-action",{key:"7bc8909822ef97fe40721b80ce062abf93d825db",onClick:this.toggleExpanded(),icon:c?"chevron-down":"chevron-up",appearance:"transparent",text:r,label:r,scale:"s"}),t("h3",{key:"0a30cf8669b622aeb47c595f30df3a26202c5111",class:`esri-widget__heading esri-legend__service-label${d}`,title:null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title},null===(p=this.activeLayerInfo)||void 0===p?void 0:p.title)),this.featureCount&&l?t("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.groupLayerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};p.style=".sc-instant-apps-interactive-legend-group-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption h3.sc-instant-apps-interactive-legend-group-legend-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-group-legend-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption span.sc-instant-apps-interactive-legend-group-legend-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-group-legend-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{p as instant_apps_interactive_legend_group_legend_element_caption}
|
@@ -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,h as a,H as e,g as i}from"./p-f4c4a2b7.js";import{g as n}from"./p-09d62c22.js";import{l as r}from"./p-65581d83.js";import{g as s}from"./p-a9a72626.js";import"./p-af2c8aa9.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const o={"instant-apps":{path:"M11.206 4.805v-1.38a2.231 2.231 0 0 1 2.23-2.231h13.168a2.231 2.231 0 0 1 2.231 2.23v11.15a2.231 2.231 0 0 1-2.23 2.231h-1.398V5.555a.75.75 0 0 0-.75-.75zM30.94 27.204l-5.447-4.41a.211.211 0 0 0-.344.164v2.225H8.197a1.344 1.344 0 0 1-1.344-1.344V11.665a.75.75 0 0 1 .75-.75h9.872a.75.75 0 0 1 .75.75l-.003 7.534a2.422 2.422 0 0 1-.798 1.796l-.945.855h4.3a1.075 1.075 0 0 0 1.074-1.075v-10.54a2.231 2.231 0 0 0-2.23-2.23H5.354a2.148 2.148 0 0 0-2.13 2.23v16.507a2.231 2.231 0 0 0 2.23 2.231l19.695-.003v2.725a.211.211 0 0 0 .344.164l5.447-4.41a.158.158 0 0 0 0-.245z",fill:"#83a238"},"map-viewer":{path:"M21.647 13.706A1.647 1.647 0 1 1 20 15.353a1.647 1.647 0 0 1 1.647-1.647zM19 19.083A1.917 1.917 0 1 1 17.082 21 1.917 1.917 0 0 1 19 19.082zm7.684 3.393a2.433 2.433 0 0 1-.64 1.776l-.01.012c-1.045 1.134-3.215 1.8-5.738 1.8-3.815 0-5.054-1.485-8.586-1.828a6.765 6.765 0 0 1 .566-4.07c.98-1.674 2.445-1.568 3.41-2.724.967-1.157.033-3.384 1.397-4.748 1.539-1.538 3.44-.12 4.57-2.542.877-1.884 1.84-2.98 3.68-3.35a.39.39 0 0 1 .047.07c.132.695 1.097 11.68 1.304 15.604zM6.208 8.864A3.054 3.054 0 0 1 8.115 6.17s2.425-.88 3.09-1.029a2.637 2.637 0 0 1 .314-.01 4.967 4.967 0 0 1 1.157.157l.404.095a7.26 7.26 0 0 0-.238 3.294c.188 1.354.657 2.399-.066 4.361-1.003 2.721-2.901 2.585-3.857 4.562-1.285 2.657.21 6.226-2.182 6.835l.004.002.003.003c-.801.114-1.363.22-1.663.272zm21.549-5.09a.055.055 0 0 0-.022-.037.058.058 0 0 0-.037-.01l-7.37 1.025-8.771-2.742a.227.227 0 0 0-.162.01L3.594 5.566a.054.054 0 0 0-.032.045L1.58 29a41.592 41.592 0 0 1 9.115-1.285c2.765.094 6.646 2.287 10.29 2.177 3.51-.108 8.582-2.382 9.564-2.836a.054.054 0 0 0 .03-.056z",fill:"#3DB8FF"},"story-maps":{path:"M25.5 0C23.015 0 21 .953 21 3.433v8.517a1.467 1.467 0 0 0 .43 1.038l3.837 3.827a.33.33 0 0 0 .466 0l3.836-3.827A1.467 1.467 0 0 0 30 11.95V3.433C30 .953 27.985 0 25.5 0zm0 8.1a2.6 2.6 0 1 1 2.6-2.599A2.599 2.599 0 0 1 25.5 8.1zm-7.856.453c.294-.153.312-.457.312-.788v-2.31a.104.104 0 0 0-.129-.1 6.128 6.128 0 0 0-2.248 1.19.14.14 0 0 1-.167.008c-3.437-2.283-8.543-1.52-12.131-.988-.432.064-1.762.34-2.164.424A.146.146 0 0 0 1 6.133V26.69a.147.147 0 0 0 .05.11.134.134 0 0 0 .116.035A36.394 36.394 0 0 1 9.5 25.781c3.283.054 4.403.96 4.967 1.513l.915.897a.164.164 0 0 0 .23 0l.916-.897a5.98 5.98 0 0 1 3.972-1.47 25.341 25.341 0 0 1 5.715.516c.718.109 1.46.22 2.186.312l1.251.16a.308.308 0 0 0 .348-.305v-7.375a.161.161 0 0 0-.303-.077l-.107.2a7.218 7.218 0 0 1-6.902 3.766 10.455 10.455 0 0 0-5.688.796V9.454a.89.89 0 0 1 .332-.693 2.058 2.058 0 0 1 .312-.208zM14 23.817c-3.071-1.38-5.998-.808-9.447-.293l-.253.036a.263.263 0 0 1-.3-.259V8.525a.098.098 0 0 1 .084-.097l.804-.115c2.518-.372 6.303-1.048 8.708.515a.89.89 0 0 1 .404.746z",fill:"#4fbaa9"},dashboards:{path:"M25.819 28H23.18a.181.181 0 0 1-.181-.181V13.18a.181.181 0 0 1 .181-.181h2.638a.181.181 0 0 1 .181.181V27.82a.181.181 0 0 1-.181.181zM21 27.816v-9.631a.184.184 0 0 0-.184-.185h-2.631a.184.184 0 0 0-.185.184v9.631a.184.184 0 0 0 .184.185h2.631a.184.184 0 0 0 .185-.184zm9.82.184a.18.18 0 0 0 .18-.18v-7.64a.18.18 0 0 0-.18-.18h-2.64a.18.18 0 0 0-.18.18v7.64a.18.18 0 0 0 .18.18zM7 9.267v10.475c.706.033 3.538-1.718 4.274-4.7.679-2.751 3.485-2.864 4.443-2.94 1.766-.14 3.588-.607 4.566-2.798A.216.216 0 0 0 20.085 9H7.267A.267.267 0 0 0 7 9.267zm18.997-1.053A4.411 4.411 0 0 0 21.63 4H2.684A.684.684 0 0 0 2 4.684V21.81A3.19 3.19 0 0 0 5.19 25h9.565a.245.245 0 0 0 .245-.245v-2.362a.393.393 0 0 0-.393-.393H6.38A1.385 1.385 0 0 1 5 20.619V7.349A.348.348 0 0 1 5.348 7h16.324A1.346 1.346 0 0 1 23 8.363v1.28a.357.357 0 0 0 .357.357h2.599a.046.046 0 0 0 .046-.046z",fill:"#ee9e01"},"experience-builder":{path:"M30.85 12.82l-2.85 5v7.44A1.78 1.78 0 0 1 26.22 27H25V7.75a.76.76 0 0 0-.75-.75H12V1.31a.28.28 0 0 1 .42-.25L17.51 4h8.71A1.78 1.78 0 0 1 28 5.78v4.42l2.54 1.47a.83.83 0 0 1 .31 1.15zM12 18h8v-6h-8zm7.62 5H7.75a.76.76 0 0 1-.75-.75V4H5.78A1.78 1.78 0 0 0 4 5.78V13l-2.89 5a.85.85 0 0 0 .31 1.15L4 20.59v4.61A1.78 1.78 0 0 0 5.78 27h8.62l5.18 3a.28.28 0 0 0 .42-.24v-6.39a.38.38 0 0 0-.38-.37z",fill:"#09b8ca"},geoBIM:{path:"M17.802 21.398l6.2 2.557-5.14 2.133a.772.772 0 0 1-1.06-.717zM9.311 7.868a.604.604 0 0 1-.003-1.122L16 4.169l8.12 3.148-8.119 3.184zm-3.5 1.541l8.387 3.413v12.554a.772.772 0 0 1-1.06.717l-6.297-2.736a1.639 1.639 0 0 1-1.03-1.521zM3.844 6.03a1.316 1.316 0 0 0-.827 1.22v17.395a1.316 1.316 0 0 0 .827 1.221L16 30.888l12.983-5.317v-2.423l-7.156-3.023 7.156-2.963v-1.95l-5.101-2.2-3.867 1.516L24 16.123l-6.199 2.505v-5.711l.073-.122 11.108-4.487v-1.95l-12.47-5.047a1.384 1.384 0 0 0-1.027 0z",fill:"#11ad1d"},notebooks:{path:"M2.941 25A.906.906 0 0 1 2 24.135v-.271A.906.906 0 0 1 2.941 23h3.118a.906.906 0 0 1 .941.864v.271a.906.906 0 0 1-.941.865zm3.118-8A.906.906 0 0 0 7 16.135v-.271A.906.906 0 0 0 6.059 15H2.941a.906.906 0 0 0-.941.864v.271a.906.906 0 0 0 .941.865zm0-8A.906.906 0 0 0 7 8.135v-.271A.906.906 0 0 0 6.059 7H2.941A.906.906 0 0 0 2 7.864v.271A.906.906 0 0 0 2.941 9zm9.44 16h-3.726a.773.773 0 0 1-.773-.774V6.171A.172.172 0 0 1 11.172 6H15.5a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5H5.342A1.345 1.345 0 0 0 4 4.343V5h2.059A2.904 2.904 0 0 1 9 7.858v.277A2.907 2.907 0 0 1 6.059 11H4v2h2.059A2.907 2.907 0 0 1 9 15.864v.271A2.907 2.907 0 0 1 6.059 19H4v2h2.059A2.907 2.907 0 0 1 9 23.864v.271A2.907 2.907 0 0 1 6.059 27H4v1.405a.595.595 0 0 0 .595.595H15.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zM20 3.5v2a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 .5.5v18a.5.5 0 0 1-.5.5h-4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-25a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.499.5z",fill:"#6e6e6e"},sites:{path:"M2.656 29A.656.656 0 0 1 2 28.344V6.185A3.189 3.189 0 0 1 5.185 3H29.72a.281.281 0 0 1 .281.281v22.53A3.194 3.194 0 0 1 26.81 29zm2.838-3h21.211a.295.295 0 0 0 .296-.295V13.494a.493.493 0 0 0-.493-.494H5v12.506a.494.494 0 0 0 .494.494zM23 9.91a.09.09 0 0 0 .09.09h3.82a.09.09 0 0 0 .09-.09V6.026A.026.026 0 0 0 26.974 6h-3.948a.026.026 0 0 0-.026.026zM6.633 6A1.597 1.597 0 0 0 5 7.595V10h14.523A.477.477 0 0 0 20 9.523V6.477A.477.477 0 0 0 19.523 6zM16 22v-5h7v5zm-7-2v-3h3v3z",fill:"#7842ed"},webAppBuilder:{path:"M15.044 19.974a.188.188 0 0 1-.192-.001l-3.762-2.35a.188.188 0 0 1-.09-.16v-4.098a.188.188 0 0 1 .096-.163l3.761-2.178a.188.188 0 0 1 .182-.001l3.863 2.179a.188.188 0 0 1 .098.165v4.095a.187.187 0 0 1-.092.161zm15.13-1.04a.052.052 0 0 0 .099.022 8.048 8.048 0 0 0 .67-3.147 7.155 7.155 0 0 0-3.507-6.213L17.59 3.768a4.054 4.054 0 0 0-1.968-.627 3.95 3.95 0 0 0-1.894.485c-.607.334-1.132.67-1.278.754a2.951 2.951 0 0 0-1.39 2.506v1.078a.2.2 0 0 0 .307.167l1.365-.87a4.988 4.988 0 0 1 2.319-.792 4.62 4.62 0 0 1 2.219.792s8.442 5.017 9.392 5.576a7.045 7.045 0 0 1 3.513 6.084zM9.546 23.55l.947-.547a.2.2 0 0 0 0-.345l-1.369-.79a4.326 4.326 0 0 1-2.13-3.842V7.286a7.16 7.16 0 0 1 3.63-6.083l.081-.05a.025.025 0 0 0-.012-.045l-.25-.005a8.333 8.333 0 0 0-3.887.994A7.102 7.102 0 0 0 3.069 8.31v10.786a3.96 3.96 0 0 0 1.89 3.362c.894.545 1.605.974 1.81 1.092a2.787 2.787 0 0 0 2.777 0zm4.383 6.37l9.997-5.773a3.959 3.959 0 0 0 1.967-3.32c.021-.929.034-1.604.034-1.806a2.786 2.786 0 0 0-1.39-2.406l-1.123-.57a.2.2 0 0 0-.289.177v1.604a4.45 4.45 0 0 1-2.218 3.842l-3.708 2.14a3.366 3.366 0 0 1-.256.135L11.6 27.128a6.427 6.427 0 0 1-3.343.938 7.137 7.137 0 0 1-3.513-1.038c-.09-.052-.38-.226-.797-.479a.094.094 0 0 0-.134.12 7.182 7.182 0 0 0 2.942 3.25 7.241 7.241 0 0 0 3.587 1.028 7.243 7.243 0 0 0 3.587-1.028z",fill:"#09b8ca"},urban:{path:"M32 14l-4 .003a1 1 0 0 0-1 1V21a1 1 0 0 1-1 1h-2V5.451l-7.598-3.335A1 1 0 0 0 15 3.03V25a1 1 0 0 1-1 1h-2V11.24h-.02L7.5 9l-4.48 2.24H3V20H0v4h5a1 1 0 0 0 1-1V12.717L7.5 12l1.5.717V28a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V6.094l3 1.317V24a2 2 0 0 0 2 2h5.02A1.977 1.977 0 0 0 30 24.024V17h2z",fill:"#3DB8FF"}},c=new Map;function l(t){return c[t]||""}Object.keys(o).forEach((t=>{c[t]=`<svg viewBox="0 0 32 32" width="32" height="32" fill="${o[t].fill}"><path d="${o[t].path}"/></svg>`}));const p="instant-apps-create calcite-mode-light",h=class{constructor(a){t(this,a),this.popoverIcon="grid",this.mode="inline",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.showHeader=!0,this.content=void 0,this.options=["instant-apps","map-viewer","story-maps","experience-builder","dashboards"],this.portal=void 0,this.baseClass=p,this.messages={},this.CreateOptionsLookup=void 0}contentChanged(){Object.keys(this.CreateOptionsLookup).forEach((t=>{this.CreateOptionsLookup[t].href=this.hrefLookup(t)}))}componentWillLoad(){return this.baseClass="dark"===s(this.el)?"instant-apps-create calcite-mode-dark":p,this.initializeModules(),n(this).then((()=>{this.initializePredefinedOptions()}))}disconnectedCallback(){var t,a;null===(t=this.handles)||void 0===t||t.removeAll(),null===(a=this.handles)||void 0===a||a.destroy(),this.handles=null}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel();return a(e,{key:"ee6a5076dce36a238288216de4cbd77d16347c15"},a("div",{key:"c22b60a05f5d0b430c76ab8edcf52577f1eecfaa",class:this.baseClass},t))}async initializeModules(){const[t]=await r(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}initializePredefinedOptions(){const{instantApps:t,instantAppsDesc:a,mapViewer:e,mapViewerDesc:i,arcgisStoryMaps:n,storyMapsDesc:r,experienceBuilder:s,experienceBuilderDesc:o,dashboards:c,dashboardsDesc:p}=this.messages;this.CreateOptionsLookup={"instant-apps":{title:t,subtitle:a,img:l("instant-apps"),href:this.hrefLookup("instant-apps")},"map-viewer":{title:e,subtitle:i,img:l("map-viewer"),href:this.hrefLookup("map-viewer")},"story-maps":{title:n,subtitle:r,img:l("story-maps"),href:this.hrefLookup("story-maps")},"experience-builder":{title:s,subtitle:o,img:l("experience-builder"),href:this.hrefLookup("experience-builder")},dashboards:{title:c,subtitle:p,img:l("dashboards"),href:this.hrefLookup("dashboards")}}}hrefLookup(t){var a,e;const i=this.getBaseUrl(this.portal),n=this._getEnvironment(i),r=this.contentHref();switch(t){case"instant-apps":return`${i}/apps/instantgallery/index.html?${r}`;case"dashboards":return`${i}/apps/dashboards/new#id=${null===(e=null===(a=this.content)||void 0===a?void 0:a.portalItem)||void 0===e?void 0:e.id}`;case"map-viewer":return`${i}/apps/mapviewer/index.html?${r}`;case"story-maps":return`https://storymaps${"prod"===n?"":n}.arcgis.com/stories/new?${r}`;case"experience-builder":return`https://experience${"prod"===n?"":n}.arcgis.com/builder/page/template/?${r}`}return""}contentHref(){var t,a,e,i,n;return"Web Map"===(null===(a=null===(t=null==this?void 0:this.content)||void 0===t?void 0:t.portalItem)||void 0===a?void 0:a.type)?`webmap=${this.content.portalItem.id}`:"Web Scene"===(null===(i=null===(e=null==this?void 0:this.content)||void 0===e?void 0:e.portalItem)||void 0===i?void 0:i.type)?`webscene=${this.content.portalItem.id}`:"function"==typeof(null===(n=null==this?void 0:this.content)||void 0===n?void 0:n.fetchMembers)?`group=${this.content.id}`:""}getBaseUrl(t){if(!t)return"";const{customBaseUrl:a,portalHostname:e,urlKey:i}=t,{protocol:n}=location;return`${n}//${i?`${i}.${a}`:e}`}_getEnvironment(t){var a;let e=null;try{e=null===(a=new URL(t))||void 0===a?void 0:a.hostname}catch(t){}return null==e||-1===e.indexOf("arcgis.com")?"dev":(-1!==e.indexOf("devext")?"dev":-1!==e.indexOf("qaext")&&"qa")||"prod"}renderPopover(){var t,e;const i=this.renderPanel();return[a("calcite-popover",{referenceElement:"create-popover-btn",overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t,label:"Create panel"},i),a("calcite-action",{id:"create-popover-btn",alignment:"center",icon:this.popoverIcon,title:null===(t=this.messages)||void 0===t?void 0:t.create,text:null===(e=this.messages)||void 0===e?void 0:e.create})]}renderPanel(){const t=this.showHeader?this.renderHeader():null,e=this.renderOptions();return a("div",{class:"inline"===this.mode?"instant-apps-create__inline-container":"instant-apps-create__popover-container"},t,e)}renderHeader(){const{create:t,createSubheading:e}=this.messages;return a("div",{class:"instant-apps-create__header"},a("h3",null,t),a("p",null,e))}renderOptions(){return a("nav",null,this.options.map((t=>this.renderOption(t))))}renderOption(t){var e;"string"==typeof t&&(t=null===(e=null==this?void 0:this.CreateOptionsLookup)||void 0===e?void 0:e[t]);const{title:i,subtitle:n,img:r,href:s}=t||{};return a("a",{class:"instant-apps-create__option",href:s,target:"_blank"},a("span",{class:"instant-apps-create__option-icon",innerHTML:r}),a("span",{class:"instant-apps-create__option-text"},a("span",{class:"instant-apps-create__option-text-wrapper"},a("h3",{class:"instant-apps-create__option-title"},i),a("calcite-icon",{scale:"s",icon:"launch"})),a("p",{class:"instant-apps-create__option-subtitle"},n)))}get el(){return i(this)}static get watchers(){return{content:["contentChanged"]}}};h.style=":host{display:block;--instant-apps-create-action-background:var(--calcite-color-foreground-1);--instant-apps-create-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-create-action-background-press:var(--calcite-color-foreground-3);--instant-apps-create-action-height:100%;--instant-apps-create-action-width:fit-content;--instant-apps-create-action-icon-color:var(--calcite-color-text-3);--instant-apps-create-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-create-background:var(--calcite-color-foreground-1);--instant-apps-create-text-color:var(--calcite-color-text-1);--instant-apps-create-popover-width:450px}.instant-apps-create{height:100%}.instant-apps-create *{box-sizing:border-box}.instant-apps-create__popover-container,.instant-apps-create__inline-container{padding:1rem 1.5rem;background:var(--instant-apps-create-background);--calcite-color-text-1:var(--instant-apps-create-text-color)}.instant-apps-create__popover-container{width:var(--instant-apps-create-popover-width)}.instant-apps-create calcite-popover{--calcite-color-foreground-1:var(--instant-apps-create-background)}.instant-apps-create calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-create__header h3{margin:0;font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__header p{margin:0;padding:0 0 0.5rem 0;font-weight:var(--calcite-font-weight-normal)}.instant-apps-create__options{display:flex;justify-content:space-between;align-items:center;flex-direction:column}.instant-apps-create__option{display:flex;color:inherit;text-decoration:inherit;height:-moz-fit-content;height:fit-content;margin-bottom:0.5rem;cursor:pointer;--calcite-color-text-link:var(--calcite-color-text-1);align-items:stretch;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);outline-offset:0;outline-color:transparent;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.instant-apps-create__option:first-of-type{margin-top:0.5rem}.instant-apps-create__option:last-of-type{margin-bottom:0}.instant-apps-create__option:hover{outline:1px solid var(--calcite-color-border-1);outline-offset:2px}.instant-apps-create__option-icon{display:flex;background:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);font-size:1.25rem;background-color:var(--calcite-color-background);justify-content:center;align-items:center;flex:1 1 auto;max-width:5rem;min-width:5rem;height:auto}.instant-apps-create__option-icon svg{display:block;overflow-clip-margin:content-box;overflow:hidden}.instant-apps-create__option-text{min-height:2rem;font-size:0.75rem;color:var(--calcite-color-text-2);padding:0.75rem 0 0 0.75rem}.instant-apps-create__option-text-wrapper{display:flex;align-items:center}.instant-apps-create__option-text h3{margin:0;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__option-text calcite-icon{margin-left:0.25rem;color:rgb(126, 126, 126);--tw-translate-x:0px;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;transition-delay:0s}a:hover .instant-apps-create__option-text calcite-icon{opacity:1;--tw-translate-x:0.5rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.instant-apps-create__option-text p{margin:0;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3);line-height:1.35;min-height:3rem}";export{h as instant_apps_create}
|
6
|
+
import{r as t,h as a,H as e,g as i}from"./p-f4c4a2b7.js";import{g as n}from"./p-7bfecd07.js";import{l as r}from"./p-4cd4cb85.js";import{g as s}from"./p-a9a72626.js";import"./p-ac122d9e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o={"instant-apps":{path:"M11.206 4.805v-1.38a2.231 2.231 0 0 1 2.23-2.231h13.168a2.231 2.231 0 0 1 2.231 2.23v11.15a2.231 2.231 0 0 1-2.23 2.231h-1.398V5.555a.75.75 0 0 0-.75-.75zM30.94 27.204l-5.447-4.41a.211.211 0 0 0-.344.164v2.225H8.197a1.344 1.344 0 0 1-1.344-1.344V11.665a.75.75 0 0 1 .75-.75h9.872a.75.75 0 0 1 .75.75l-.003 7.534a2.422 2.422 0 0 1-.798 1.796l-.945.855h4.3a1.075 1.075 0 0 0 1.074-1.075v-10.54a2.231 2.231 0 0 0-2.23-2.23H5.354a2.148 2.148 0 0 0-2.13 2.23v16.507a2.231 2.231 0 0 0 2.23 2.231l19.695-.003v2.725a.211.211 0 0 0 .344.164l5.447-4.41a.158.158 0 0 0 0-.245z",fill:"#83a238"},"map-viewer":{path:"M21.647 13.706A1.647 1.647 0 1 1 20 15.353a1.647 1.647 0 0 1 1.647-1.647zM19 19.083A1.917 1.917 0 1 1 17.082 21 1.917 1.917 0 0 1 19 19.082zm7.684 3.393a2.433 2.433 0 0 1-.64 1.776l-.01.012c-1.045 1.134-3.215 1.8-5.738 1.8-3.815 0-5.054-1.485-8.586-1.828a6.765 6.765 0 0 1 .566-4.07c.98-1.674 2.445-1.568 3.41-2.724.967-1.157.033-3.384 1.397-4.748 1.539-1.538 3.44-.12 4.57-2.542.877-1.884 1.84-2.98 3.68-3.35a.39.39 0 0 1 .047.07c.132.695 1.097 11.68 1.304 15.604zM6.208 8.864A3.054 3.054 0 0 1 8.115 6.17s2.425-.88 3.09-1.029a2.637 2.637 0 0 1 .314-.01 4.967 4.967 0 0 1 1.157.157l.404.095a7.26 7.26 0 0 0-.238 3.294c.188 1.354.657 2.399-.066 4.361-1.003 2.721-2.901 2.585-3.857 4.562-1.285 2.657.21 6.226-2.182 6.835l.004.002.003.003c-.801.114-1.363.22-1.663.272zm21.549-5.09a.055.055 0 0 0-.022-.037.058.058 0 0 0-.037-.01l-7.37 1.025-8.771-2.742a.227.227 0 0 0-.162.01L3.594 5.566a.054.054 0 0 0-.032.045L1.58 29a41.592 41.592 0 0 1 9.115-1.285c2.765.094 6.646 2.287 10.29 2.177 3.51-.108 8.582-2.382 9.564-2.836a.054.054 0 0 0 .03-.056z",fill:"#3DB8FF"},"story-maps":{path:"M25.5 0C23.015 0 21 .953 21 3.433v8.517a1.467 1.467 0 0 0 .43 1.038l3.837 3.827a.33.33 0 0 0 .466 0l3.836-3.827A1.467 1.467 0 0 0 30 11.95V3.433C30 .953 27.985 0 25.5 0zm0 8.1a2.6 2.6 0 1 1 2.6-2.599A2.599 2.599 0 0 1 25.5 8.1zm-7.856.453c.294-.153.312-.457.312-.788v-2.31a.104.104 0 0 0-.129-.1 6.128 6.128 0 0 0-2.248 1.19.14.14 0 0 1-.167.008c-3.437-2.283-8.543-1.52-12.131-.988-.432.064-1.762.34-2.164.424A.146.146 0 0 0 1 6.133V26.69a.147.147 0 0 0 .05.11.134.134 0 0 0 .116.035A36.394 36.394 0 0 1 9.5 25.781c3.283.054 4.403.96 4.967 1.513l.915.897a.164.164 0 0 0 .23 0l.916-.897a5.98 5.98 0 0 1 3.972-1.47 25.341 25.341 0 0 1 5.715.516c.718.109 1.46.22 2.186.312l1.251.16a.308.308 0 0 0 .348-.305v-7.375a.161.161 0 0 0-.303-.077l-.107.2a7.218 7.218 0 0 1-6.902 3.766 10.455 10.455 0 0 0-5.688.796V9.454a.89.89 0 0 1 .332-.693 2.058 2.058 0 0 1 .312-.208zM14 23.817c-3.071-1.38-5.998-.808-9.447-.293l-.253.036a.263.263 0 0 1-.3-.259V8.525a.098.098 0 0 1 .084-.097l.804-.115c2.518-.372 6.303-1.048 8.708.515a.89.89 0 0 1 .404.746z",fill:"#4fbaa9"},dashboards:{path:"M25.819 28H23.18a.181.181 0 0 1-.181-.181V13.18a.181.181 0 0 1 .181-.181h2.638a.181.181 0 0 1 .181.181V27.82a.181.181 0 0 1-.181.181zM21 27.816v-9.631a.184.184 0 0 0-.184-.185h-2.631a.184.184 0 0 0-.185.184v9.631a.184.184 0 0 0 .184.185h2.631a.184.184 0 0 0 .185-.184zm9.82.184a.18.18 0 0 0 .18-.18v-7.64a.18.18 0 0 0-.18-.18h-2.64a.18.18 0 0 0-.18.18v7.64a.18.18 0 0 0 .18.18zM7 9.267v10.475c.706.033 3.538-1.718 4.274-4.7.679-2.751 3.485-2.864 4.443-2.94 1.766-.14 3.588-.607 4.566-2.798A.216.216 0 0 0 20.085 9H7.267A.267.267 0 0 0 7 9.267zm18.997-1.053A4.411 4.411 0 0 0 21.63 4H2.684A.684.684 0 0 0 2 4.684V21.81A3.19 3.19 0 0 0 5.19 25h9.565a.245.245 0 0 0 .245-.245v-2.362a.393.393 0 0 0-.393-.393H6.38A1.385 1.385 0 0 1 5 20.619V7.349A.348.348 0 0 1 5.348 7h16.324A1.346 1.346 0 0 1 23 8.363v1.28a.357.357 0 0 0 .357.357h2.599a.046.046 0 0 0 .046-.046z",fill:"#ee9e01"},"experience-builder":{path:"M30.85 12.82l-2.85 5v7.44A1.78 1.78 0 0 1 26.22 27H25V7.75a.76.76 0 0 0-.75-.75H12V1.31a.28.28 0 0 1 .42-.25L17.51 4h8.71A1.78 1.78 0 0 1 28 5.78v4.42l2.54 1.47a.83.83 0 0 1 .31 1.15zM12 18h8v-6h-8zm7.62 5H7.75a.76.76 0 0 1-.75-.75V4H5.78A1.78 1.78 0 0 0 4 5.78V13l-2.89 5a.85.85 0 0 0 .31 1.15L4 20.59v4.61A1.78 1.78 0 0 0 5.78 27h8.62l5.18 3a.28.28 0 0 0 .42-.24v-6.39a.38.38 0 0 0-.38-.37z",fill:"#09b8ca"},geoBIM:{path:"M17.802 21.398l6.2 2.557-5.14 2.133a.772.772 0 0 1-1.06-.717zM9.311 7.868a.604.604 0 0 1-.003-1.122L16 4.169l8.12 3.148-8.119 3.184zm-3.5 1.541l8.387 3.413v12.554a.772.772 0 0 1-1.06.717l-6.297-2.736a1.639 1.639 0 0 1-1.03-1.521zM3.844 6.03a1.316 1.316 0 0 0-.827 1.22v17.395a1.316 1.316 0 0 0 .827 1.221L16 30.888l12.983-5.317v-2.423l-7.156-3.023 7.156-2.963v-1.95l-5.101-2.2-3.867 1.516L24 16.123l-6.199 2.505v-5.711l.073-.122 11.108-4.487v-1.95l-12.47-5.047a1.384 1.384 0 0 0-1.027 0z",fill:"#11ad1d"},notebooks:{path:"M2.941 25A.906.906 0 0 1 2 24.135v-.271A.906.906 0 0 1 2.941 23h3.118a.906.906 0 0 1 .941.864v.271a.906.906 0 0 1-.941.865zm3.118-8A.906.906 0 0 0 7 16.135v-.271A.906.906 0 0 0 6.059 15H2.941a.906.906 0 0 0-.941.864v.271a.906.906 0 0 0 .941.865zm0-8A.906.906 0 0 0 7 8.135v-.271A.906.906 0 0 0 6.059 7H2.941A.906.906 0 0 0 2 7.864v.271A.906.906 0 0 0 2.941 9zm9.44 16h-3.726a.773.773 0 0 1-.773-.774V6.171A.172.172 0 0 1 11.172 6H15.5a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5H5.342A1.345 1.345 0 0 0 4 4.343V5h2.059A2.904 2.904 0 0 1 9 7.858v.277A2.907 2.907 0 0 1 6.059 11H4v2h2.059A2.907 2.907 0 0 1 9 15.864v.271A2.907 2.907 0 0 1 6.059 19H4v2h2.059A2.907 2.907 0 0 1 9 23.864v.271A2.907 2.907 0 0 1 6.059 27H4v1.405a.595.595 0 0 0 .595.595H15.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zM20 3.5v2a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 .5.5v18a.5.5 0 0 1-.5.5h-4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-25a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.499.5z",fill:"#6e6e6e"},sites:{path:"M2.656 29A.656.656 0 0 1 2 28.344V6.185A3.189 3.189 0 0 1 5.185 3H29.72a.281.281 0 0 1 .281.281v22.53A3.194 3.194 0 0 1 26.81 29zm2.838-3h21.211a.295.295 0 0 0 .296-.295V13.494a.493.493 0 0 0-.493-.494H5v12.506a.494.494 0 0 0 .494.494zM23 9.91a.09.09 0 0 0 .09.09h3.82a.09.09 0 0 0 .09-.09V6.026A.026.026 0 0 0 26.974 6h-3.948a.026.026 0 0 0-.026.026zM6.633 6A1.597 1.597 0 0 0 5 7.595V10h14.523A.477.477 0 0 0 20 9.523V6.477A.477.477 0 0 0 19.523 6zM16 22v-5h7v5zm-7-2v-3h3v3z",fill:"#7842ed"},webAppBuilder:{path:"M15.044 19.974a.188.188 0 0 1-.192-.001l-3.762-2.35a.188.188 0 0 1-.09-.16v-4.098a.188.188 0 0 1 .096-.163l3.761-2.178a.188.188 0 0 1 .182-.001l3.863 2.179a.188.188 0 0 1 .098.165v4.095a.187.187 0 0 1-.092.161zm15.13-1.04a.052.052 0 0 0 .099.022 8.048 8.048 0 0 0 .67-3.147 7.155 7.155 0 0 0-3.507-6.213L17.59 3.768a4.054 4.054 0 0 0-1.968-.627 3.95 3.95 0 0 0-1.894.485c-.607.334-1.132.67-1.278.754a2.951 2.951 0 0 0-1.39 2.506v1.078a.2.2 0 0 0 .307.167l1.365-.87a4.988 4.988 0 0 1 2.319-.792 4.62 4.62 0 0 1 2.219.792s8.442 5.017 9.392 5.576a7.045 7.045 0 0 1 3.513 6.084zM9.546 23.55l.947-.547a.2.2 0 0 0 0-.345l-1.369-.79a4.326 4.326 0 0 1-2.13-3.842V7.286a7.16 7.16 0 0 1 3.63-6.083l.081-.05a.025.025 0 0 0-.012-.045l-.25-.005a8.333 8.333 0 0 0-3.887.994A7.102 7.102 0 0 0 3.069 8.31v10.786a3.96 3.96 0 0 0 1.89 3.362c.894.545 1.605.974 1.81 1.092a2.787 2.787 0 0 0 2.777 0zm4.383 6.37l9.997-5.773a3.959 3.959 0 0 0 1.967-3.32c.021-.929.034-1.604.034-1.806a2.786 2.786 0 0 0-1.39-2.406l-1.123-.57a.2.2 0 0 0-.289.177v1.604a4.45 4.45 0 0 1-2.218 3.842l-3.708 2.14a3.366 3.366 0 0 1-.256.135L11.6 27.128a6.427 6.427 0 0 1-3.343.938 7.137 7.137 0 0 1-3.513-1.038c-.09-.052-.38-.226-.797-.479a.094.094 0 0 0-.134.12 7.182 7.182 0 0 0 2.942 3.25 7.241 7.241 0 0 0 3.587 1.028 7.243 7.243 0 0 0 3.587-1.028z",fill:"#09b8ca"},urban:{path:"M32 14l-4 .003a1 1 0 0 0-1 1V21a1 1 0 0 1-1 1h-2V5.451l-7.598-3.335A1 1 0 0 0 15 3.03V25a1 1 0 0 1-1 1h-2V11.24h-.02L7.5 9l-4.48 2.24H3V20H0v4h5a1 1 0 0 0 1-1V12.717L7.5 12l1.5.717V28a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V6.094l3 1.317V24a2 2 0 0 0 2 2h5.02A1.977 1.977 0 0 0 30 24.024V17h2z",fill:"#3DB8FF"}},c=new Map;function l(t){return c[t]||""}Object.keys(o).forEach((t=>{c[t]=`<svg viewBox="0 0 32 32" width="32" height="32" fill="${o[t].fill}"><path d="${o[t].path}"/></svg>`}));const p="instant-apps-create calcite-mode-light",h=class{constructor(a){t(this,a),this.popoverIcon="grid",this.mode="inline",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.showHeader=!0,this.content=void 0,this.options=["instant-apps","map-viewer","story-maps","experience-builder","dashboards"],this.portal=void 0,this.baseClass=p,this.messages={},this.CreateOptionsLookup=void 0}contentChanged(){Object.keys(this.CreateOptionsLookup).forEach((t=>{this.CreateOptionsLookup[t].href=this.hrefLookup(t)}))}componentWillLoad(){return this.baseClass="dark"===s(this.el)?"instant-apps-create calcite-mode-dark":p,this.initializeModules(),n(this).then((()=>{this.initializePredefinedOptions()}))}disconnectedCallback(){var t,a;null===(t=this.handles)||void 0===t||t.removeAll(),null===(a=this.handles)||void 0===a||a.destroy(),this.handles=null}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel();return a(e,{key:"ee6a5076dce36a238288216de4cbd77d16347c15"},a("div",{key:"c22b60a05f5d0b430c76ab8edcf52577f1eecfaa",class:this.baseClass},t))}async initializeModules(){const[t]=await r(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}initializePredefinedOptions(){const{instantApps:t,instantAppsDesc:a,mapViewer:e,mapViewerDesc:i,arcgisStoryMaps:n,storyMapsDesc:r,experienceBuilder:s,experienceBuilderDesc:o,dashboards:c,dashboardsDesc:p}=this.messages;this.CreateOptionsLookup={"instant-apps":{title:t,subtitle:a,img:l("instant-apps"),href:this.hrefLookup("instant-apps")},"map-viewer":{title:e,subtitle:i,img:l("map-viewer"),href:this.hrefLookup("map-viewer")},"story-maps":{title:n,subtitle:r,img:l("story-maps"),href:this.hrefLookup("story-maps")},"experience-builder":{title:s,subtitle:o,img:l("experience-builder"),href:this.hrefLookup("experience-builder")},dashboards:{title:c,subtitle:p,img:l("dashboards"),href:this.hrefLookup("dashboards")}}}hrefLookup(t){var a,e;const i=this.getBaseUrl(this.portal),n=this._getEnvironment(i),r=this.contentHref();switch(t){case"instant-apps":return`${i}/apps/instantgallery/index.html?${r}`;case"dashboards":return`${i}/apps/dashboards/new#id=${null===(e=null===(a=this.content)||void 0===a?void 0:a.portalItem)||void 0===e?void 0:e.id}`;case"map-viewer":return`${i}/apps/mapviewer/index.html?${r}`;case"story-maps":return`https://storymaps${"prod"===n?"":n}.arcgis.com/stories/new?${r}`;case"experience-builder":return`https://experience${"prod"===n?"":n}.arcgis.com/builder/page/template/?${r}`}return""}contentHref(){var t,a,e,i,n;return"Web Map"===(null===(a=null===(t=null==this?void 0:this.content)||void 0===t?void 0:t.portalItem)||void 0===a?void 0:a.type)?`webmap=${this.content.portalItem.id}`:"Web Scene"===(null===(i=null===(e=null==this?void 0:this.content)||void 0===e?void 0:e.portalItem)||void 0===i?void 0:i.type)?`webscene=${this.content.portalItem.id}`:"function"==typeof(null===(n=null==this?void 0:this.content)||void 0===n?void 0:n.fetchMembers)?`group=${this.content.id}`:""}getBaseUrl(t){if(!t)return"";const{customBaseUrl:a,portalHostname:e,urlKey:i}=t,{protocol:n}=location;return`${n}//${i?`${i}.${a}`:e}`}_getEnvironment(t){var a;let e=null;try{e=null===(a=new URL(t))||void 0===a?void 0:a.hostname}catch(t){}return null==e||-1===e.indexOf("arcgis.com")?"dev":(-1!==e.indexOf("devext")?"dev":-1!==e.indexOf("qaext")&&"qa")||"prod"}renderPopover(){var t,e;const i=this.renderPanel();return[a("calcite-popover",{referenceElement:"create-popover-btn",overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t,label:"Create panel"},i),a("calcite-action",{id:"create-popover-btn",alignment:"center",icon:this.popoverIcon,title:null===(t=this.messages)||void 0===t?void 0:t.create,text:null===(e=this.messages)||void 0===e?void 0:e.create})]}renderPanel(){const t=this.showHeader?this.renderHeader():null,e=this.renderOptions();return a("div",{class:"inline"===this.mode?"instant-apps-create__inline-container":"instant-apps-create__popover-container"},t,e)}renderHeader(){const{create:t,createSubheading:e}=this.messages;return a("div",{class:"instant-apps-create__header"},a("h3",null,t),a("p",null,e))}renderOptions(){return a("nav",null,this.options.map((t=>this.renderOption(t))))}renderOption(t){var e;"string"==typeof t&&(t=null===(e=null==this?void 0:this.CreateOptionsLookup)||void 0===e?void 0:e[t]);const{title:i,subtitle:n,img:r,href:s}=t||{};return a("a",{class:"instant-apps-create__option",href:s,target:"_blank"},a("span",{class:"instant-apps-create__option-icon",innerHTML:r}),a("span",{class:"instant-apps-create__option-text"},a("span",{class:"instant-apps-create__option-text-wrapper"},a("h3",{class:"instant-apps-create__option-title"},i),a("calcite-icon",{scale:"s",icon:"launch"})),a("p",{class:"instant-apps-create__option-subtitle"},n)))}get el(){return i(this)}static get watchers(){return{content:["contentChanged"]}}};h.style=":host{display:block;--instant-apps-create-action-background:var(--calcite-color-foreground-1);--instant-apps-create-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-create-action-background-press:var(--calcite-color-foreground-3);--instant-apps-create-action-height:100%;--instant-apps-create-action-width:fit-content;--instant-apps-create-action-icon-color:var(--calcite-color-text-3);--instant-apps-create-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-create-background:var(--calcite-color-foreground-1);--instant-apps-create-text-color:var(--calcite-color-text-1);--instant-apps-create-popover-width:450px}.instant-apps-create{height:100%}.instant-apps-create *{box-sizing:border-box}.instant-apps-create__popover-container,.instant-apps-create__inline-container{padding:1rem 1.5rem;background:var(--instant-apps-create-background);--calcite-color-text-1:var(--instant-apps-create-text-color)}.instant-apps-create__popover-container{width:var(--instant-apps-create-popover-width)}.instant-apps-create calcite-popover{--calcite-color-foreground-1:var(--instant-apps-create-background)}.instant-apps-create calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-create__header h3{margin:0;font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__header p{margin:0;padding:0 0 0.5rem 0;font-weight:var(--calcite-font-weight-normal)}.instant-apps-create__options{display:flex;justify-content:space-between;align-items:center;flex-direction:column}.instant-apps-create__option{display:flex;color:inherit;text-decoration:inherit;height:-moz-fit-content;height:fit-content;margin-bottom:0.5rem;cursor:pointer;--calcite-color-text-link:var(--calcite-color-text-1);align-items:stretch;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);outline-offset:0;outline-color:transparent;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.instant-apps-create__option:first-of-type{margin-top:0.5rem}.instant-apps-create__option:last-of-type{margin-bottom:0}.instant-apps-create__option:hover{outline:1px solid var(--calcite-color-border-1);outline-offset:2px}.instant-apps-create__option-icon{display:flex;background:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);font-size:1.25rem;background-color:var(--calcite-color-background);justify-content:center;align-items:center;flex:1 1 auto;max-width:5rem;min-width:5rem;height:auto}.instant-apps-create__option-icon svg{display:block;overflow-clip-margin:content-box;overflow:hidden}.instant-apps-create__option-text{min-height:2rem;font-size:0.75rem;color:var(--calcite-color-text-2);padding:0.75rem 0 0 0.75rem}.instant-apps-create__option-text-wrapper{display:flex;align-items:center}.instant-apps-create__option-text h3{margin:0;font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.instant-apps-create__option-text calcite-icon{margin-left:0.25rem;color:rgb(126, 126, 126);--tw-translate-x:0px;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;transition-delay:0s}a:hover .instant-apps-create__option-text calcite-icon{opacity:1;--tw-translate-x:0.5rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.instant-apps-create__option-text p{margin:0;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3);line-height:1.35;min-height:3rem}";export{h as instant_apps_create}
|
@@ -3,15 +3,15 @@
|
|
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,h as i,g as s,c as e,H as a,F as o}from"./p-f4c4a2b7.js";import{c}from"./p-901c7dc6.js";import{c
|
6
|
+
import{r as t,h as i,g as s,c as e,H as a,F as o}from"./p-f4c4a2b7.js";import{c as n}from"./p-901c7dc6.js";import{c,s as h,a as r}from"./p-d351bd0a.js";import{a as l}from"./p-dd119c31.js";import{c as d,u as b,d as p,I as f}from"./p-77dc9d68.js";import{c as m,d as y}from"./p-291217a6.js";import{c as g,s as u,d as w,u as k}from"./p-1586a4c7.js";import{S as v}from"./p-158aba52.js";import{l as _,f as L,g as x}from"./p-d7868dd4.js";import{a as C,g as S,b as E,d as I}from"./p-eb483242.js";import"./p-ac58e523.js";import"./p-5e4643ec.js";import"./p-e756a5dc.js";import"./p-545b56c7.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
10
10
|
* v2.10.1
|
11
|
-
*/const F="frame",W="frame--advancing",j="frame--retreating",z=class{constructor(i){t(this,i),this.itemMutationObserver=
|
11
|
+
*/const F="frame",W="frame--advancing",j="frame--retreating",z=class{constructor(i){t(this,i),this.itemMutationObserver=n("mutation",(()=>this.updateFlowProps())),this.getFlowDirection=(t,i)=>t&&i>1||t>1?i<t?"retreating":"advancing":null,this.updateFlowProps=()=>{const{customItemSelectors:t,el:i,items:s}=this,e=Array.from(i.querySelectorAll("calcite-flow-item"+(t?`,${t}`:""))).filter((t=>t.closest("calcite-flow")===i)),a=s.length,o=e.length,n=e[o-1],c=e[o-2];if(o&&n&&e.forEach((t=>{t.showBackButton=t===n&&o>1,t.hidden=t!==n})),c&&(c.menuOpen=!1),this.items=e,a!==o){const t=this.getFlowDirection(a,o);this.itemCount=o,this.flowDirection=t}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,i=t[t.length-1];if(!i)return;const s=i.beforeBack?i.beforeBack:()=>Promise.resolve();try{await s.call(i)}catch(t){return}return i.remove(),i}async setFocus(){await c(this);const{items:t}=this,i=t[t.length-1];return i?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){h(this)}componentDidLoad(){r(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this;return i("div",{key:"9d405841d7a1ee2d7a5da28c02ef8d5bf08dd9f5",class:{[F]:!0,[W]:"advancing"===t,[j]:"retreating"===t}},i("slot",{key:"a02231a5002f8b19542e03529aad12771787b26f"}))}get el(){return s(this)}};z.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}";
|
12
12
|
/*!
|
13
13
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
14
14
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
15
15
|
* v2.10.1
|
16
16
|
*/
|
17
|
-
const D=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=t=>{t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),m(this),g(this)}async componentWillLoad(){await u(this),h(this)}componentDidRender(){b(this)}disconnectedCallback(){p(this),y(this),w(this)}componentDidLoad(){r(this)}effectiveLocaleChange(){k(this,this.effectiveLocale)}async setFocus(){await n(this);const{backButtonEl:t,containerEl:i}=this;return t?t.setFocus():i?i.setFocus():void 0}async scrollContentTo(t){await(this.containerEl?.scrollContentTo(t))}renderBackButton(){const{el:t}=this,s="rtl"===l(t),{showBackButton:e,backButtonClick:a,messages:o}=this,c=o.back;return e?i("calcite-action",{"aria-label":c,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:c,description:n,disabled:h,heading:r,headingLevel:l,loading:d,menuOpen:b,messages:p,overlayPositioning:m}=this;return i(a,{key:"386f2c2d780c8b3a1be28a8680b6f99c9ded37e6"},i(f,{key:"6e80e71a06923e966ac75f8b8c172586444e3ccb",disabled:h},i("calcite-panel",{key:"175b4bcfdecb5b4c59d5c76db6fcae7975ee5884",closable:o,closed:c,collapseDirection:s,collapsed:t,collapsible:e,description:n,disabled:h,heading:r,headingLevel:l,loading:d,menuOpen:b,messageOverrides:p,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,overlayPositioning:m,ref:this.setContainerRef},this.renderBackButton(),i("slot",{key:"6e0ac6b3c3b62a5be7a6a21fbe55e56c1d4ad90a",name:"action-bar",slot:v.actionBar}),i("slot",{key:"b2036686e62d9b5c8ecc39e8ee025e98798d7dec",name:"header-actions-start",slot:v.headerActionsStart}),i("slot",{key:"66c09bbb9cd21327a9cc04b3046c5264b475a77d",name:"header-actions-end",slot:v.headerActionsEnd}),i("slot",{key:"cd02bc580db5ecdd98b0bbbfa99655871c04bda4",name:"header-content",slot:v.headerContent}),i("slot",{key:"b855684ce946c66b4c13756abd1865ab420715f0",name:"header-menu-actions",slot:v.headerMenuActions}),i("slot",{key:"f1d29575abbdb582c04d674dfef7f4a9d385da10",name:"fab",slot:v.fab}),i("slot",{key:"3033128596131e0f1fd62b28cba07957d1707d0c",name:"content-top",slot:v.contentTop}),i("slot",{key:"c8cf03fbacebe288afc909b9c8989242c201df8c",name:"content-bottom",slot:v.contentBottom}),i("slot",{key:"09e19f66b3a855689539dc511b1b826830a90283",name:"footer",slot:v.footer},i("slot",{key:"e7519384a44ee5f1f19d9747c44007ca7b95f4c8",name:"footer-start",slot:v.footerStart}),i("slot",{key:"abd54ab99d62783f603118361bda307c3d108af0",name:"footer-end",slot:v.footerEnd})),i("slot",{key:"9319eff4559e39701a1f838c1add5b8f57f01f2b",name:"footer-actions",slot:v.footerActions}),i("slot",{key:"bd1cc6da3068868bfaf3ba8a0e524d0d138db940"}))))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};D.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const B=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.progressStatus=e(this,"progressStatus",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1,this.searchConfiguration=void 0,this._editorLoading=!1,this._showSearchWidget=void 0}get el(){return s(this)}Editor;_editor;FeatureLayer;Search;_search;reactiveUtils;_addingAttachment;_container;_isSubmitBtnClicked=!1;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}success;fail;drawComplete;editingAttachment;progressStatus;async componentWillLoad(){await this.initModules()}async componentDidLoad(){await this.init()}render(){const t=this._showSearchWidget?"":"display-none",s=this._editorLoading?"display-none":"";return i(o,{key:"a4ccd565a52a4cde4e76439629425f19bd4c222e"},i("calcite-loader",{key:"30e8a3753985a734dd7cba461f26691b51f49ab9",class:this._editorLoading?"":"display-none",label:"",scale:"s"}),i("div",{key:"0845f1fa85a21b578fd18200b43d4a77c34e6808",class:s,id:"feature-form"}),i("div",{key:"af74b6337f5a0dcfdbd552145c88eae5282a3307",class:`search-widget ${t} ${s}`,id:"search-widget-ref"}))}async init(){this.mapView&&this.selectedLayerId&&(await this.createEditorWidget(),await this.createSearchWidget())}async initModules(){const[t,i,s]=await _(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search"]);this.Editor=t,this.reactiveUtils=i,this.Search=s}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none"),(await C(this.mapView)).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({allowedWorkflows:"create-features",view:this.mapView,layerInfos:t,visibleElements:{snappingControls:!1},container:this._container}),this.el.appendChild(this._container);const i=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(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this.progressStatus.emit(.5),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._showSearchWidget=!1,this.progressStatus.emit(1),this.drawComplete.emit())}));this._editor.viewModel.addHandles(e);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&(this._editorLoading=!0,this._showSearchWidget=!0)}));this._editor.viewModel.addHandles(a)}async startCreate(){return new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const s=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(.75),setTimeout((()=>{this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===s.length&&this._editor.viewModel.featureTemplatesViewModel.select(s[0]);const e=s.length>1;this.hideEditorsElements().then((()=>{e&&t({})}),(t=>e&&i(t)))}}))}async createSearchWidget(){let t={view:this.mapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;const i=await S(this.mapView,this.selectedLayerId);let s=null;this._search.on("search-complete",(t=>{this.mapView.goTo(t.results[0].results[0].extent),"point"===i.geometryType&&(s=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&&s&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",s),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_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,o=s?.layer?.url;a?s.layer=a:o&&(s.layer=new this.FeatureLayer(o))}})),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}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(t.valid.length&&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)))}static get watchers(){return{mapView:["mapViewWatchHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};B.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{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 0 20px 14px}.display-none{display:none !important}";const H=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.isActionPending=e(this,"isActionPending",7),this.formReady=e(this,"formReady",7),this.mapView=void 0,this.table=void 0,this.selectedFeature=void 0,this.customizeSubmit=!1,this._editorLoading=!1}get el(){return s(this)}Editor;_editor;reactiveUtils;_container;_addingAttachment;_isSubmitBtnClicked=!1;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}success;fail;isActionPending;formReady;async componentWillLoad(){await this.initModules()}async init(){this.mapView&&await this.createEditorWidget()}async initModules(){const[t,i]=await _(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}render(){return i("calcite-loader",{key:"5302b1166a175b0605604792cd40b9d3fbfabd02",class:this._editorLoading?"":"display-none",label:"",scale:"s"})}async componentDidLoad(){await this.init()}async createEditorWidget(){this._editor&&this._editor.destroy(),this._container=document.createElement("div"),this._container?.classList.add("display-none"),this._editor=new this.Editor({view:this.mapView,visibleElements:{snappingControls:!1},container:this._container}),this.el.appendChild(this._container);const t=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this._editorLoading=!0)}));this._editor.viewModel.addHandles(t);const i=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&this.formReady.emit()}));this._editor.viewModel.addHandles(s)}async startCreate(){const t=this.selectedFeature.layer,i=this.table,s=t.relationships[0],e=i.relationships.find((i=>t.layerId===i.relatedTableId)),a=await t.queryFeatures({objectIds:[this.selectedFeature.getObjectId()],outFields:[t.objectIdField,s.keyField]}),o=i.templates[0],c={attributeOverrides:this.makeAttributesForRelatedFeature(a.features[0],s,e),layer:i,template:o};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(c),await this.hideEditorsElements(),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this))}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")})))}makeAttributesForRelatedFeature(t,i,s){const e=t.getAttribute(i.keyField);let a=s.keyField;const o=this.table.fields.find((t=>t.name.toLocaleLowerCase()===a.toLocaleLowerCase()));return a=o.name,{[a]:e}}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&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)))}static get watchers(){return{mapView:["mapViewWatchHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};H.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.display-none{display:none !important}";const P=class{constructor(i){t(this,i),this.loadingStatus=e(this,"loadingStatus",7),this.commentSelect=e(this,"commentSelect",7),this.featureSelectionChange=e(this,"featureSelectionChange",7),this.mapView=void 0,this.graphics=void 0,this.reportingOptions=void 0,this.layerItemsHash=void 0,this._likeFieldAvailable=!1,this._likeCount=0,this._disLikeCount=0,this._dislikeFieldAvailable=!1,this._commentsAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._relatedFeaturesOIDs=void 0,this._updating=!1}get el(){return s(this)}_infoCard;_commentsList;_selectedGraphic;_likeField;_dislikeField;Graphic;RelationshipQuery;_validFieldTypes=["small-integer","integer","big-integer","single","long"];relatedTableId;async graphicsWatchHandler(){await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}async refresh(t){await this.getCompleteGraphic(t),await this.processComments(),this.isLikeDislikeConfigured(t.layer)?t&&this.graphics.length>1&&this.checkLikeDislikeFields():(this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1)}async back(){this._infoCard.back()}async next(){this._infoCard.next()}async toggleListView(){this._infoCard.toggleListView()}loadingStatus;commentSelect;featureSelectionChange;async componentWillLoad(){await this._initModules(),await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}render(){const t=this._relatedFeaturesOIDs?.length>0?`objectId in(${this._relatedFeaturesOIDs})`:"1=0";return i("calcite-panel",{key:"7f1fa230117891c11ff6747b7d3c5d6c8771c998","full-height":!0},i("info-card",{key:"2b9119b5a0533d2ed8136149dd322aa9211f503b",allowEditing:!1,graphics:this.graphics,highlightEnabled:!1,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:t=>{this.featureSelectionChange.emit(t.detail)},paginationEnabled:!1,position:"relative",ref:t=>this._infoCard=t}),(this._likeFieldAvailable||this._dislikeFieldAvailable||this._commentsAvailable)&&i("div",{key:"85974c4ff61890dc43c02b84b9c6622e83039cdd",class:"buttons-container"},this._commentsAvailable&&i("div",{key:"8b905e1ee273103247f6cab2c598b03f1f733396",class:"comment-btn"},i("span",{key:"05439cbc1e6080006479ce3694f4d1f81684a9d7"},this._relatedFeaturesOIDs.length),i("calcite-icon",{key:"0e7062d1bc383c2f2fdd50ff003ea6a854e1a121",icon:"speech-bubble",scale:"s"})),this._likeFieldAvailable&&i("calcite-button",{key:"26a024436a8e0c4251c200f112e6cc687795c85a",appearance:"transparent",iconEnd:"thumbs-up",kind:this._isLikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onLikeButtonClick.bind(this),scale:"m"},this._likeCount??this._selectedGraphic.attributes[this._likeField]??0),this._dislikeFieldAvailable&&i("calcite-button",{key:"67d1ebe6b0ba1893aac9f26e4cebfe30569115d5",appearance:"transparent",iconEnd:"thumbs-down",kind:this._isDislikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onDislikeButtonClick.bind(this),scale:"m"},this._disLikeCount??this._selectedGraphic.attributes[this._dislikeField]??0)),this.relatedTableId&&this._commentsAvailable&&i("feature-list",{key:"7ed006e8be5f7280fdd260102111aad4656526f6",class:"height-full",mapView:this.mapView,onFeatureSelect:t=>{this.commentSelect.emit(t.detail)},pageSize:5,ref:t=>this._commentsList=t,selectedLayerId:this.relatedTableId,showErrorWhenNoFeatures:!1,showInitialLoading:!1,textSize:"small",whereClause:t}))}async _initModules(){const[t,i]=await _(["esri/rest/support/RelationshipQuery","esri/Graphic"]);this.RelationshipQuery=t,this.Graphic=i}async getCompleteGraphic(t){const i=t.layer,s=i.createQuery();s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this._selectedGraphic=e.features[0]}async processComments(){const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]&&this.reportingOptions[t.id].comment&&t.relationships?.length>0){const i=t.relationships[0].relatedTableId,s=(await E(this.mapView)).filter((s=>t.url===s.url&&i===s.layerId));if(this.relatedTableId=s?.length>0?s[0].id:"",this.relatedTableId){const i=this._selectedGraphic.attributes[t.objectIdField],s=new this.RelationshipQuery({objectIds:[i],outFields:["*"],relationshipId:t.relationships[0].id}),e=await t.queryRelatedFeatures(s).catch((t=>{console.error(t)})),a=[];e[i]&&e[i].features.forEach((t=>{a.push(t.attributes.OBJECTID)})),this._relatedFeaturesOIDs=a,this._commentsAvailable=!0}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1,this.relatedTableId=""}isLikeDislikeConfigured(t){let i=!1,s=!1;if(this.reportingOptions&&this.reportingOptions[t.id]){if(!this.reportingOptions[t.id].like&&!this.reportingOptions[t.id].dislike)return!1;const e=this.reportingOptions[t.id].likeField,a=this.reportingOptions[t.id].dislikeField;if(!e&&!a)return!1;t.fields.forEach((o=>{this._validFieldTypes.indexOf(o.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(o.name===e&&this.reportingOptions[t.id].like?i=!0:o.name===a&&this.reportingOptions[t.id].dislike&&(s=!0))}))}return i||s}checkLikeDislikeFields(){this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._likeCount=0,this._disLikeCount=0;const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]){if(this._likeField=this.reportingOptions[t.id].likeField,this._dislikeField=this.reportingOptions[t.id].dislikeField,!this._likeField&&!this._dislikeField)return;t.fields.forEach((i=>{this._validFieldTypes.indexOf(i.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(i.name===this._likeField&&this.reportingOptions[t.id].like?(this._likeFieldAvailable=!0,this._likeCount=this._selectedGraphic.attributes[i.name]):i.name===this._dislikeField&&this.reportingOptions[t.id].dislike&&(this._dislikeFieldAvailable=!0,this._disLikeCount=this._selectedGraphic.attributes[i.name]))})),this.getFromLocalStorage()}}onLikeButtonClick(){this._isDislikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].dislike&&this.onDislikeButtonClick(),this._isLikeBtnClicked=!this._isLikeBtnClicked,this._isLikeBtnClicked?this._likeCount++:this._likeCount--,this.updateFeaturesLikeDislikeField(this._likeField,this._isLikeBtnClicked)}onDislikeButtonClick(){this._isLikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].like&&this.onLikeButtonClick(),this._isDislikeBtnClicked=!this._isDislikeBtnClicked,this._isDislikeBtnClicked?this._disLikeCount++:this._disLikeCount--,this.updateFeaturesLikeDislikeField(this._dislikeField,this._isDislikeBtnClicked)}async updateFeaturesLikeDislikeField(t,i){const s={},e=this._selectedGraphic.layer;this._updating=!0;const a=this._selectedGraphic;a.attributes[t]=Number(a.attributes[t])+(i?1:-1),s[e.objectIdField]=a.attributes[e.objectIdField],s[t]=a.attributes[t];const o=new this.Graphic;o.attributes=s;const c={updateFeatures:[o]};await e.applyEdits(c).then((()=>{this._selectedGraphic=a,this.setInLocalStorage(),this._updating=!1}),(t=>{this._updating=!1,console.log(t)}))}getFromLocalStorage(){const t=localStorage[this._selectedGraphic.layer.id];if(t){const i=JSON.parse(t).filter((t=>t.id===this._selectedGraphic.getObjectId()));i.length>0&&(this._isLikeBtnClicked=i[0].like,this._isDislikeBtnClicked=i[0].dislike)}}setInLocalStorage(){const t=this._selectedGraphic.layer.id,i=localStorage[t];let s=[];if(i){s=JSON.parse(i);const t=s.findIndex((t=>t.id===this._selectedGraphic.getObjectId()));t>=0&&s.splice(t,1)}s.push({id:this._selectedGraphic.getObjectId(),like:this._isLikeBtnClicked&&0!==this._likeCount,dislike:this._isDislikeBtnClicked&&0!==this._disLikeCount}),localStorage.setItem(t,JSON.stringify(s))}static get watchers(){return{graphics:["graphicsWatchHandler"]}}};P.style=":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";const T=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.showFeatureCount=!0,this.showNextIcon=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}get el(){return s(this)}_layerItemsHash;async refresh(){await this.setLayers()}layerSelect;layersListLoaded;async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,{key:"9366302a704c1dbdd7a65aef5c43d0ad84a44b23"},this._isLoading&&i("calcite-loader",{key:"69974a23fd42bc37ef13816efbe6d06e28cb2749",label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{key:"a93abb55b4db09727b3634cb1935e482c377d662",class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{key:"b9046685353b8894e6c6094cff47fab7a8e07ffa",slot:"title"},this._translations.error),i("div",{key:"90a052e1d80779a09a32fdd35563a1ce21d582e0",slot:"message"},this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{key:"709c1b8edd5710a2476ecef638199c2f929b4165","selection-appearance":"border","selection-mode":"none"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await I(this.mapView,!0),(await C(this.mapView)).forEach((async i=>{if("feature"===i?.type&&this.showFeatureCount){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await L(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getLayersToBeShownInList(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getLayersToBeShownInList(t){const i=this.layers?.length>0?this.layers:[];return Object.keys(t).reduce(((t,s)=>(i.indexOf(s)>-1&&t.push(s),t)),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}};T.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{z as calcite_flow,D as calcite_flow_item,B as create_feature,H as create_related_feature,P as feature_details,T as layer_list}
|
17
|
+
const D=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=t=>{t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),m(this),g(this)}async componentWillLoad(){await u(this),h(this)}componentDidRender(){b(this)}disconnectedCallback(){p(this),y(this),w(this)}componentDidLoad(){r(this)}effectiveLocaleChange(){k(this,this.effectiveLocale)}async setFocus(){await c(this);const{backButtonEl:t,containerEl:i}=this;return t?t.setFocus():i?i.setFocus():void 0}async scrollContentTo(t){await(this.containerEl?.scrollContentTo(t))}renderBackButton(){const{el:t}=this,s="rtl"===l(t),{showBackButton:e,backButtonClick:a,messages:o}=this,n=o.back;return e?i("calcite-action",{"aria-label":n,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:n,title:n}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:n,description:c,disabled:h,heading:r,headingLevel:l,loading:d,menuOpen:b,messages:p,overlayPositioning:m}=this;return i(a,{key:"386f2c2d780c8b3a1be28a8680b6f99c9ded37e6"},i(f,{key:"6e80e71a06923e966ac75f8b8c172586444e3ccb",disabled:h},i("calcite-panel",{key:"175b4bcfdecb5b4c59d5c76db6fcae7975ee5884",closable:o,closed:n,collapseDirection:s,collapsed:t,collapsible:e,description:c,disabled:h,heading:r,headingLevel:l,loading:d,menuOpen:b,messageOverrides:p,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,overlayPositioning:m,ref:this.setContainerRef},this.renderBackButton(),i("slot",{key:"6e0ac6b3c3b62a5be7a6a21fbe55e56c1d4ad90a",name:"action-bar",slot:v.actionBar}),i("slot",{key:"b2036686e62d9b5c8ecc39e8ee025e98798d7dec",name:"header-actions-start",slot:v.headerActionsStart}),i("slot",{key:"66c09bbb9cd21327a9cc04b3046c5264b475a77d",name:"header-actions-end",slot:v.headerActionsEnd}),i("slot",{key:"cd02bc580db5ecdd98b0bbbfa99655871c04bda4",name:"header-content",slot:v.headerContent}),i("slot",{key:"b855684ce946c66b4c13756abd1865ab420715f0",name:"header-menu-actions",slot:v.headerMenuActions}),i("slot",{key:"f1d29575abbdb582c04d674dfef7f4a9d385da10",name:"fab",slot:v.fab}),i("slot",{key:"3033128596131e0f1fd62b28cba07957d1707d0c",name:"content-top",slot:v.contentTop}),i("slot",{key:"c8cf03fbacebe288afc909b9c8989242c201df8c",name:"content-bottom",slot:v.contentBottom}),i("slot",{key:"09e19f66b3a855689539dc511b1b826830a90283",name:"footer",slot:v.footer},i("slot",{key:"e7519384a44ee5f1f19d9747c44007ca7b95f4c8",name:"footer-start",slot:v.footerStart}),i("slot",{key:"abd54ab99d62783f603118361bda307c3d108af0",name:"footer-end",slot:v.footerEnd})),i("slot",{key:"9319eff4559e39701a1f838c1add5b8f57f01f2b",name:"footer-actions",slot:v.footerActions}),i("slot",{key:"bd1cc6da3068868bfaf3ba8a0e524d0d138db940"}))))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};D.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const B=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.progressStatus=e(this,"progressStatus",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1,this.searchConfiguration=void 0,this._editorLoading=!1,this._showSearchWidget=void 0}get el(){return s(this)}Editor;_editor;FeatureLayer;Search;_search;reactiveUtils;_addingAttachment;_container;_isSubmitBtnClicked=!1;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}success;fail;drawComplete;editingAttachment;progressStatus;async componentWillLoad(){await this.initModules()}async componentDidLoad(){await this.init()}render(){const t=this._showSearchWidget?"":"display-none",s=this._editorLoading?"display-none":"";return i(o,{key:"a4ccd565a52a4cde4e76439629425f19bd4c222e"},i("calcite-loader",{key:"30e8a3753985a734dd7cba461f26691b51f49ab9",class:this._editorLoading?"":"display-none",label:"",scale:"s"}),i("div",{key:"0845f1fa85a21b578fd18200b43d4a77c34e6808",class:s,id:"feature-form"}),i("div",{key:"af74b6337f5a0dcfdbd552145c88eae5282a3307",class:`search-widget ${t} ${s}`,id:"search-widget-ref"}))}async init(){this.mapView&&this.selectedLayerId&&(await this.createEditorWidget(),await this.createSearchWidget())}async initModules(){const[t,i,s]=await _(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search"]);this.Editor=t,this.reactiveUtils=i,this.Search=s}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none"),(await C(this.mapView)).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({allowedWorkflows:"create-features",view:this.mapView,layerInfos:t,visibleElements:{snappingControls:!1},container:this._container}),this.el.appendChild(this._container);const i=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(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this.progressStatus.emit(.5),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._showSearchWidget=!1,this.progressStatus.emit(1),this.drawComplete.emit())}));this._editor.viewModel.addHandles(e);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&(this._editorLoading=!0,this._showSearchWidget=!0)}));this._editor.viewModel.addHandles(a)}async startCreate(){return new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const s=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(.75),setTimeout((()=>{this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===s.length&&this._editor.viewModel.featureTemplatesViewModel.select(s[0]);const e=s.length>1;this.hideEditorsElements().then((()=>{e&&t({})}),(t=>e&&i(t)))}}))}async createSearchWidget(){let t={view:this.mapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;const i=await S(this.mapView,this.selectedLayerId);let s=null;this._search.on("search-complete",(t=>{this.mapView.goTo(t.results[0].results[0].extent),"point"===i.geometryType&&(s=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&&s&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",s),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_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,o=s?.layer?.url;a?s.layer=a:o&&(s.layer=new this.FeatureLayer(o))}})),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}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(t.valid.length&&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)))}static get watchers(){return{mapView:["mapViewWatchHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};B.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{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 0 20px 14px}.display-none{display:none !important}";const H=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.isActionPending=e(this,"isActionPending",7),this.formReady=e(this,"formReady",7),this.mapView=void 0,this.table=void 0,this.selectedFeature=void 0,this.customizeSubmit=!1,this._editorLoading=!1}get el(){return s(this)}Editor;_editor;reactiveUtils;_container;_addingAttachment;_isSubmitBtnClicked=!1;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}success;fail;isActionPending;formReady;async componentWillLoad(){await this.initModules()}async init(){this.mapView&&await this.createEditorWidget()}async initModules(){const[t,i]=await _(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}render(){return i("calcite-loader",{key:"5302b1166a175b0605604792cd40b9d3fbfabd02",class:this._editorLoading?"":"display-none",label:"",scale:"s"})}async componentDidLoad(){await this.init()}async createEditorWidget(){this._editor&&this._editor.destroy(),this._container=document.createElement("div"),this._container?.classList.add("display-none"),this._editor=new this.Editor({view:this.mapView,visibleElements:{snappingControls:!1},container:this._container}),this.el.appendChild(this._container);const t=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this._editorLoading=!0)}));this._editor.viewModel.addHandles(t);const i=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&this.formReady.emit()}));this._editor.viewModel.addHandles(s)}async startCreate(){const t=this.selectedFeature.layer,i=this.table,s=t.relationships[0],e=i.relationships.find((i=>t.layerId===i.relatedTableId)),a=await t.queryFeatures({objectIds:[this.selectedFeature.getObjectId()],outFields:[t.objectIdField,s.keyField]}),o=i.templates[0],n={attributeOverrides:this.makeAttributesForRelatedFeature(a.features[0],s,e),layer:i,template:o};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(n),await this.hideEditorsElements(),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this))}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")})))}makeAttributesForRelatedFeature(t,i,s){const e=t.getAttribute(i.keyField);let a=s.keyField;const o=this.table.fields.find((t=>t.name.toLocaleLowerCase()===a.toLocaleLowerCase()));return a=o.name,{[a]:e}}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&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)))}static get watchers(){return{mapView:["mapViewWatchHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};H.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.display-none{display:none !important}";const P=class{constructor(i){t(this,i),this.loadingStatus=e(this,"loadingStatus",7),this.commentSelect=e(this,"commentSelect",7),this.featureSelectionChange=e(this,"featureSelectionChange",7),this.mapView=void 0,this.graphics=void 0,this.reportingOptions=void 0,this.layerItemsHash=void 0,this._likeFieldAvailable=!1,this._likeCount=0,this._disLikeCount=0,this._dislikeFieldAvailable=!1,this._commentsAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._relatedFeaturesOIDs=void 0,this._updating=!1}get el(){return s(this)}_infoCard;_commentsList;_selectedGraphic;_likeField;_dislikeField;Graphic;RelationshipQuery;_validFieldTypes=["small-integer","integer","big-integer","single","long"];relatedTableId;async graphicsWatchHandler(){await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}async refresh(t){await this.getCompleteGraphic(t),await this.processComments(),this.isLikeDislikeConfigured(t.layer)?t&&this.graphics.length>1&&this.checkLikeDislikeFields():(this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1)}async back(){this._infoCard.back()}async next(){this._infoCard.next()}async toggleListView(){this._infoCard.toggleListView()}loadingStatus;commentSelect;featureSelectionChange;async componentWillLoad(){await this._initModules(),await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}render(){const t=this._relatedFeaturesOIDs?.length>0?`objectId in(${this._relatedFeaturesOIDs})`:"1=0";return i("calcite-panel",{key:"7f1fa230117891c11ff6747b7d3c5d6c8771c998","full-height":!0},i("info-card",{key:"2b9119b5a0533d2ed8136149dd322aa9211f503b",allowEditing:!1,graphics:this.graphics,highlightEnabled:!1,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:t=>{this.featureSelectionChange.emit(t.detail)},paginationEnabled:!1,position:"relative",ref:t=>this._infoCard=t}),(this._likeFieldAvailable||this._dislikeFieldAvailable||this._commentsAvailable)&&i("div",{key:"85974c4ff61890dc43c02b84b9c6622e83039cdd",class:"buttons-container"},this._commentsAvailable&&i("div",{key:"8b905e1ee273103247f6cab2c598b03f1f733396",class:"comment-btn"},i("span",{key:"05439cbc1e6080006479ce3694f4d1f81684a9d7"},this._relatedFeaturesOIDs.length),i("calcite-icon",{key:"0e7062d1bc383c2f2fdd50ff003ea6a854e1a121",icon:"speech-bubble",scale:"s"})),this._likeFieldAvailable&&i("calcite-button",{key:"26a024436a8e0c4251c200f112e6cc687795c85a",appearance:"transparent",iconEnd:"thumbs-up",kind:this._isLikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onLikeButtonClick.bind(this),scale:"m"},this._likeCount??this._selectedGraphic.attributes[this._likeField]??0),this._dislikeFieldAvailable&&i("calcite-button",{key:"67d1ebe6b0ba1893aac9f26e4cebfe30569115d5",appearance:"transparent",iconEnd:"thumbs-down",kind:this._isDislikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onDislikeButtonClick.bind(this),scale:"m"},this._disLikeCount??this._selectedGraphic.attributes[this._dislikeField]??0)),this.relatedTableId&&this._commentsAvailable&&i("feature-list",{key:"7ed006e8be5f7280fdd260102111aad4656526f6",class:"height-full",mapView:this.mapView,onFeatureSelect:t=>{this.commentSelect.emit(t.detail)},pageSize:5,ref:t=>this._commentsList=t,selectedLayerId:this.relatedTableId,showErrorWhenNoFeatures:!1,showInitialLoading:!1,textSize:"small",whereClause:t}))}async _initModules(){const[t,i]=await _(["esri/rest/support/RelationshipQuery","esri/Graphic"]);this.RelationshipQuery=t,this.Graphic=i}async getCompleteGraphic(t){const i=t.layer,s=i.createQuery();s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this._selectedGraphic=e.features[0]}async processComments(){const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]&&this.reportingOptions[t.id].comment&&t.relationships?.length>0){const i=t.relationships[0].relatedTableId,s=(await E(this.mapView)).filter((s=>t.url===s.url&&i===s.layerId));if(this.relatedTableId=s?.length>0?s[0].id:"",this.relatedTableId){const i=this._selectedGraphic.attributes[t.objectIdField],s=new this.RelationshipQuery({objectIds:[i],outFields:["*"],relationshipId:t.relationships[0].id}),e=await t.queryRelatedFeatures(s).catch((t=>{console.error(t)})),a=[];e[i]&&e[i].features.forEach((t=>{a.push(t.attributes.OBJECTID)})),this._relatedFeaturesOIDs=a,this._commentsAvailable=!0}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1,this.relatedTableId=""}isLikeDislikeConfigured(t){let i=!1,s=!1;if(this.reportingOptions&&this.reportingOptions[t.id]){if(!this.reportingOptions[t.id].like&&!this.reportingOptions[t.id].dislike)return!1;const e=this.reportingOptions[t.id].likeField,a=this.reportingOptions[t.id].dislikeField;if(!e&&!a)return!1;t.fields.forEach((o=>{this._validFieldTypes.indexOf(o.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(o.name===e&&this.reportingOptions[t.id].like?i=!0:o.name===a&&this.reportingOptions[t.id].dislike&&(s=!0))}))}return i||s}checkLikeDislikeFields(){this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._likeCount=0,this._disLikeCount=0;const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]){if(this._likeField=this.reportingOptions[t.id].likeField,this._dislikeField=this.reportingOptions[t.id].dislikeField,!this._likeField&&!this._dislikeField)return;t.fields.forEach((i=>{this._validFieldTypes.indexOf(i.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(i.name===this._likeField&&this.reportingOptions[t.id].like?(this._likeFieldAvailable=!0,this._likeCount=this._selectedGraphic.attributes[i.name]):i.name===this._dislikeField&&this.reportingOptions[t.id].dislike&&(this._dislikeFieldAvailable=!0,this._disLikeCount=this._selectedGraphic.attributes[i.name]))})),this.getFromLocalStorage()}}onLikeButtonClick(){this._isDislikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].dislike&&this.onDislikeButtonClick(),this._isLikeBtnClicked=!this._isLikeBtnClicked,this._isLikeBtnClicked?this._likeCount++:this._likeCount--,this.updateFeaturesLikeDislikeField(this._likeField,this._isLikeBtnClicked)}onDislikeButtonClick(){this._isLikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].like&&this.onLikeButtonClick(),this._isDislikeBtnClicked=!this._isDislikeBtnClicked,this._isDislikeBtnClicked?this._disLikeCount++:this._disLikeCount--,this.updateFeaturesLikeDislikeField(this._dislikeField,this._isDislikeBtnClicked)}async updateFeaturesLikeDislikeField(t,i){const s={},e=this._selectedGraphic.layer;this._updating=!0;const a=this._selectedGraphic;a.attributes[t]=Number(a.attributes[t])+(i?1:-1),s[e.objectIdField]=a.attributes[e.objectIdField],s[t]=a.attributes[t];const o=new this.Graphic;o.attributes=s;const n={updateFeatures:[o]};await e.applyEdits(n).then((()=>{this._selectedGraphic=a,this.setInLocalStorage(),this._updating=!1}),(t=>{this._updating=!1,console.log(t)}))}getFromLocalStorage(){const t=localStorage[this._selectedGraphic.layer.id];if(t){const i=JSON.parse(t).filter((t=>t.id===this._selectedGraphic.getObjectId()));i.length>0&&(this._isLikeBtnClicked=i[0].like,this._isDislikeBtnClicked=i[0].dislike)}}setInLocalStorage(){const t=this._selectedGraphic.layer.id,i=localStorage[t];let s=[];if(i){s=JSON.parse(i);const t=s.findIndex((t=>t.id===this._selectedGraphic.getObjectId()));t>=0&&s.splice(t,1)}s.push({id:this._selectedGraphic.getObjectId(),like:this._isLikeBtnClicked&&0!==this._likeCount,dislike:this._isDislikeBtnClicked&&0!==this._disLikeCount}),localStorage.setItem(t,JSON.stringify(s))}static get watchers(){return{graphics:["graphicsWatchHandler"]}}};P.style=":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";const T=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.showFeatureCount=!0,this.showNextIcon=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}get el(){return s(this)}_layerItemsHash;async refresh(){await this.setLayers()}layerSelect;layersListLoaded;async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,{key:"9366302a704c1dbdd7a65aef5c43d0ad84a44b23"},this._isLoading&&i("calcite-loader",{key:"69974a23fd42bc37ef13816efbe6d06e28cb2749",label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{key:"a93abb55b4db09727b3634cb1935e482c377d662",class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{key:"b9046685353b8894e6c6094cff47fab7a8e07ffa",slot:"title"},this._translations.error),i("div",{key:"90a052e1d80779a09a32fdd35563a1ce21d582e0",slot:"message"},this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{key:"709c1b8edd5710a2476ecef638199c2f929b4165","selection-appearance":"border","selection-mode":"none"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await I(this.mapView,!0),(await C(this.mapView)).forEach((async i=>{if("feature"===i?.type&&this.showFeatureCount){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await L(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getLayersToBeShownInList(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getLayersToBeShownInList(t){const i=this.layers?.length>0?this.layers:[];return Object.keys(t).reduce(((t,s)=>(i.indexOf(s)>-1&&t.push(s),t)),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}};T.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{z as calcite_flow,D as calcite_flow_item,B as create_feature,H as create_related_feature,P as feature_details,T as layer_list}
|
@@ -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{l as n}from"./p-
|
6
|
+
import{l as n}from"./p-4cd4cb85.js";import{l as t}from"./p-ac122d9e.js";const o=new URL(window.location.href).origin.includes("localhost:4444");function a(){const n=(document.documentElement.lang||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return t.has(n)?t.get(n):t.has(n.slice(0,2))?t.get(n.slice(0,2)):"en"}async function c(n,t){const a=`assets/t9n/${n}/resources_${t}.json`,c=new URL(`./${a}`,window.location.href).href,e=`${new URL(window.location.href).origin}/dist/${a}`;async function r(n){const t=await fetch(n);if(!t.ok)throw new Error(`Fetch failed with status ${t.status}: ${t.statusText}`);const o=t.headers.get("content-type");if(!o||!o.includes("application/json")){const n=await t.text();throw console.error(`Expected JSON, but received (${o}): ${n}`),new Error("Fetched content is not JSON")}return await t.json()}try{return await r(o?e:c)}catch(n){console.error(`Primary fetch error: ${n}`);try{return await r(e)}catch(n){throw console.error(`Fallback fetch error: ${n}`),new Error("Both primary and fallback fetches failed")}}}function e(n,t){var o,a;const c=null===(o=null==t?void 0:t.user)||void 0===o?void 0:o.culture,e=null===(a=null===window||void 0===window?void 0:window.navigator)||void 0===a?void 0:a.language,r=n.getLocale();return n.normalizeMessageBundleLocale(c||e||r||"en")}async function r(n,t){const o=n.tagName.toLowerCase(),e=null!=t?t:a();let r;try{r=await c(o,e)}catch(n){console.warn(`no locale for ${o} (${e}) loading default locale en.`),r=await c(o,"en")}return[r,e]}async function i(t,o){try{s(t,await r(t.el),o)}catch(n){}finally{try{const[a]=await n(["esri/intl"]);a.onLocaleChange(function(n,t){return async o=>{const a=await r(n.el,o);s(n,a,t)}}(t,o))}catch(n){}}}function s(n,t,o){n.messages=t[0],o&&(n.messages=Object.assign(Object.assign({},n.messages),o))}export{e as a,r as b,a as c,i as g}
|