@esri/solutions-components 5.0.2-next.3 → 5.0.2-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{57LXGC2L.js → 2M7N6LPR.js} +1 -1
- package/dist/cdn/{64IG3VBM.js → 2P5ILJMU.js} +1 -1
- package/dist/cdn/{R52W6IFP.js → 2RABE6MU.js} +1 -1
- package/dist/cdn/{QHXQS2TJ.js → 3XA5R24U.js} +1 -1
- package/dist/cdn/{PX6N4BRK.js → 43NWVIMB.js} +1 -1
- package/dist/cdn/{UIFRG5Z5.js → 4XMWC6IV.js} +1 -1
- package/dist/cdn/{SJMKG2Y2.js → 5F66HK4S.js} +1 -1
- package/dist/cdn/{KO7S5YIH.js → 64I67VMK.js} +1 -1
- package/dist/cdn/{KETBIWNV.js → 653SJFXP.js} +1 -1
- package/dist/cdn/{RWDE42UI.js → 6VTGA46N.js} +1 -1
- package/dist/cdn/{WCQKSAUN.js → 6YDPEFML.js} +1 -1
- package/dist/cdn/{VCU5NJSP.js → ACCRMKQI.js} +1 -1
- package/dist/cdn/BBLQ4DLJ.js +2 -0
- package/dist/cdn/{S664RN6P.js → BHP43GOA.js} +1 -1
- package/dist/cdn/{5D2QCLOY.js → BN2OKCTV.js} +1 -1
- package/dist/cdn/{VKWQ2UOL.js → C5NTEEMX.js} +1 -1
- package/dist/cdn/{Z53N3M4L.js → CDTD573U.js} +1 -1
- package/dist/cdn/{VUFOIXWZ.js → DLMYZ6ZN.js} +1 -1
- package/dist/cdn/{HEH643UY.js → EAP3T73G.js} +1 -1
- package/dist/cdn/{SXSTBM77.js → ECIJI2EF.js} +1 -1
- package/dist/cdn/{XOW3ZZ6I.js → FGR7TVGE.js} +1 -1
- package/dist/cdn/{A4WA7OOO.js → GYKTRMNC.js} +1 -1
- package/dist/cdn/{4PMJGKRS.js → H4AQ3NOB.js} +1 -1
- package/dist/cdn/{6C4EHCSR.js → H4SMK2IM.js} +1 -1
- package/dist/cdn/{O4ABB4PQ.js → I2RB3ZK5.js} +1 -1
- package/dist/cdn/{AIYHCYB5.js → IYTHORN5.js} +1 -1
- package/dist/cdn/{5NB56NVE.js → K7HI6WU5.js} +1 -1
- package/dist/cdn/{3O3GVMWO.js → KBXJXULA.js} +1 -1
- package/dist/cdn/{FT2RITIO.js → N4KU3YV3.js} +1 -1
- package/dist/cdn/{E3DW2M6B.js → NTFCCIR6.js} +1 -1
- package/dist/cdn/{JCBUATLL.js → NUVM3TEI.js} +1 -1
- package/dist/cdn/{KI33523C.js → OHXRTGLZ.js} +1 -1
- package/dist/cdn/{PSNP4WYK.js → P3NBQIFK.js} +1 -1
- package/dist/cdn/{JOEGOIK3.js → PF3DUV4R.js} +1 -1
- package/dist/cdn/{FJX7UVKI.js → PH6E5VEX.js} +1 -1
- package/dist/cdn/{NSQPTNSB.js → PLCLZYNU.js} +1 -1
- package/dist/cdn/{ZN7TFL7A.js → Q7XZ2WSI.js} +1 -1
- package/dist/cdn/{UOOIKGBP.js → QAZVEVP5.js} +1 -1
- package/dist/cdn/{ZSOLZJPP.js → QKVN24LI.js} +1 -1
- package/dist/cdn/{7IAALB5U.js → S5XSLTYG.js} +1 -1
- package/dist/cdn/{7NSN2YE4.js → SA34OEYY.js} +1 -1
- package/dist/cdn/{5CJSPIKU.js → SKTW2DTJ.js} +1 -1
- package/dist/cdn/{GJFGBIH7.js → TOPWR24E.js} +1 -1
- package/dist/cdn/{AXBVHGTQ.js → UJSTWEYZ.js} +1 -1
- package/dist/cdn/{57PXC3TO.js → VPQWJHDX.js} +1 -1
- package/dist/cdn/{YGHCNTQN.js → VY4VI4VX.js} +1 -1
- package/dist/cdn/{6SETGLTS.js → WCKVYL7Q.js} +1 -1
- package/dist/cdn/{KVUHHQHL.js → WVAU657C.js} +1 -1
- package/dist/cdn/{5SJCOGIP.js → X3XKJE25.js} +1 -1
- package/dist/cdn/{24QTPVIY.js → XOO4MQ4X.js} +1 -1
- package/dist/cdn/{NSQLXA5C.js → XV34GT2B.js} +1 -1
- package/dist/cdn/{DOHELY4Q.js → Y6QXO4MV.js} +1 -1
- package/dist/cdn/{AQKTTVWV.js → Y7OWLSUL.js} +1 -1
- package/dist/cdn/{PMJSFZYX.js → YQYUGVWA.js} +1 -1
- package/dist/cdn/{AZFB2VFZ.js → ZE5JXFPR.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/solution-snapshot-gallery/customElement.js +14 -14
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +7 -5
- package/package.json +5 -5
- package/dist/cdn/UYWF6PZK.js +0 -2
- /package/dist/cdn/{XKKGHOSR.js → V5DYUI5A.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import d from"./
|
|
2
|
+
import d from"./KBXJXULA.js";import"./NQXUGAR7.js";import c from"./BBLQ4DLJ.js";import b from"./V5DYUI5A.js";import"./4T7P5RXF.js";import a from"./ZL6A7VRS.js";import"./PZ4L77M5.js";import"./DD3JC2L3.js";import"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import"./VU3OQQKP.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,a])=>{return a},a,b,c,d)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as m}from"./
|
|
2
|
+
import{a as m}from"./N4KU3YV3.js";import{b as d}from"./Y7OWLSUL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{F as g,G as h,H as u,J as t,h as p,i,l as e}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([b,o,f])=>{var I=p`:host{--instant-apps-sign-in-indicator-color: #007ac2;display:block;box-shadow:none!important}:host .instant-apps-sign-in__container{height:inherit;display:flex;align-items:center;height:100%}:host .instant-apps-sign-in__container calcite-action{--calcite-action-text-color: var(--calcite-color-text-1);--calcite-font-size--2: var(--calcite-font-size--1);--calcite-internal-action-padding-inline: 12px}:host .instant-apps-sign-in__container calcite-action:focus{--calcite-action-background-color: var(--calcite-color-foreground-2)}:host .instant-apps-sign-in__container calcite-action,:host .instant-apps-sign-in__container calcite-navigation-user{height:100%}:host .instant-apps-sign-in__container calcite-navigation-user{--calcite-color-foreground-2: rgba(0, 0, 0, .04);--calcite-color-foreground-3: rgba(0, 0, 0, .04)}:host .instant-apps-sign-in__container .instant-apps-sign-in__indicator:after{content:"";position:absolute;block-size:.5rem;inline-size:.5rem;border-radius:9999px;inset-block-end:-.275rem;inset-inline-end:-.275rem;background-color:var(--instant-apps-sign-in-indicator-color);bottom:calc(50% - 15px);right:calc(50% - 15px)}:host .instant-apps-sign-in__container .instant-apps-sign-in__sign-in-btn{margin:10px}:host .instant-apps-sign-in__container calcite-popover[scale=m] .instant-apps-sign-in__sign-in-container{min-width:140px}:host .instant-apps-sign-in__container calcite-popover[scale=s] .instant-apps-sign-in__sign-in-container{min-width:100px}:host .instant-apps-sign-in__container button{height:32px;width:32px;padding:0;box-sizing:border-box;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;-moz-appearance:none;-webkit-appearance:none;text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out,background-color var(--calcite-animation-timing) ease-in-out,box-shadow var(--calcite-animation-timing) ease-in-out,outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;border:none;border-radius:50%;background:#000}:host .instant-apps-sign-in__container button:hover calcite-avatar{opacity:.7;transition:.3s}:host .instant-apps-sign-in__landing-page{display:flex;flex-direction:column;justify-content:center;padding:40px;width:50%;min-height:30%;background:#fffc;color:#151515;text-align:center}:host .instant-apps-sign-in__landing-page h1{font-size:22px;margin:10px 0}:host .instant-apps-sign-in__landing-page h2{font-size:16px;margin:0 0 10px}:host .instant-apps-sign-in__landing-page p{font-size:16px;margin:0}:host .instant-apps-sign-in__entry-button-container{display:flex;justify-content:center;gap:8px}:host .instant-apps-sign-in__entry-button{--calcite-color-brand: var(--instant-apps-landing-page-entry-button-color);--calcite-color-brand-hover: var( --instant-apps-landing-page-entry-button-color );--calcite-color-brand-press: var( --instant-apps-landing-page-entry-button-color );min-width:165px}:host .instant-apps-sign-in__entry-button[appearance=solid]{border:1px solid #fff}:host .instant-apps-sign-in__entry-button[appearance=solid]:hover,:host .instant-apps-sign-in__entry-button[appearance=solid]:focus{filter:brightness(.9)}@media screen and (max-width:767px){:host{flex-direction:column;align-items:center}:host calcite-button{width:100%}:host .instant-apps-sign-in__entry-button-container{display:flex;flex-direction:column}}`,a={base:"instant-apps-sign-in__container",SignInBtn:"instant-apps-sign-in__sign-in-btn",buttonContainer:"instant-apps-sign-in__entry-button-container",entryButton:"instant-apps-sign-in__entry-button",indicator:"instant-apps-sign-in__indicator",signInContainer:"instant-apps-sign-in__sign-in-container"},r=class extends u{constructor(){super(...arguments),this._messages=m({name:"instant-apps-sign-in",blocking:!0}),this.signInPopover=g(),this.ready=!1,this.isSignedIn=!1,this.type="navigation",this.openInPopup=!1,this.landingPage=!1,this.showIndicator=!0}static{this.properties={ready:16,isSignedIn:16,user:16,type:1,portal:0,oauthappid:1,openInPopup:5,landingPage:5,showIndicator:5,closeLandingPage:0,signInPopoverItems:0}}static{this.styles=I}async load(){await this.initSignIn()}willUpdate(n){(n.has("portal")||n.has("oauthappid"))&&this.initSignIn()}async initSignIn(){this.portal==null||this.oauthappid==null||(this.info=new f({appId:this.oauthappid,portalUrl:this.portal.url,flowType:"authorization-code",popup:this.openInPopup}),o.registerOAuthInfos([this.info]),this.isSignedIn=await this.checkSignInStatus(),this.ready=!0,this.isSignedIn&&(await b.whenOnce(()=>this.portal.user),this.portal.user&&(this.user=this.portal.user)))}async signIn(){this.setSignInLocalStorage(),await o.getCredential(`${this.info.portalUrl}/sharing`,{oAuthPopupConfirmation:!1}),await this.checkSignInStatus()}signOut(){this.portal.credential?.destroy(),o.destroyCredentials(),this.portal.authMode="anonymous",this.portal.credential=null;let n=window.location.href;this.setSignInLocalStorage(),window.location.href=`${this.portal.restUrl}/oauth2/signout?client_id=${this.oauthappid}&redirect_uri=${n}`}async landingPageSignIn(){await this.signIn(),this.closeLandingPage!=null&&this.closeLandingPage()}guestOnClick(){this.isSignedIn?this.signOut():this.closeLandingPage!=null&&this.closeLandingPage()}async checkSignInStatus(){try{let n=await o.checkSignInStatus(`${this.info.portalUrl}/sharing`);return this.portal.credential=n,!0}catch{return this.portal.credential=null,!1}}setSignInLocalStorage(){let n=new Date;localStorage.setItem("signing-in",n.getTime().toString()),setTimeout(()=>{localStorage.removeItem("signing-in")},2e3)}render(){return this.ready?this.renderContent():null}renderContent(){return this.type==="landingPage"?this.renderLandingPageSignIn():this.renderSignInContainer()}renderSignInContainer(){return i`<div class=${t(a.base)}>${this.isSignedIn?this.renderSignInPopover():this.renderSignInButton()}</div>`}renderSignInPopover(){let n=this.type==="navigation"?"m":"s",s=this.showIndicator?a.indicator:"",c=this.user?.id??this.user?.sourceJSON?.id;return i`${this.type==="navigation"?i`<calcite-navigation-user class=${t(s)} id=instant-apps-sign-in-user-button .thumbnail=${this.user?.thumbnailUrl??""} full-name=${this.user?.fullName??e} .username=${this.user?.username} user-id=${c??e} text-disabled></calcite-navigation-user>`:i`<button id=instant-apps-sign-in-user-button><calcite-avatar class=${t(s)} .thumbnail=${this.user?.thumbnailUrl??""} full-name=${this.user?.fullName??e} .username=${this.user?.username} user-id=${c??e}></calcite-avatar></button>`}<calcite-popover placement=bottom-end .scale=${n} reference-element=instant-apps-sign-in-user-button offset-distance=0 pointer-disabled focus-trap-disabled auto-close label="User settings" ${h(this.signInPopover)}><div class=${t(a.signInContainer)}><slot name=sign-in-popover-top></slot>${this.signInPopoverItems?.map(l=>i`<calcite-action scale=s @click=${_=>{l.onClick(_),this.signInPopover.value&&(this.signInPopover.value.open=!1)}} .text=${l.label} text-enabled></calcite-action>`)}<calcite-action scale=s @click=${this.signOut} .text=${this._messages.signOut} text-enabled></calcite-action></div></calcite-popover>`}renderSignInButton(){let n=this.type==="navigation"?"transparent":"solid",s=this.type==="navigation"?a.SignInBtn:"";return i`<calcite-button class=${t(s)} @click=${this.signIn} scale=s icon-start=sign-in .appearance=${n}>${this._messages.signIn}</calcite-button>`}renderLandingPageSignIn(){return i`<div class=${t(a.buttonContainer)}><calcite-button class=${t(a.entryButton)} scale=l @click=${this.landingPageSignIn}>${this._messages.signIn}</calcite-button><calcite-button class=${t(a.entryButton)} scale=l appearance=outline-fill @click=${this.guestOnClick}>${this._messages.continueAsGuest}</calcite-button></div>`}};d("instant-apps-sign-in",r);return r},"core/reactiveUtils","identity/IdentityManager","identity/OAuthInfo")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{b as u}from"./
|
|
2
|
+
import{b as u}from"./Y7OWLSUL.js";import{H as r,h as n,i as a}from"./46DQNAMV.js";import"./OR4HXHSY.js";var c=n`:host{display:block;margin-block-start:var(--padding)}[role=group],li{display:grid;grid-template-columns:1fr auto}[role=group]{align-items:end;gap:var(--padding);calcite-label{--calcite-label-margin-bottom: 0}calcite-button{height:32px}}ol,li{list-style:none;padding:0;margin:0}ol{border:var(--border-style);margin-block-start:var(--padding)}li{align-items:center;padding-inline-start:var(--padding);&:not(:last-child){border-bottom:var(--border-style)}span{color:inherit;font-size:inherit;font-weight:var(--calcite-font-weight-normal)}calcite-button{--calcite-icon-color: var(--calcite-color-text-3);width:var(--close-button-size);height:var(--close-button-size)}}`;function l(i){return a`<li class="buffer-distance-value"><span>${i.value}</span><calcite-button kind=neutral appearance=transparent scale=s @click=${i.onRemoveClick} .label=${i.removeValueLabel}><calcite-icon icon=x scale=s></calcite-icon></calcite-button></li>`}var s=class extends r{constructor(){super(...arguments),this.#e=3,this._uniqueDistanceValues=new Set}static{this.properties={_uniqueDistanceValues:16,distanceValuesSorted:32,bufferInputStep:11,bufferDistance:11,bufferMinDistance:11,bufferMaxDistance:11,inputNumberLabel:1,addButtonLabel:1,removeValueLabel:1}}static{this.styles=c}#e;#t;#i;#a;#s;get distanceValuesSorted(){return[...this._uniqueDistanceValues].sort((e,t)=>e-t)}get bufferInputStep(){return this.#s}set bufferInputStep(e){this._validateBufferNumber(e,"bufferInputStep"),this.#s=e}get bufferDistance(){return this.#t}set bufferDistance(e){if(this._validateBufferNumber(e,"bufferDistance"),e<this.bufferMinDistance)throw new Error("bufferDistance must be greater than bufferMinDistance");if(e>this.bufferMaxDistance)throw new Error("bufferDistance must be less than bufferMaxDistance");this.#t=e}get bufferMinDistance(){return this.#i}set bufferMinDistance(e){if(this._validateBufferNumber(e,"bufferMinDistance"),e>this.bufferMaxDistance)throw new Error("bufferMinDistance must be less than bufferMaxDistance");this.#i=e}get bufferMaxDistance(){return this.#a}set bufferMaxDistance(e){if(this._validateBufferNumber(e,"bufferMaxDistance"),e<this.bufferMinDistance)throw new Error("bufferMaxDistance must be greater than bufferMinDistance");this.#a=e}_validateBufferNumber(e,t){if(typeof e!="number"||Number.isNaN(e))throw new Error(`${t} must be a valid number`);if(e<=0)throw new Error(`${t} must be > 0`)}_maybeAddDistanceValue(){this._uniqueDistanceValues.size<this.#e&&(this._uniqueDistanceValues=new Set([...this._uniqueDistanceValues,this.bufferDistance]))}_removeDistanceValue(e){this._uniqueDistanceValues.size&&(this._uniqueDistanceValues.delete(e),this._uniqueDistanceValues=new Set(this._uniqueDistanceValues))}_getRemoveValueLabel(e){return this.removeValueLabel.replace("{number}",`${e}`)}_onBufferDistanceInputInput(e){let t=Number(e.target.value);t>=this.bufferMinDistance&&t<=this.bufferMaxDistance&&(this.bufferDistance=t)}_renderDistanceValuesList(){return this._uniqueDistanceValues.size?a`<ol role=list>${this.distanceValuesSorted.map(e=>l({value:e,removeValueLabel:this._getRemoveValueLabel(e),onRemoveClick:()=>this._removeDistanceValue(e)}))}</ol>`:null}render(){return a`<div><div role=group><calcite-label><span>${this.inputNumberLabel}</span><calcite-input-number .value=${`${this.bufferDistance}`} .step=${this.bufferInputStep} .min=${this.bufferMinDistance} .max=${this.bufferMaxDistance} @calciteInputNumberInput=${this._onBufferDistanceInputInput}></calcite-input-number></calcite-label><calcite-button icon-start=plus @click=${this._maybeAddDistanceValue} appearance=outline>${this.addButtonLabel}</calcite-button></div>${this._renderDistanceValuesList()}</div>`}};u("instant-apps-buffer-distance-manager",s);export{s as InstantAppsBufferDistanceManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import m from"./JCIUAWOV.js";import l from"./N7QXUPEE.js";import k from"./QMDTLWB6.js";import j from"./YRN6NQC6.js";import i from"./Z22WUH5B.js";import h from"./ULDNFSZC.js";import f from"./TUBYR7DR.js";import e from"./3O3GVMWO.js";import"./NQXUGAR7.js";import d from"./UYWF6PZK.js";import c from"./XKKGHOSR.js";import b from"./ET27C34M.js";import"./4T7P5RXF.js";import"./6MZ227J7.js";import a from"./ZL6A7VRS.js";import{a as u}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import{a as S}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as C}from"./VU3OQQKP.js";import{F as o,G as s,H as v,J as _,h as g,i as p,r as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,{D:x,H:D,I:I,K:c,a:f,b:w,w:F},,{b:O},,,{g:k,h:A},,,,,{a:y,b:M},{a:T}])=>{var $=g`.back-color-override{background-color:var(--calcite-color-foreground-2);--calcite-tab-border-color: var(--calcite-color-foreground-3)}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-3);height:100%}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-resources-shell,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-3);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}`,m=class extends v{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._translations=S({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${I}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:w}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._isMobileContextProvider=u({context:f}),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new T,this.deployAppTabSelected=n(),this.deployedCardFetchFailed=n(),this.detailsCardSelected=n(),this.deployedCardSelected=n(),this.metaTagStringsReady=n(),this.sessionRefreshed=n(),this.tabChanged=n(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this._mediaQueryChange=this._mediaQueryChange.bind(this)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,authentication:16,_isLoaded:16,isMobile:16,_activeTab:16,_showDeployedCardFetchFailed:16,_translations:16}}static{this.styles=$}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let a;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(a=l,this.deployedCardSelected.emit({card:a}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let a=k(this._allCards,t.tabTitleOrId);a=a||A(this._allCards,t.tabTitleOrId),a?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(a)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}async connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 800px)"),this._mediaQuery.addEventListener("change",this._mediaQueryChange),this._mediaQueryChange(this._mediaQuery)}updated(){this._fixTabpanelFocus()}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let a=i.shadowRoot.querySelector('[role="tabpanel"]');a&&(a.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=O)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return p`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${s(this._deployAppNav)}></solutions-deploy-app-nav>${this._isSearchToolbarShowing()&&p`<div class="border" slot=header></div>`||""}<solutions-searchsort-toolbar slot=header ${s(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader><calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${s(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${s(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${s(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${s(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${s(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${s(this._allTab)}><solutions-all-shell class="height-100" ${s(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${s(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._resourcesTab)}><solutions-resources-shell class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${s(this._detailsTab)}><solution-details-panel class="height-100" ${s(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${s(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery?.removeEventListener("change",this._mediaQueryChange),this._tabpanelObserver?.disconnect()}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=T.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new y(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new y(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_mediaQueryChange(t){this.isMobile=t.matches,this._isMobileContextProvider.setValue(this.isMobile)}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let a=[];if((t==="details"||t==="deployed-card")&&e){let r=e;a.push(r.title||""),a.push(r.deployCommonId||""),a.push(r.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:a.length>0?a:void 0})}}_emitMetaTagStrings(t,e){let i="",a="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,a=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,a=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,a=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),a=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:a,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let a=F(e);try{let l=await M(e,i,this._cardsFetcher,this._cardFetcherDeployed,D,"created","desc",!1,[],[],this._abortControllerDeployed.signal,a?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let r=l.message;r.indexOf("CONT_0001")>-1||r.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):r.indexOf("GWM_0003")>-1||r.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,a=t.industry==="AEC"?x.AEC:t.industry,l=t.offerType,r=t.searchTerm,E="",d=t.sortField,h=t.owner,b=t.filter;e=i||a?{type:i?"domain":a?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),a&&(e=e?{...e,industry:a}:{industry:a}),r&&(e=e?{...e,searchTerm:r}:{searchTerm:r}),e&&(e={...e,displayValue:E}),d&&(e=e?{...e,sortType:d}:{sortType:d}),l&&(d=l.toLowerCase(),e=e?{...e,sortType:d}:{sortType:d}),h&&(e=e?{...e,owner:h}:{owner:h}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(){let t=this._detailsTab.value?.shadowRoot?.firstElementChild;t?.style&&(t.style.scrollbarGutter="stable both-edges");let e=this._deployedCardTab.value?.shadowRoot?.firstElementChild;e?.style&&(e.style.scrollbarGutter="stable both-edges")}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),a=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},a)}}};C("solutions-deploy-app",m);return m},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a,b,c,d,e,f,h,i,j,k,l,m)
|
|
2
|
+
import m from"./JCIUAWOV.js";import l from"./N7QXUPEE.js";import k from"./QMDTLWB6.js";import j from"./YRN6NQC6.js";import i from"./Z22WUH5B.js";import h from"./ULDNFSZC.js";import f from"./TUBYR7DR.js";import e from"./KBXJXULA.js";import"./NQXUGAR7.js";import d from"./BBLQ4DLJ.js";import c from"./V5DYUI5A.js";import b from"./ET27C34M.js";import"./4T7P5RXF.js";import"./6MZ227J7.js";import a from"./ZL6A7VRS.js";import{a as u}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import{a as S}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as C}from"./VU3OQQKP.js";import{F as o,G as s,H as v,J as _,h as g,i as p,r as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,{D:x,H:D,I:I,K:c,a:f,b:w,w:F},,{b:O},,,{g:k,h:A},,,,,{a:y,b:M},{a:T}])=>{var $=g`.back-color-override{background-color:var(--calcite-color-foreground-2);--calcite-tab-border-color: var(--calcite-color-foreground-3)}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-3);height:100%}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-resources-shell,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-3);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}`,m=class extends v{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._translations=S({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${I}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:w}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._isMobileContextProvider=u({context:f}),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new T,this.deployAppTabSelected=n(),this.deployedCardFetchFailed=n(),this.detailsCardSelected=n(),this.deployedCardSelected=n(),this.metaTagStringsReady=n(),this.sessionRefreshed=n(),this.tabChanged=n(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this._mediaQueryChange=this._mediaQueryChange.bind(this)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,authentication:16,_isLoaded:16,isMobile:16,_activeTab:16,_showDeployedCardFetchFailed:16,_translations:16}}static{this.styles=$}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let a;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(a=l,this.deployedCardSelected.emit({card:a}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let a=k(this._allCards,t.tabTitleOrId);a=a||A(this._allCards,t.tabTitleOrId),a?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(a)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}async connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 800px)"),this._mediaQuery.addEventListener("change",this._mediaQueryChange),this._mediaQueryChange(this._mediaQuery)}updated(){this._fixTabpanelFocus()}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let a=i.shadowRoot.querySelector('[role="tabpanel"]');a&&(a.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=O)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return p`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${s(this._deployAppNav)}></solutions-deploy-app-nav>${this._isSearchToolbarShowing()&&p`<div class="border" slot=header></div>`||""}<solutions-searchsort-toolbar slot=header ${s(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader><calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${s(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${s(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${s(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${s(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${s(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${s(this._allTab)}><solutions-all-shell class="height-100" ${s(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${s(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._resourcesTab)}><solutions-resources-shell class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${s(this._detailsTab)}><solution-details-panel class="height-100" ${s(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${s(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery?.removeEventListener("change",this._mediaQueryChange),this._tabpanelObserver?.disconnect()}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=T.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new y(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new y(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_mediaQueryChange(t){this.isMobile=t.matches,this._isMobileContextProvider.setValue(this.isMobile)}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let a=[];if((t==="details"||t==="deployed-card")&&e){let r=e;a.push(r.title||""),a.push(r.deployCommonId||""),a.push(r.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:a.length>0?a:void 0})}}_emitMetaTagStrings(t,e){let i="",a="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,a=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,a=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,a=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),a=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:a,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let a=F(e);try{let l=await M(e,i,this._cardsFetcher,this._cardFetcherDeployed,D,"created","desc",!1,[],[],this._abortControllerDeployed.signal,a?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let r=l.message;r.indexOf("CONT_0001")>-1||r.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):r.indexOf("GWM_0003")>-1||r.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,a=t.industry==="AEC"?x.AEC:t.industry,l=t.offerType,r=t.searchTerm,E="",d=t.sortField,h=t.owner,b=t.filter;e=i||a?{type:i?"domain":a?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),a&&(e=e?{...e,industry:a}:{industry:a}),r&&(e=e?{...e,searchTerm:r}:{searchTerm:r}),e&&(e={...e,displayValue:E}),d&&(e=e?{...e,sortType:d}:{sortType:d}),l&&(d=l.toLowerCase(),e=e?{...e,sortType:d}:{sortType:d}),h&&(e=e?{...e,owner:h}:{owner:h}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(){let t=this._detailsTab.value?.shadowRoot?.firstElementChild;t?.style&&(t.style.scrollbarGutter="stable both-edges");let e=this._deployedCardTab.value?.shadowRoot?.firstElementChild;e?.style&&(e.style.scrollbarGutter="stable both-edges")}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),a=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},a)}}};C("solutions-deploy-app",m);return m},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a,b,c,d,e,f,h,i,j,k,l,m)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as e}from"./4T7P5RXF.js";import{a as h}from"./
|
|
2
|
+
import{a as e}from"./4T7P5RXF.js";import{a as h}from"./N4KU3YV3.js";import{b as d}from"./Y7OWLSUL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{H as n,J as c,K as i,L as p,h as r,i as a}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([l,{watch:m}])=>{var g=r`:host{display:block}.instant-apps-compass{position:relative;height:100px;width:100px;border-radius:50%}.instant-apps-compass #instant-compass{position:absolute;top:calc(50% - 16px);right:calc(50% - 16px);z-index:10}.instant-apps-compass #dir-ring{height:100px;width:100px;border-radius:50%;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-border-1);position:relative}.instant-apps-compass #dir-ring .dir-heading{position:absolute;--calcite-fab-background-color: transparent;--calcite-fab-text-color: var(--calcite-color-text-1);--calcite-fab-shadow: none}.instant-apps-compass #dir-ring #north{right:37px;top:5px}.instant-apps-compass #dir-ring #east{right:6px;top:38px}.instant-apps-compass #dir-ring #west{left:4px;top:38px}.instant-apps-compass #dir-ring #south{right:38px;bottom:4px}`,u={base:"instant-apps-compass"},o=class extends n{constructor(){super(...arguments),this._messages=h({name:"instant-apps-compass",blocking:!0}),this.rotationWatcherKey="rotationWatcher",this.baseClass=u.base,this.rotation=0}static{this.properties={baseClass:16,rotation:16,view:0}}static{this.styles=g}get view(){return this._view}set view(t){this._view=t,this.handles?.has(this.rotationWatcherKey)&&this.handles?.remove(this.rotationWatcherKey),this.handles?.add(m(()=>t.rotation,s=>{this.rotation=Math.floor(s)}),this.rotationWatcherKey)}load(){this.initializeModules()}disconnectedCallback(){super.disconnectedCallback(),this.handles?.removeAll(),this.handles?.destroy(),this.handles=null}initializeModules(){this.handles=new l}goToHeading(t){let s=this._view.viewpoint.clone();s.rotation=this.decideRotation(t),this._view.goTo(s)}decideRotation(t){switch(t){case"north":return 0;case"east":return 270;case"south":return 180;case"west":return 90}}render(){return a`<div class=${c(this.baseClass)}><arcgis-compass id=instant-compass .view=${this.view}></arcgis-compass>${this.renderDirectionRing()}</div>`}renderDirectionRing(){return e("dir-ring",a`<div id=dir-ring style=${i({transform:`rotate(${this.rotation}deg)`})}>${["north","east","south","west"].map(t=>this._renderHeading(t))}</div>`)}_renderHeading(t){let s=this._messages[t];return e(t,a`<calcite-button scale=s round kind=neutral class="dir-heading" appearance=transparent id=${t??p} style=${i({transform:`rotate(-${this.rotation}deg)`})} @click=${()=>this.goToHeading(t)}>${s.charAt(0).toLocaleUpperCase()}</calcite-button>`)}};d("instant-apps-compass",o);return o},"core/Handles","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{b as p}from"./
|
|
2
|
+
import{b as p}from"./Y7OWLSUL.js";import{H as a,h as i,i as n,u as r}from"./46DQNAMV.js";import"./OR4HXHSY.js";var h=i`@layer{:host{display:block}}`,e=class extends a{constructor(){super(...arguments),this.inTour=!1,this.instantAppsPopovers=new Map,this.beforeOpen=async()=>await Promise.resolve()}static{this.properties={inTour:7,currentId:3,instantAppsPopovers:0,beforeOpen:0}}static{this.styles=h}static{this.shadowRootOptions=r}async beginTour(){this.inTour=!0,this.handlePopoverProps({pagination:!0,disableAction:!0});let s=Array.from(this.instantAppsPopovers.keys());await this.open(s[0])}async close(s){let t=this.instantAppsPopovers.get(s)?.firstElementChild;t&&(t.open=!1)}async endTour(){await this.close(this.currentId),this.inTour=!1,this.handlePopoverProps({pagination:!1,disableAction:!1})}async open(s){await this.beforeOpen();let t=this.instantAppsPopovers.get(s)?.firstElementChild;t.open=!0}async next(){let s=Array.from(this.instantAppsPopovers.keys()),t=s.indexOf(this.currentId)+1,o=s[t];await this.close(this.currentId),await this.open(o)}async previous(){let s=Array.from(this.instantAppsPopovers.keys()),t=s.indexOf(this.currentId)-1,o=s[t];await this.close(this.currentId),await this.open(o)}async done(){await this.endTour()}load(){let s=this.el.querySelector("[slot='popovers']");(s?Array.from(s.children):[]).forEach((t,o)=>{let c=t.getAttribute("ref-id");t.parent=this,t.index=o,this.instantAppsPopovers.set(c,t)}),this.listen("calcitePopoverOpen",t=>{let o=t.target.getAttribute("ref-id")??"";this.currentId=o})}handlePopoverProps(s){Array.from(this.el.querySelector("[slot='popovers']")?.children??[]).forEach(t=>{t.disableAction=s.disableAction,t.pagination=s.pagination})}render(){return n`<slot name=popovers></slot>`}};p("instant-apps-popovers",e);export{e as InstantAppsPopovers};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{b as h}from"./
|
|
2
|
+
import{b as h}from"./Y7OWLSUL.js";import{F as o,G as a,H as m,J as n,h as d,i as c,u as l}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([v,p,g])=>{var f=d`@layer{.esri-measurement,.esri-coordinate-conversion{width:300px}.instant-apps-measurement-tool__hide{display:none}}`,u="instant-apps-measurement-tool",s={base:u,hide:`${u}__hide`},r=class extends m{constructor(){super(...arguments),this._measureElement=o(),this._coordinateElement=o()}static{this.properties={view:0,measureConfiguration:0,activeTool:1}}static{this.styles=f}static{this.shadowRootOptions=l}willUpdate(e){e.has("activeTool")&&this._setActiveTool(this.activeTool)}loaded(){this._init()}disconnectedCallback(){super.disconnectedCallback(),this._measureWidget?.destroy(),this._coordinateWidget?.destroy()}async _init(){await this._initMeasurementWidget(),await this._initCoordinateWidget()}async _initMeasurementWidget(){this.view&&this._measureElement&&!this._measureWidget&&(this._measureWidget=new v({view:this.view,container:this._measureElement.value,...this.measureConfiguration}),this.measureConfiguration.activeToolType&&this._setActiveTool(this.measureConfiguration.activeToolType))}_setActiveTool(e){let t=this.view.type;this._measureWidget?.clear(),this._coordinateElement.value?.classList.add(s.hide),e==="distance"&&this._measureWidget?this._measureWidget.activeTool=t==="2d"?"distance":"direct-line":e==="area"&&this._measureWidget?this._measureWidget.activeTool="area":e==="point"&&this._coordinateElement.value?.classList?.remove(s.hide);let i=this.el.getRootNode().querySelector(`calcite-action[data-value="${e}"]`);i&&i.setFocus()}async _initCoordinateWidget(){let{activeToolType:e,coordinateFormat:t}=this.measureConfiguration;if(this?.view&&this._coordinateElement&&!this._coordinateWidget&&(this._coordinateWidget=new p({view:this.view,storageEnabled:!1,container:this._coordinateElement.value}),t!=null)){let i=this._coordinateWidget.formats.find(_=>_.name===t);this._coordinateWidget?.conversions?.splice(0,0,new g({format:i}))}e!=null&&this._setActiveTool(e)}render(){return c`<div class=${n(s.base)}><div ${a(this._measureElement)}></div><div class=${n(s.hide)} ${a(this._coordinateElement)}></div></div>`}};h("instant-apps-measurement-tool",r);return r},"widgets/Measurement","widgets/CoordinateConversion","widgets/CoordinateConversion/support/Conversion")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as d}from"./
|
|
2
|
+
import{a as d}from"./N4KU3YV3.js";import{b as c}from"./Y7OWLSUL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{H as r,L as o,h as a,i as t}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([g,p,{on:m}])=>{var v=a`:host{--default-width: auto;--width: var(--default-width);--padding: 10px;--border-style: 1px solid var(--calcite-color-border-1);--calcite-button-height: 48px;--calcite-icon-color: var(--calcite-color-text-3);display:block;width:var(--width);background:var(--background-color, var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1);padding:var(--padding);box-sizing:border-box;>*{border:var(--border-style)}}[role=group]{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:var(--calcite-button-height)}.selection-count{display:flex;align-items:center;justify-content:space-between;padding-inline-start:var(--padding);margin-block-start:var(--padding)}`,s=class extends r{constructor(){super(),this._messages=d({name:"instant-apps-selection-toolbar",blocking:!0}),this._selectionCount=0,this.disabled=!1,this.selectionManager=new g,this.selectionToolbarViewModel=new p({selectionManager:this.selectionManager})}static{this.properties={_selectionCount:16,view:0,selectionManager:0,selectionToolbarViewModel:0,selectedCount:32,sources:0,enabledTool:3,readyToSelect:39,continuousSelectionEnabled:5,disabled:5}}static{this.styles=v}get#e(){return this.disabled||this.selectionToolbarViewModel.state==="disabled"}set view(e){this.selectionManager.view=e,this.selectionToolbarViewModel.view=e}get view(){return this.selectionManager.view}get selectedCount(){return this._selectionCount}set sources(e){this.selectionManager.sources=e,this.selectionToolbarViewModel.sources=e}get sources(){return this.selectionManager.sources}get readyToSelect(){return!this.#e&&!!this.view&&!!this.sources?.length}set continuousSelectionEnabled(e){this.selectionToolbarViewModel.continuousSelectionEnabled=e}get continuousSelectionEnabled(){return this.selectionToolbarViewModel.continuousSelectionEnabled}clearSelection(){this.selectionManager.clear()}async getSelectedFeatures(){return this.selectionManager.getSelectedFeatures(null,{returnGeometry:!0})}load(){this.manager.onLifecycle(()=>m(()=>this.selectionManager,"selection-change",()=>{this._selectionCount=this.selectionManager.count}))}willUpdate(e){e.has("enabledTool")&&this.readyToSelect&&(this.enabledTool?this.selectionToolbarViewModel.activateTool(this.enabledTool):this.selectionToolbarViewModel.cancel())}_getSelectButtonClickEventHandler(e){return()=>{this.enabledTool===e?this.enabledTool=null:this.enabledTool=e}}_renderSelectionButton(e,i,u){let l=this.enabledTool===e,h={pressed:l},b=this._getSelectButtonClickEventHandler(e),n=`${e}-action`;return t`<calcite-action id=${n??o} .aria=${h} .active=${l} alignment=center .text=${i} @click=${b} .disabled=${this.disabled}><calcite-icon .icon=${u}></calcite-icon></calcite-action><calcite-tooltip .referenceElement=${n}><span>${i}</span></calcite-tooltip>`}_renderSelectionCount(){if(this._selectionCount>0){let e=this._selectionCount===1?this._messages.labels.singleFeatureSelected:this._messages.labels.multipleFeaturesSelected.replace("{number}",String(this._selectionCount));return t`<div class="selection-count"><span>${e}</span><calcite-button appearance=transparent .label=${this._messages.labels.deselectFeatures} @click=${this.clearSelection}><calcite-icon icon=x></calcite-icon></calcite-button></div>`}return null}render(){return t`<div role=group aria-label=${this._messages.labels.groupLabel??o}>${this._renderSelectionButton("point",this._messages.labels.selectCursor,"cursor")}${this._renderSelectionButton("rectangle",this._messages.labels.selectMarquee,"cursor-marquee")}${this._renderSelectionButton("lasso",this._messages.labels.selectLasso,"lasso-select")}</div>${this._renderSelectionCount()}`}};c("instant-apps-selection-toolbar",s);return s},"views/SelectionManager","widgets/support/SelectionToolbar/SelectionToolbarViewModel","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{b as r}from"./
|
|
2
|
+
import{b as r}from"./Y7OWLSUL.js";import{H as i,h as a,i as p}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([l])=>{var d=a`:host{display:block}`,m="floating",h="instant-apps-control-panel",x="border-bottom: 1px solid var(--calcite-color-border-3)",s=class extends i{constructor(){super(...arguments),this.components=[]}static{this.properties={components:0,view:0}}static{this.styles=d}async load(){await this._handleComponents()}async _handleComponents(){let t=this._getComponentsNode();t&&(this._resetUI(t),this._attachComponents(t))}_attachComponents(t){this.components.forEach(this._attachmentComponent(t))}_attachmentComponent(t){return(o,e)=>{let n=o.content;o.isExpand&&(n=this._getExpand(o),o.expandIcon&&(n.expandIcon=o.expandIcon),o.collapseTooltip&&(n.collapseTooltip=o.collapseTooltip),o.expandTooltip&&(n.expandTooltip=o.expandTooltip)),n.container||(n.container=document.createElement("div")),t?.appendChild(n.container),e!==this.components.length-1&&(n.container.style=x)}}_getExpand(t){let{view:o}=this,{content:e,focusTrapDisabled:n}=t,c=t?.expanded??!1;return new l({content:e,view:o,expanded:c,mode:m,group:h,focusTrapDisabled:!!n})}_getComponentsNode(){return this.el.querySelector('[slot="components"]')}_resetUI(t){if(t.children.length>0)for(;t.firstChild;)t.removeChild(t.firstChild)}render(){return p`<slot name=components></slot>`}};r("instant-apps-control-panel",s);return s},"widgets/Expand")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import e from"./CO37Q2G7.js";import{a as H}from"./7NSN2YE4.js";import d from"./ZL6A7VRS.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as S}from"./LFIJXE3U.js";import{b as E}from"./VU3OQQKP.js";import{F as f,G as g,H as x,J as b,h as v,i as o,l as _,r as p,u as T}from"./46DQNAMV.js";export default $arcgis.t(([L,c,M,w,{c:O},{c:C,d:A,j:y},{C:m,o:F},{b:$}])=>{var R=v`@layer{:host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.display-none{display:none}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51-px{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir=rtl] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none!important}vaadin-grid-cell-content{font-size:14px!important;color:var(--calcite-color-text-3)!important}.absolute-right{position:absolute;right:0;left:unset}html[dir=rtl] .absolute-right{left:0;right:unset}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.actions-end{height:50px!important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-dialog-content-space: 0}.esri-feature-table__table-container{height:100%}.search-container{background-color:var(--calcite-color-foreground-1)!important}.search{--calcite-color-border-input: var(--calcite-color-border-3);width:60%;padding:10px}.delete-red{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-color-text-1: var(--calcite-color-status-danger);--calcite-color-text-3: var(--calcite-color-status-danger)}.label-override{white-space:nowrap}.padding-start-1-4{padding-inline-start:.5rem}.panel-header-override{--calcite-panel-header-content-space: 0px}.danger-label-color{color:var(--calcite-color-status-danger)}.danger-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.width-51{width:51px}.height-51{height:51px}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,I=class extends x{constructor(){super(),this.defaultGlobalId=[],this.defaultLayerId="",this.defaultOid=[],this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!1,this.enableInlineEdit=!1,this.enableShare=!1,this.enableTableAutosave=!0,this.featureSelectionMode="multiple",this.selectedRelatedIds=[],this.honorMapFieldSettings=!1,this.isMobile=!1,this.mapHidden=!1,this.showOnlyUpdatableLayers=!1,this.selectedIds=[],this.shareIncludeEmbed=!1,this.shareIncludeSocial=!1,this.showNewestFirst=!1,this.zoomAndScrollToSelected=!1,this._allIds=[],this._configLayerOrderDefined=!1,this._csvExporting=!1,this._fetchingData=!1,this._hideTable=!1,this._filterActive=!1,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=[],this._translations=S({name:"layer-table",blocking:!0}),this._fullTextSearchInfo=[],this._searchPlaceHolder="",this._size=0,this._queryingData=!1,this._editEnabled=!1,this._enabledLayerIds=[],this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._deleteEnabled=!1,this._floorExpression="",this._floorField="",this._floorLevel="",this._loaded=!1,this._shareNode=f(),this._toolbar=f(),this._searchExpression="",this._skipEditCheck=!1,this._tempSelectedIds=[],this._outOFExtentOids=[],this._shouldUpdateTableOnExtentChange=!0,this._creatingFeature=!1,this._searchNode=f(),this.columnReorder=p(),this.featureSelectionChange=p(),this.toggleFilter=p(),this.showDelete=p(),this.relatedRecordToggled=p(),this.editMultipleFeatures=p(),this.listenOn(window,"beforeMapInfoChange",this.beforeMapInfoChange,{capture:!0}),this.listenOn(window,"editorInitialized",this.editorInitialized),this.listenOn(window,"closeEdit",this.closeEdit),this.listenOn(window,"selectionChanged",this.selectionChanged),this.listenOn(window,"beforeLayerSelectionChange",this.beforeLayerSelectionChange),this.listenOn(window,"layerSelectionChange",this.layerSelectionChange),this.listenOn(window,"editsComplete",this.editsComplete),this.listenOn(window,"facilityChanged",this.facilityChanged),this.listenOn(window,"levelChanged",this.levelChanged),this.listenOn(window,"siteChanged",this.siteChanged),this.listenOn(window,"noLayersFound",this.noLayersFound),this.listenOn(window,"clearSelection",this.clearSelection),this.listenOn(window,"mapChanged",this.mapChanged),this.listenOn(window,"featuresSelected",this.featuresSelected),this.listenOn(window,"createWorkFlowStarted",this.createWorkFlowStarted),this.listenOn(window,"backFromCreateWorkFlow",this.backFromCreateWorkFlow),H(window)}static{this.properties={appLayout:1,defaultGlobalId:0,defaultLayerId:1,defaultOid:0,enableAutoRefresh:5,enableColumnReorder:5,enableCSV:5,enableInlineEdit:5,enableShare:5,enableTableAutosave:5,featureSelectionMode:1,selectedRelatedIds:0,honorMapFieldSettings:5,isMobile:5,mapHidden:5,mapInfo:0,mapView:0,showOnlyUpdatableLayers:5,selectedIds:0,shareIncludeEmbed:5,shareIncludeSocial:5,showNewestFirst:5,zoomAndScrollToSelected:5,zoomToScale:9,_allIds:16,_configLayerOrderDefined:16,_csvExporting:16,_fetchingData:16,_hideTable:16,_filterActive:16,_layer:16,_selectAllActive:16,_showHideOpen:16,_showOnlySelected:16,_toolInfos:16,_translations:16,_fullTextSearchInfo:16,_searchPlaceHolder:16,_size:16,_queryingData:16}}static{this.styles=R}static{this.shadowRootOptions=T}willUpdate(e){if(e.has("appLayout")&&this.appLayoutWatchHandler(),e.has("defaultOid")&&this.defaultOidWatchHandler(),e.has("defaultGlobalId")&&this.defaultGlobalIdWatchHandler(),e.has("enableCSV")&&this.enableCSVWatchHandler(),e.has("enableInlineEdit")&&this.enableInlineEditWatchHandler(),e.has("mapHidden")&&this.mapHiddenWatchHandler(),e.has("isMobile")&&this.isMobileWatchHandler(),e.has("mapInfo")&&this.mapInfoWatchHandler(),e.has("mapView")&&this.mapViewWatchHandler(),e.has("_layer")&&this._layerWatchHandler(),e.has("selectedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedIds"))!==JSON.stringify(this.selectedIds))&&this.selectedIdsWatchHandler(),e.has("selectedRelatedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedRelatedIds"))!==JSON.stringify(this.selectedRelatedIds))&&this.selectedRelatedIdsWatchHandler(),e.has("enableTableAutosave")&&this.hasUpdated&&this._table&&(this._table.autoSaveEnabled=this.enableTableAutosave),e.has("_translations")){let t=this._translations._lang,i=e.get("_translations")?._lang;t&&i&&t!==i&&this._initToolInfos()}}async appLayoutWatchHandler(){await this._initToolInfos(),this._updateShareUrl()}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}async enableCSVWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}async mapHiddenWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}async isMobileWatchHandler(){!this._toolInfos&&!this.isMobile&&await this._initToolInfos()}async mapInfoWatchHandler(){this._configLayerOrderDefined="configLayerOrder"in(this.mapInfo?.layerOptions||{}),this._enabledLayerIds=F(this.mapInfo?.layerOptions?.layers||[],this.mapInfo?.layerOptions?.configLayerOrder),this._table&&(this._resetColumnTemplates(),this._sortTable())}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression="",this._searchExpression="undefined",this.mapView.highlights=[{name:"default",color:"#00FFFF"},{name:"current-selection",color:"#ff00ff"},{name:"temporary",color:"#FFFF00"}],this._updateShareUrl(),this._mapClickHandle=c.on(()=>this.mapView,"click",e=>{this._creatingFeature||this._mapClicked(e)}))}async _layerWatchHandler(){if(this._hideTable=!1,this._fetchingData=!0,!this._layer){this._fetchingData=!1,this._hideTable=!0;return}try{await this._layer.when(),this._floorField=this._layer.floorInfo?.floorField||"",this._updateFloorDefinitionExpression(),await this._resetTable(),this._updateShareUrl()}catch(e){console.error(e),this._hideTable=!0}finally{this._fetchingData=!1}}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1),this.selectedIds.length>0&&(this._table.rowHighlightIds.removeAll(),this._table.rowHighlightIds.add(this.selectedIds[0])),this.selectedIds.length===0&&setTimeout(()=>{this.featureSelectionChange.emit(this.selectedIds)},700)}async selectedRelatedIdsWatchHandler(){this._validateEnabledActions(),this.selectedRelatedIds.length>0&&(this._relatedFeatureTable?.rowHighlightIds.removeAll(),this._relatedFeatureTable?.rowHighlightIds.add(this.selectedRelatedIds[0]))}async closeFilter(){await this._closeFilter()}async filterReset(){this._filterByExtentHandle&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle.remove(),this._filterByExtentHandle=void 0),await this._handleFilterListReset()}async filterUpdate(e,t){await this._handleFilterUpdate(e),t?(this._shouldUpdateTableOnExtentChange=!0,this._handleTableOnMapExtent()):t===!1&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle?.remove(),this._filterByExtentHandle=void 0,await this._updateAllIds())}async validateTableUpdate(e){this._shouldUpdateTableOnExtentChange=e}async validateActiveEdits(){return this._validateActiveEdits([],this.selectedIds)}async refresh(){this._table&&await this._refresh()}async setColumnOrder(e){this._setColumnTemplates(e)}async beforeMapInfoChange(e){let t=e.detail.ref,i=e.detail.mapInfo;if(this._hasPendingEdits()){e.preventDefault();let s=await this._validateActiveEdits([],this.selectedIds);await t.setMapByID(s?i.id:e.detail.currentId,!s)}}async editorInitialized(e){this._shouldUpdateTableOnExtentChange=!1,this._editor=e.detail}async closeEdit(){this._shouldUpdateTableOnExtentChange=!0,this._filterByExtentHandle&&this._handleTableOnMapExtent()}async selectionChanged(e){let t=e.detail.selectedFeature[0],i=Number(t.getObjectId()),s=this._table;if(s.rowHighlightIds.length&&s.rowHighlightIds.removeAll(),s.rowHighlightIds.add(i),this._highlightFeatures(i),this.zoomAndScrollToSelected&&s&&this.mapView){let a=s.viewModel.getObjectIdIndex(i);s.scrollToIndex(a);let l=t.layer,h=this.mapView.allLayerViews.toArray(),n;h.some(async r=>r.layer.title===l?.title&&r.layer.type==="feature"?(n=r,this.mapView&&await y([i],n,this.mapView,!0,void 0,this.zoomToScale),!0):!1)}}async beforeLayerSelectionChange(e){if(this._hasPendingEdits()){e.preventDefault();let t=e.detail.ref,i=await this._validateActiveEdits([],this.selectedIds);return e.detail.selectedIds?await t.setLayerByIds(i?e.detail.newIds:e.detail.currentIds,!0):await t.setLayerById(i?e.detail.newId:e.detail.currentId,!0)}}async layerSelectionChange(e){await this._layerSelectionChanged(e)}async editsComplete(e){let t=e.detail;(t==="delete"||t==="add")&&(this._allIds=await this.queryAllIds()),await this._refresh()}async facilityChanged(e){this._updateFloorDefinitionExpression()}async levelChanged(e){this._floorLevel=e.detail,this._updateFloorDefinitionExpression()}async siteChanged(e){this._updateFloorDefinitionExpression()}async noLayersFound(){this._layer=void 0,this._allIds=[],this._size=0,this._clearSelection()}async clearSelection(){await this._validateActiveEdits([],this.selectedIds)&&this._clearSelection()}async mapChanged(){this._queryingData=!1,this._creatingFeature=!1,this._clearSelection()}async featuresSelected(e){e.detail.forEach(t=>{let i=this._table?.highlightIds.indexOf(t);i&&i<0&&this._table?.highlightIds.add(t)})}createWorkFlowStarted(){this._creatingFeature=!0}backFromCreateWorkFlow(){this._creatingFeature=!1}async load(){await this._initToolInfos()}render(){let e=this._fetchingData||this._hideTable?"display-none":"",t=this._fetchingData?"":"display-none",i=this._queryingData?"":"display-none",s=this._size.toString(),a=this.selectedIds.length.toString(),l=this.isMobile?"height-full":"height-full-adjusted",h=this._canShowFullTextSearch();return this._validateActiveActions(),o`<div><calcite-scrim class=${b(i)} .loading=${this._queryingData}></calcite-scrim><calcite-shell><div class=${`width-full ${l}`}><calcite-panel class="height-full width-full panel-header-override">${this._getMapLayerPicker("header-actions-start")}${!this.isMobile&&o`${this._getTableControlRow("header-content")}${this._getActionsEnd("header-actions-end")}`||""}${h&&o`<div class="search-container border-bottom"><calcite-input class=search clearable icon=search @calciteInputChange=${n=>{this._searchTextChanged(n)}} .placeholder=${this._searchPlaceHolder} title=${this._searchPlaceHolder??_} type=search ${g(this._searchNode)}></calcite-input></div>`||""}<calcite-loader class=${b(t)} .label=${this._translations.fetchingData} scale=l></calcite-loader><div class=${b(e)} ${g(this.onTableNodeCreate)}></div></calcite-panel></div>${this.isMobile?void 0:o`<div class="bottom-left text-color height-19" id=solutions-selected-count-div>${(this._translations.recordsTotal?.replace("{{total-number-of-records}}",s)+" | "+this._translations.recordsSelected.replace("{{selected-number-of-records}}",a)).replace("{{total}}",s).replace("{{selected}}",a)}</div>`}</calcite-shell></div>`}updated(){this._table&&this.updateRelatedAttachmentColumns()}async _searchTextChanged(e){this._fullTextSearchInfo.forEach(t=>{t.searchTerm=e.target.value}),this._searchFullText()}async _searchFullText(){let e=[],t=!1;if(this._showOnlySelected)e=this._tempSelectedIds,t=!0;else if(await this._validateActiveEdits([],this.selectedIds))this._clearSelection(),this._tempSelectedIds=[];else return;this._searchExpression&&this._clearSearchDefinitionExpression();let i=[];if(this._fullTextSearchInfo?.length&&this._fullTextSearchInfo[0].searchTerm){let s=this._layer?.createQuery();s.fullText=this._fullTextSearchInfo,i=this._layer?await this._layer.queryObjectIds(s):[],t&&e?.length&&(i=i.filter(a=>e.includes(a))),await this._updateSearchDefinitionExpression(i?.length?i:[-1])}t&&i?.length&&(this._showOnlySelected=!0,this._table?.highlightIds.addMany(i.reverse())),await new Promise(s=>setTimeout(s,800)),await this._updateAllIds()}_clearSearchDefinitionExpression(){let e=this._layer?.definitionExpression;this._searchExpression&&e&&e?.indexOf(this._searchExpression)>-1&&this._layer&&(e?.indexOf(" AND ("+this._searchExpression)>-1?this._layer.definitionExpression=e.replace(` AND (${this._searchExpression})`,""):this._layer.definitionExpression=e.replace(this._searchExpression,"")),this._searchExpression=""}async _updateSearchDefinitionExpression(e){let t=this._layer?.definitionExpression;if(this._layer)if(e?.length){let i=`objectId in(${e})`;this._layer.definitionExpression=this._searchExpression&&t&&t.includes(this._searchExpression)?t.replace(this._searchExpression,i):t?`${t} AND (${i})`:i,this._searchExpression=i}else this._clearSearchDefinitionExpression()}_canShowFullTextSearch(){return this._layer?.capabilities?.query?.supportsFullTextSearch&&this._layer.indexes.items.filter(e=>e.indexType=="FullText").length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],this._layer?.capabilities?.query?.supportsFullTextSearch){let e=this._layer.indexes?.filter(t=>t.indexType=="FullText");if(e?.length){let t=[];e.forEach(s=>{t.push(...s.fields.split(","))});let i=[];t.forEach(s=>{let a=this._layer?.getField(s.trim());a?.alias&&i.push(a.alias)}),this._searchPlaceHolder=this._translations.searchPlaceholder.replace("{{field_names}}",i.join(", ")),this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}_getMapLayerPicker(e){let t=this.isMobile?"display-none":"";return o`<div class=${`border-end ${t}`} id=solutions-map-layer-picker-container slot=${e??_}><map-layer-picker appearance=transparent .configLayerOrderDefined=${this._configLayerOrderDefined} .defaultLayerId=${this.defaultLayerId} display=inline-flex .enabledLayerIds=${this._enabledLayerIds} height=50 .isMobile=${this.isMobile} .mapView=${this.mapView} .showOnlyUpdatableLayers=${this.showOnlyUpdatableLayers} placeholder-icon=layers scale=l .selectedIds=${this._layer?[this._layer?.id]:[]} show-single-layer-as-label show-tables type=dropdown></map-layer-picker></div>`}_getLayerOption(e){let t;return this.mapInfo?.layerOptions?.layers.some(i=>i.id===e?(t=i,!0):!1),t}_getActionsEnd(e){let t=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer,i=this._relatedFeatureTable||this._table,s=this._getLayerOption(t?.id||"");return o`<div class="display-flex" slot=${e??_}><field-selection .configExtraFields=${s?.extraFields} .layer=${t} .mapView=${this.mapView} .table=${i} .tableRef=${this.el}></field-selection>${this.enableShare&&!this.isMobile?this._getShare("share"):void 0}</div>`}_getTableControlRow(e){return o`<div class=${"height-51-px width-full display-flex"} slot=${e??_} ${g(this._toolbar)}>${this._getActionBar()}</div>`}_getActionBar(){return o`<calcite-action-bar class=width-full expand-disabled id=${this._getId("bar")??_} layout=horizontal><calcite-action-group>${this.isMobile?void 0:this._getActions()}</calcite-action-group></calcite-action-bar>`}_getActions(){return this._toolInfos?.reduce((e,t)=>(t&&e.push(t.isDanger?this._getDangerAction(t.icon,t.label,t.func,t.disabled):this._getAction(t.active,t.icon,t.indicator,t.label,t.func,t.disabled,!!t.loading,t.toolTip)),e),[])}_validateEnabledActions(){let e=this._getIds().length,t=["zoom-to-object","pencil","trash","erase","selected-items-filter"];this._toolInfos?.forEach(i=>{i&&t.indexOf(i.icon)>-1&&(i.disabled=i.icon==="pencil"?e<2||e>m:e<1,i.toolTip=i.icon==="pencil"?e>m?this._translations.featureEditLimitNotice:this._translations.editMultiple:i.toolTip)})}_validateActiveActions(){let e=["filter","list-check-all","selected-items-filter"];this._toolInfos?.forEach(t=>{t&&e.indexOf(t.icon)>-1&&(t.icon==="filter"&&(t.indicator=this._filterActive),t.icon==="list-check-all"&&(t.active=this._selectAllActive),t.icon==="selected-items-filter"&&(t.active=this._showOnlySelected,t.label=this._showOnlySelected?this._translations.showAll:this._translations.showSelected))})}async _initToolInfos(){let e=this._getIds().length>0,t=this._relatedFeatureTable?this._relatedFeatureTable.layer.isTable:this._layer?.isTable,i=this.featureSelectionMode==="multiple"&&this._layer?.capabilities?.operations.supportsUpdate,s=this._getSelectedIds().length<2||this._getSelectedIds().length>m,a=!this.mapHidden&&!t,l=!this._relatedFeatureTable&&(!this._layer?.isTable||this._hasFilterExpressions()),h=this._featuresEmpty(),n=this.featureSelectionMode==="single",r=this.enableCSV;if(this._relatedFeatureTable){let u=await this._queryRelatedFeatures();r=u&&Object.keys(u).length>0}let d=[];l&&d.push({active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this.toggleFilter.emit(),disabled:!1,toolTip:this._translations.filters}),a&&d.push({active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!e,toolTip:this._translations.zoom}),i&&d.push({active:!1,icon:"pencil",indicator:!1,label:this._translations.editMultiple,func:()=>this.editMultipleFeatures.emit(this._getSelectedIds()),disabled:s,toolTip:this._translations.editMultiple}),this._deleteEnabled&&d.push({active:!1,icon:"trash",indicator:!1,label:this._translations.delete,func:()=>this._showDelete(),disabled:!e,isDanger:!0,toolTip:this._translations.delete}),d.push({active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>{this.clearSelection()},disabled:!e,toolTip:this._translations.clearSelection}),this._relatedFeatureTable||d.push({active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!e,toolTip:this._showOnlySelected?this._translations.showAll:this._translations.showSelected}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"list-check-all",indicator:!1,func:async()=>await this._selectAll(),label:this._translations.selectAll,disabled:h,toolTip:this._translations.selectAll}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"compare",indicator:!1,func:async()=>await this._switchSelected(),label:this._translations.switchSelected,disabled:h,toolTip:this._translations.switchSelected}),d.push({active:!1,icon:"refresh",indicator:!1,func:()=>{this._refresh()},label:this._translations.refresh,disabled:!1,toolTip:this._translations.refresh}),r&&d.push({active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:h,toolTip:this._translations.exportCSV}),this._toolInfos=[...d]}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){let e=`${this._floorField} = '${this._floorLevel}'`,t=this._layer?.definitionExpression;this._layer&&(this._layer.definitionExpression=t&&this._floorExpression&&t?.indexOf(this._floorExpression)>-1?t.replace(this._floorExpression,e):t?`${t} AND (${e})`:e),this._floorExpression=e}}_featuresEmpty(){return this._allIds?.length===0}_hasFilterExpressions(){let e=[],t=this._layer?.id;return this.mapInfo?.filterConfig?.layerExpressions&&t!==void 0&&(e=this.mapInfo.filterConfig.layerExpressions.filter(i=>i.id===t)),e.length>0}_getAction(e,t,i,s,a,l,h,n){let r=this._layer===void 0?!0:l;return o`<calcite-action .active=${e} appearance=solid .disabled=${r} .icon=${t} .id=${`layer-table-${t}`} .indicator=${i} .label=${s} .loading=${h} @click=${a} text text-enabled><div class="display-flex"><span class="label-override padding-start-1-4">${s}</span></div></calcite-action>${this._getToolTip("auto",`layer-table-${t}`,n)}`}_showDelete(){this.showDelete.emit({ids:this._getIds()})}_getShare(e){return o`<div id=${this._getId(e)??_}><instant-apps-social-share class="height-51 width-51 display-flex" .embed=${this.shareIncludeEmbed} flip-rtl popover-button-icon-scale=s scale=m share-button-color=neutral share-button-type=action .socialMedia=${this.shareIncludeSocial} .view=${this.mapView} ${g(this._shareNode)}></instant-apps-social-share>${this._getToolTip("bottom",e,this._translations.share)}</div>`}_updateShareUrl(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this.mapInfo?.id?t.searchParams.set("webmap",this.mapInfo.id):t.searchParams.delete("webmap"),this._layer?.id?t.searchParams.set("layer",this._layer.id):t.searchParams.delete("layer"),this.selectedIds?.length>0?t.searchParams.set("oid",this.selectedIds.reverse().join(",")):t.searchParams.delete("oid"),this.appLayout&&t.searchParams.set("applayout",this.appLayout),this.selectedRelatedIds?.length>0&&this._relatedFeatureTable?.layer?.id&&(t.searchParams.set("oid",this.selectedRelatedIds.join(",")),t.searchParams.set("layer",this._relatedFeatureTable?.layer?.id.toString())),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}_getToolTip(e,t,i){return o`<calcite-tooltip .placement=${e} .referenceElement=${t}><span>${i}</span></calcite-tooltip>`}_getId(e){return`solutions-action-${e}`}_getDangerAction(e,t,i,s){let a=this._layer===void 0?!0:s;return o`<div class="display-flex" id=${this._getId(e)??_}>${o`<calcite-action appearance=solid .disabled=${a} .id=${`layer-table-${e}`} @click=${i} text><calcite-icon class="danger-icon-color" .icon=${e} scale=s></calcite-icon><span class="label-override padding-start-1-4 danger-label-color">${t}</span></calcite-action>`}${this._getToolTip("bottom",`layer-table-${e}`,t)}</div>`}_getIds(){let e=this._relatedFeatureTable??this._table;return this._relatedFeatureTable&&this._table&&this._table.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(e=this._table),e?.highlightIds.map(t=>Number.parseInt(t.toString(),10)).toArray()??[]}onTableNodeCreate(e){this._tableNode=e}async _getTable(e,t){this._layer&&(await this._layer.when(()=>{this._table=new L({autoRefreshEnabled:this.enableAutoRefresh,autoSaveEnabled:this.enableTableAutosave,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,relatedRecordsEnabled:!0,attachmentsEnabled:!0,highlightEnabled:!1,multiSortEnabled:!1,visibleElements:{columnDescriptions:!1,header:!1,menu:!1,progress:!1},tableTemplate:{columnTemplates:t},container:e})}),await this._table?.when(()=>{this._table?.viewModel.addHandles(this._table.highlightIds.on("change",i=>{this._handleOnChange(i)})),this._table?.viewModel.addHandles(this._table.on("cell-pointerover",this.tempHighlightOnHover.bind(this))),this._table?.viewModel.addHandles(this._table.on("cell-pointerout",this._removeTempHighlight.bind(this))),this._table?.viewModel.addHandles(this._table.on("column-reorder",this._handleColumnReorder.bind(this))),this.listenOn(this._tableNode,"mouseleave",this._removeTempHighlight),this._table?.viewModel.addHandles(c.watch(()=>this._table.size,i=>{this._size=i})),c?.watch(()=>this._table?.relatedTable,async i=>{if(i){if(i.rowHighlightIds.length){let a={added:[i.rowHighlightIds.getItemAt(0)],removed:[]};this._handleOnChange(a)}let s=i.layer;if(this._layerEditHandle=s.on("edits",async()=>{await new Promise(a=>setTimeout(a,50)),await this._refresh(!0)}),this._checkEditEnabled(s),i.editingEnabled=this._editEnabled&&this.enableInlineEdit,i.autoSaveEnabled=this.enableTableAutosave,this._relatedFeatureTable=i,typeof i.layer?.id=="string"&&i.layer?.fields){let a=i.layer.popupTemplate?.fieldInfos,l=this._getColumnTemplates(i.layer.id,i.layer.fields,a);this._relatedFeatureTable.tableTemplate=new w({columnTemplates:l})}i.highlightIds.on("change",a=>{this._handleRelatedRecordsChange(a)})}else{this.selectedRelatedIds=[],this._relatedFeatureTable=void 0,this._layerEditHandle&&this._layerEditHandle.remove();let s=this._layer;this._refresh(),s&&this.relatedRecordToggled.emit(s),this._finishOnChange()}await this._initToolInfos()})}))}async _handleRelatedRecordsChange(e){await this._handleOnChange(e),this._updateShareUrl()}hasAttachmentsEnabled(e){if(!e?.capabilities)return!1;let{capabilities:{data:{supportsAttachment:t},operations:{supportsQueryAttachments:i}}}=e;return t&&i}async _handleOnChange(e){if(!await this._validateActiveEdits([...e.added],[...e.removed]))return;let t=[...this._getIds()],i=this._getSelectedLayer(t);this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(i=this._layer,await this._initToolInfos()),i&&this.relatedRecordToggled.emit(i),this.featureSelectionMode==="single"&&(this._relatedFeatureTable&&t.length>1?(this._relatedFeatureTable.highlightIds.remove(t[0]),t.shift()):t.length>1&&!this._selectAllActive&&(this._table?.highlightIds.remove(t[0]),t.shift())),!this._relatedFeatureTable||this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]?(this.selectedRelatedIds=[],this.selectedIds=t.reverse(),this._tempSelectedIds=[...this.selectedIds],this._highlightFeatures(this.selectedIds[0])):this.selectedRelatedIds=t.reverse(),this._finishOnChange()}async _validateActiveEdits(e,t){let i=!0;if(this._editor&&!this._skipEditCheck){if(this._hasPendingEdits()){let s=!1;try{this._editor.viewModel.activeWorkflow&&await this._editor.viewModel.activeWorkflow.cancel({force:!1})}catch(a){s=a?.name==="workflow:cancel-denied"}if(s){let a=this._relatedFeatureTable&&this._relatedFeatureTable.highlightIds.length>0?this._relatedFeatureTable:this._table;i=!1,this._skipEditCheck=!0,e.length>0?a?.highlightIds.removeMany(e):t.length>0&&a?.highlightIds.addMany(t)}}}else i=!this._skipEditCheck,this._skipEditCheck=!1;return this._shouldUpdateTableOnExtentChange=i,i}_hasPendingEdits(){let e=this._editor?.viewModel?.hasPendingEdits,t=this._editor?.activeWorkflow?.activeWorkflow?.hasPendingEdits;return e||t}_finishOnChange(){this._showOnlySelected&&!this._relatedFeatureTable&&(this._table&&this._getSelectedIds().length>0?this._table.filterBySelectionEnabled=!0:this._toggleShowSelected());let e=this._getSelectedIds();setTimeout(()=>{this.featureSelectionChange.emit(e)},50)}_handleColumnReorder(){this.columnReorder.emit()}tempHighlightOnHover(e){if(this._removeTempHighlight(),this._selectedLayerView){let t=e.feature;this._temporaryFeatureHandle=this._selectedLayerView?.highlight([t],{name:"temporary"})}}_removeTempHighlight(){this._temporaryFeatureHandle&&this._temporaryFeatureHandle.remove()}_highlightFeatures(e){if(this._clearHighlights(),this.selectedIds.length>0&&this._selectedLayerView&&(this._currentFeatureHighlightHandle=this._selectedLayerView?.highlight([e],{name:"current-selection"}),this.selectedIds.length>1)){let t=this.selectedIds.filter(i=>i!==e);this._defaultFeaturesHandle=this._selectedLayerView?.highlight(t,{name:"default"})}}_clearHighlights(){this._removeTempHighlight(),this._currentFeatureHighlightHandle&&this._currentFeatureHighlightHandle.remove(),this._defaultFeaturesHandle&&this._defaultFeaturesHandle.remove()}_resetColumnTemplates(){if(this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);t?.length===0?this._tableNode?.classList.add("display-none"):this._tableNode?.classList.remove("display-none");let i=this._table?.tableTemplate?.columnTemplates,s=i&&t&&i.length!==t.length||t?.some((a,l)=>i&&i[l]?JSON.stringify(i[l])!==JSON.stringify(a):!1);if(this._table&&t&&(s||!this._columnsInfo)){this._table.tableTemplate=new w({columnTemplates:t});let a=t.map(l=>l.fieldName);this._initColumnsInfo(a)}}}_setColumnTemplates(e){this._table&&e&&(this._table.tableTemplate=new w({columnTemplates:e}))}async _resetTable(){if(this._loaded=!1,this._clearSelection(),this._allIds=await this.queryAllIds(),!this._table&&this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);this._tableNode&&await this._getTable(this._tableNode,t)}else this._table&&(this._table.view=this.mapView,this._table.layer=this._layer);await this._initLayerRefresh(),this._checkEditEnabled(this._layer),this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._table.autoSaveEnabled=this.enableTableAutosave,await this._table.when(),setTimeout(()=>{this._loaded||this.finishLoading()},1e3),await c.once(()=>this._table?.state==="loaded").then(async()=>{await this.finishLoading()}))}async finishLoading(){try{this._loaded=!0,this._table?.highlightIds.removeAll(),this._table.objectIds.removeAll(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),await this._initToolInfos(),["esri-feature-table","esri-widget"].forEach(e=>{this._tableNode&&!this._tableNode.classList.contains(e)&&this._tableNode.classList.add(e)})}catch(e){console.log(e)}}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._layer&&(this._refreshHandle=this._layer.on("refresh",e=>{e.dataChanged&&this._updateAllIds()}))}async _updateAllIds(){let e=await this.queryAllIds(),t=this.selectedIds.filter(i=>this._allIds.indexOf(i)>-1);(JSON.stringify(e)!==JSON.stringify(this._allIds)||JSON.stringify(this.selectedIds)!==JSON.stringify(t))&&(this._allIds=e,this.selectedIds=t,await this._refresh())}async _handleDefaults(){if(!this._defaultOidHonored&&this.defaultOid?.length>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=[],this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&this.defaultGlobalId&&this.defaultGlobalId?.length>0&&this._table&&this._layer){let e=await O(this.defaultGlobalId,this._layer),t=e?.length>0?e.map(i=>Number(i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=[],this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(e){let t=this._table?.columns.reduce((s,a)=>((!e||e?.indexOf(a.name)>-1)&&(s[a.name]=!a.hidden),s),{}),i=this._table?.columns.map(s=>s.name);(e&&i?e.filter(s=>i.indexOf(s)<0):[]).forEach(s=>{t[s]=!0}),this._columnsInfo=e?e.reduce((s,a)=>(s[a]=t[a],s),{}):t}async _selectDefaultFeature(e){e.length>0&&this._table?.highlightIds.addMany(e)}_checkEditEnabled(e){this._editEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsUpdate),this._deleteEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsDelete)}async _sortTable(){let e=this._layer?.objectIdField,t="desc",i,s=this.mapInfo?.layerOptions?.layers,a=this._layer?.id;s&&s.length>0&&a!==void 0&&(i=s.filter(l=>l.id===a),i&&i.length>0&&(i=i[0],i.sortField&&i.fields?.includes(i.sortField)&&(e=i.sortField),t=i?.sortOrder?i.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when(()=>{e&&this._table?.sortColumn(e,t)}))}async _handleFilterListReset(){this._filterActive=!1,this._updateShareUrl(),await this._searchFullText()}async _handleFilterUpdate(e){if(this._floorExpression&&this._layer){let t=this._layer.definitionExpression,i=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=t&&this._floorField&&t.indexOf(`${this._floorField} = '`)>-1?t.replace(i,this._floorExpression):t?`${t} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=e,this._updateShareUrl(),await this._searchFullText()}_handleTableOnMapExtent(){this._table&&(this._filterByExtentHandle=c.when(()=>this.mapView?.stationary,async()=>{if(this._shouldUpdateTableOnExtentChange&&this.appLayout==="splitView"){if(await new Promise(e=>setTimeout(e,800)),this._table&&this.mapView){this._table.filterGeometry=this.mapView.extent;let e={geometry:this.mapView.extent},t=this._layer&&await this._layer.queryObjectIds(e),i=this.selectedIds.filter(a=>!t?.includes(a)),s=this._outOFExtentOids.filter(a=>t?.includes(a));i.length>0&&(this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table.highlightIds.removeMany(i),this._outOFExtentOids=[...this._outOFExtentOids,...i]),s.length>0&&(this.selectedIds=[...new Set([...this.selectedIds,...s])],this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(this.selectedIds.reverse()),this._outOFExtentOids=this._outOFExtentOids.filter(a=>!s.includes(a)))}this._allIds=await this.queryAllIds()}},{initial:!0}))}async _closeFilter(){this._allIds=await this.queryAllIds()}async queryAllIds(){if(this._layer){let e=this._layer.createQuery();return e.geometry=this._filterByExtentHandle&&this.mapView?this.mapView.extent:null,e.where=this._layer.definitionExpression||"1=1",await this._layer.queryObjectIds(e)}else return[]}async _mapClicked(e){let t={include:this._layer},i=await this.mapView?.hitTest(e.screenPoint,t);if(i&&i.results.length>0){let s=i.results;if(this.featureSelectionMode==="single"){this._table?.highlightIds.removeAll();let a=s[0].graphic.getObjectId();if(a){let l=this._table?.highlightIds.indexOf(a);l!==void 0&&l<0&&this._table?.highlightIds.add(a)}}else s.forEach(a=>{let l=Number(a.graphic.getObjectId()),h=this._table?.highlightIds.indexOf(l);h&&h<0&&l&&this._table?.highlightIds.add(l)});this._showOnlySelected&&this._table&&(this._table.filterBySelectionEnabled=!0)}else await this.clearSelection()}async _selectAll(){let e=this._allIds,t=e.filter(i=>this.selectedIds.indexOf(i)<0);await this._validateActiveEdits(t,this.selectedIds)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(e),this.selectedIds=e,this._finishOnChange(),this._selectAllActive=!0):this._skipEditCheck=!1}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._table&&(this._table.filterBySelectionEnabled=this._showOnlySelected)}_clearSelection(){this._relatedFeatureTable||(this.selectedIds=[],this._outOFExtentOids=[],this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table?.highlightIds.removeAll(),this._clearHighlights(),this._table?.rowHighlightIds.removeAll()),this._relatedFeatureTable&&(this._relatedFeatureTable?.highlightIds.removeAll(),this.selectedRelatedIds=[]),this._finishOnChange()}async _switchSelected(){let e=[...this.selectedIds],t=this._allIds.reduce((i,s)=>(e.indexOf(s)<0&&i.push(s),i),[]).sort((i,s)=>i-s);await this._validateActiveEdits(t,e)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()):this._skipEditCheck=!1}async _exportToCSV(){let e=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer;if(!e)return;let t={},i=this._getIds();if(this._relatedFeatureTable?.tableParent&&this._relatedFeatureTable.highlightIds.length===0){let l=this._relatedFeatureTable.tableParent.highlightIds?.getItemAt(0);if(l!==void 0){let h=await this._queryRelatedFeatures(),n=[];h&&h[l]?.features&&(h[l].features.forEach(r=>{r.attributes&&n.push(r.attributes[e.objectIdField])}),i=n.length>0?n:[])}}t[e.id]={selectionSetNames:[e.title||""],ids:i,layer:e};let s=this._relatedFeatureTable??this._table;if(!s)return;let a=s&&s.columns.toArray().reduce((l,h)=>{if(!h.hidden){let n=h?.name||h?.fieldName;n&&l.push(n.toLocaleLowerCase())}return l},[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,this.mapView?.map&&await $(this.mapView.map,t,!1,!1,!0,a,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}async _queryRelatedFeatures(){let e=this._relatedFeatureTable?this._relatedFeatureTable?this._relatedFeatureTable.layer:this._relatedFeatureTable.tableParent?.layer:this._layer,t=this._relatedFeatureTable?.tableParent?.highlightIds?.items[0],i=this._relatedFeatureTable?.tableParent?.layer,s=e?.relationships?.find(l=>i.relationships?.some(h=>h.id===l.id)),a=new M({objectIds:[t],outFields:["*"],relationshipId:s?.id});return t&&a&&await i.queryRelatedFeatures(a).catch(async l=>{console.error(l)})}_updateToolInfoLoading(e,t){this._toolInfos.some(i=>i?.icon===e?(i.loading=t,!0):!1)}async _refresh(e){if(await this._validateActiveEdits([],this.selectedIds)){this._table&&await this._table.refresh(),this._relatedFeatureTable&&await this._relatedFeatureTable.refresh(),this._allIds=await this.queryAllIds();let t=this._getSelectedLayer(this.selectedRelatedIds);if(t&&this.relatedRecordToggled.emit(t),!e){let i=this._getSelectedIds();this.featureSelectionChange.emit(i)}}}_getSelectedIds(){let e;return this._relatedFeatureTable?this.selectedRelatedIds.length>0?e=this.selectedRelatedIds:e=this._relatedFeatureTable.tableParent?.highlightIds.toArray()??[]:e=this.selectedIds,e}_getSelectedLayer(e){let t;return this._relatedFeatureTable?e.length>0?t=this._relatedFeatureTable.layer:t=this._relatedFeatureTable.tableParent?.layer:t=this._layer,t}async _clearSearchText(){if(this._searchNode.value){this._searchNode.value.value="";let e={target:{value:""}};await this._searchTextChanged(e)}}async _zoom(){this._layer&&this.mapView&&await y(this.selectedIds,this._selectedLayerView,this.mapView,!0,void 0,this.zoomToScale)}async _layerSelectionChanged(e){let t=e.detail[0];if(t!==this._layer?.id||this._featuresEmpty()){this._fetchingData=!0,await this._clearSearchText();let i=this.mapView&&await A(this.mapView,t);i&&await i.when(async()=>{this._selectedLayerView=!i.isTable&&this.mapView?await C(this.mapView,i.id):null,this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._shouldUpdateTableOnExtentChange=!0,this._layer=i,await this._initToolInfos(),this._getFullTextSearchInfo()})}this._creatingFeature=!1,this._fetchingData=!1}_getColumnTemplates(e,t,i){let s=this._getLayerOption(e),a=this._layer?.attributeTableTemplate?.elements,l=[];a?.length>0&&this.honorMapFieldSettings&&(l=a.map(r=>r.fieldName));let h=s?.fields&&s?.fieldOrder?s.fieldOrder.filter(r=>s?.fields&&s.fields.indexOf(r)>-1):l.length>0?l:void 0,n;return t&&(n=t.reduce((r,d)=>{let u={type:"field",fieldName:d.name,label:this.getFieldLabel(d,i),menuConfig:this._getMenuConfig(d.name)};return s&&s.fields&&s?.fields?.length>0?s.fields.indexOf(d.name)>-1&&r.push(u):l.length>0?l.indexOf(d.name)>-1&&r.push(u):r.push(u),r},[])),n?h?n?.sort(this._sortFields.bind(this,h)):n:[]}updateRelatedAttachmentColumns(){let e=this._getLayerOption(this._layer?.id||""),t=this.hasAttachmentsEnabled(this._layer),i=!0,s="attachments",a=(e?.extraFields||[]).reduce((h,n)=>(n.startsWith("related:")?h.related.push(n.split("related:")[1]):h.extra.push(n),h),{related:[],extra:[]}),l=a.extra.some(h=>h.toLowerCase()===s);a&&(t=l&&t,i=a.related.length>0,this._table?.columns.forEach(h=>{h.fieldName.startsWith("EsriFeatureTableRelationshipColumn")&&(h.hidden=!a.related.includes(h.effectiveLabel)),h.fieldName.startsWith("EsriFeatureTableAttachmentsColumn")&&(h.hidden=!a.extra.some(n=>n.toLowerCase()===h.effectiveLabel.toLowerCase()))})),this._table.relatedRecordsEnabled=i,this._table.attachmentsEnabled=t}getFieldLabel(e,t){let i=e.alias?e.alias:e.name;return t?.some(s=>s.fieldName===e.name?(i=s.label,!0):!1),i||e.name}_sortFields(e,t,i){return e?.indexOf(t.fieldName)-e.indexOf(i.fieldName)}_getMenuConfig(e){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(e)}}]}}_handleHideClick(e){this._columnsInfo&&this._table&&(this._columnsInfo[e]=!1,this._table.hideColumn(e),this._table.tableTemplate&&this._table.tableTemplate.columnTemplates.forEach(t=>{t.fieldName===e&&(t.visible=!1)}))}};E("layer-table",I);return I},"widgets/FeatureTable","core/reactiveUtils","rest/support/RelationshipQuery","widgets/FeatureTable/support/TableTemplate",a,c,d,e)
|
|
2
|
+
import e from"./CO37Q2G7.js";import{a as H}from"./SA34OEYY.js";import d from"./ZL6A7VRS.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as S}from"./LFIJXE3U.js";import{b as E}from"./VU3OQQKP.js";import{F as f,G as g,H as x,J as b,h as v,i as o,l as _,r as p,u as T}from"./46DQNAMV.js";export default $arcgis.t(([L,c,M,w,{c:O},{c:C,d:A,j:y},{C:m,o:F},{b:$}])=>{var R=v`@layer{:host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.display-none{display:none}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51-px{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir=rtl] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none!important}vaadin-grid-cell-content{font-size:14px!important;color:var(--calcite-color-text-3)!important}.absolute-right{position:absolute;right:0;left:unset}html[dir=rtl] .absolute-right{left:0;right:unset}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.actions-end{height:50px!important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-dialog-content-space: 0}.esri-feature-table__table-container{height:100%}.search-container{background-color:var(--calcite-color-foreground-1)!important}.search{--calcite-color-border-input: var(--calcite-color-border-3);width:60%;padding:10px}.delete-red{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-color-text-1: var(--calcite-color-status-danger);--calcite-color-text-3: var(--calcite-color-status-danger)}.label-override{white-space:nowrap}.padding-start-1-4{padding-inline-start:.5rem}.panel-header-override{--calcite-panel-header-content-space: 0px}.danger-label-color{color:var(--calcite-color-status-danger)}.danger-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.width-51{width:51px}.height-51{height:51px}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,I=class extends x{constructor(){super(),this.defaultGlobalId=[],this.defaultLayerId="",this.defaultOid=[],this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!1,this.enableInlineEdit=!1,this.enableShare=!1,this.enableTableAutosave=!0,this.featureSelectionMode="multiple",this.selectedRelatedIds=[],this.honorMapFieldSettings=!1,this.isMobile=!1,this.mapHidden=!1,this.showOnlyUpdatableLayers=!1,this.selectedIds=[],this.shareIncludeEmbed=!1,this.shareIncludeSocial=!1,this.showNewestFirst=!1,this.zoomAndScrollToSelected=!1,this._allIds=[],this._configLayerOrderDefined=!1,this._csvExporting=!1,this._fetchingData=!1,this._hideTable=!1,this._filterActive=!1,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=[],this._translations=S({name:"layer-table",blocking:!0}),this._fullTextSearchInfo=[],this._searchPlaceHolder="",this._size=0,this._queryingData=!1,this._editEnabled=!1,this._enabledLayerIds=[],this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._deleteEnabled=!1,this._floorExpression="",this._floorField="",this._floorLevel="",this._loaded=!1,this._shareNode=f(),this._toolbar=f(),this._searchExpression="",this._skipEditCheck=!1,this._tempSelectedIds=[],this._outOFExtentOids=[],this._shouldUpdateTableOnExtentChange=!0,this._creatingFeature=!1,this._searchNode=f(),this.columnReorder=p(),this.featureSelectionChange=p(),this.toggleFilter=p(),this.showDelete=p(),this.relatedRecordToggled=p(),this.editMultipleFeatures=p(),this.listenOn(window,"beforeMapInfoChange",this.beforeMapInfoChange,{capture:!0}),this.listenOn(window,"editorInitialized",this.editorInitialized),this.listenOn(window,"closeEdit",this.closeEdit),this.listenOn(window,"selectionChanged",this.selectionChanged),this.listenOn(window,"beforeLayerSelectionChange",this.beforeLayerSelectionChange),this.listenOn(window,"layerSelectionChange",this.layerSelectionChange),this.listenOn(window,"editsComplete",this.editsComplete),this.listenOn(window,"facilityChanged",this.facilityChanged),this.listenOn(window,"levelChanged",this.levelChanged),this.listenOn(window,"siteChanged",this.siteChanged),this.listenOn(window,"noLayersFound",this.noLayersFound),this.listenOn(window,"clearSelection",this.clearSelection),this.listenOn(window,"mapChanged",this.mapChanged),this.listenOn(window,"featuresSelected",this.featuresSelected),this.listenOn(window,"createWorkFlowStarted",this.createWorkFlowStarted),this.listenOn(window,"backFromCreateWorkFlow",this.backFromCreateWorkFlow),H(window)}static{this.properties={appLayout:1,defaultGlobalId:0,defaultLayerId:1,defaultOid:0,enableAutoRefresh:5,enableColumnReorder:5,enableCSV:5,enableInlineEdit:5,enableShare:5,enableTableAutosave:5,featureSelectionMode:1,selectedRelatedIds:0,honorMapFieldSettings:5,isMobile:5,mapHidden:5,mapInfo:0,mapView:0,showOnlyUpdatableLayers:5,selectedIds:0,shareIncludeEmbed:5,shareIncludeSocial:5,showNewestFirst:5,zoomAndScrollToSelected:5,zoomToScale:9,_allIds:16,_configLayerOrderDefined:16,_csvExporting:16,_fetchingData:16,_hideTable:16,_filterActive:16,_layer:16,_selectAllActive:16,_showHideOpen:16,_showOnlySelected:16,_toolInfos:16,_translations:16,_fullTextSearchInfo:16,_searchPlaceHolder:16,_size:16,_queryingData:16}}static{this.styles=R}static{this.shadowRootOptions=T}willUpdate(e){if(e.has("appLayout")&&this.appLayoutWatchHandler(),e.has("defaultOid")&&this.defaultOidWatchHandler(),e.has("defaultGlobalId")&&this.defaultGlobalIdWatchHandler(),e.has("enableCSV")&&this.enableCSVWatchHandler(),e.has("enableInlineEdit")&&this.enableInlineEditWatchHandler(),e.has("mapHidden")&&this.mapHiddenWatchHandler(),e.has("isMobile")&&this.isMobileWatchHandler(),e.has("mapInfo")&&this.mapInfoWatchHandler(),e.has("mapView")&&this.mapViewWatchHandler(),e.has("_layer")&&this._layerWatchHandler(),e.has("selectedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedIds"))!==JSON.stringify(this.selectedIds))&&this.selectedIdsWatchHandler(),e.has("selectedRelatedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedRelatedIds"))!==JSON.stringify(this.selectedRelatedIds))&&this.selectedRelatedIdsWatchHandler(),e.has("enableTableAutosave")&&this.hasUpdated&&this._table&&(this._table.autoSaveEnabled=this.enableTableAutosave),e.has("_translations")){let t=this._translations._lang,i=e.get("_translations")?._lang;t&&i&&t!==i&&this._initToolInfos()}}async appLayoutWatchHandler(){await this._initToolInfos(),this._updateShareUrl()}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}async enableCSVWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}async mapHiddenWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}async isMobileWatchHandler(){!this._toolInfos&&!this.isMobile&&await this._initToolInfos()}async mapInfoWatchHandler(){this._configLayerOrderDefined="configLayerOrder"in(this.mapInfo?.layerOptions||{}),this._enabledLayerIds=F(this.mapInfo?.layerOptions?.layers||[],this.mapInfo?.layerOptions?.configLayerOrder),this._table&&(this._resetColumnTemplates(),this._sortTable())}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression="",this._searchExpression="undefined",this.mapView.highlights=[{name:"default",color:"#00FFFF"},{name:"current-selection",color:"#ff00ff"},{name:"temporary",color:"#FFFF00"}],this._updateShareUrl(),this._mapClickHandle=c.on(()=>this.mapView,"click",e=>{this._creatingFeature||this._mapClicked(e)}))}async _layerWatchHandler(){if(this._hideTable=!1,this._fetchingData=!0,!this._layer){this._fetchingData=!1,this._hideTable=!0;return}try{await this._layer.when(),this._floorField=this._layer.floorInfo?.floorField||"",this._updateFloorDefinitionExpression(),await this._resetTable(),this._updateShareUrl()}catch(e){console.error(e),this._hideTable=!0}finally{this._fetchingData=!1}}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1),this.selectedIds.length>0&&(this._table.rowHighlightIds.removeAll(),this._table.rowHighlightIds.add(this.selectedIds[0])),this.selectedIds.length===0&&setTimeout(()=>{this.featureSelectionChange.emit(this.selectedIds)},700)}async selectedRelatedIdsWatchHandler(){this._validateEnabledActions(),this.selectedRelatedIds.length>0&&(this._relatedFeatureTable?.rowHighlightIds.removeAll(),this._relatedFeatureTable?.rowHighlightIds.add(this.selectedRelatedIds[0]))}async closeFilter(){await this._closeFilter()}async filterReset(){this._filterByExtentHandle&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle.remove(),this._filterByExtentHandle=void 0),await this._handleFilterListReset()}async filterUpdate(e,t){await this._handleFilterUpdate(e),t?(this._shouldUpdateTableOnExtentChange=!0,this._handleTableOnMapExtent()):t===!1&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle?.remove(),this._filterByExtentHandle=void 0,await this._updateAllIds())}async validateTableUpdate(e){this._shouldUpdateTableOnExtentChange=e}async validateActiveEdits(){return this._validateActiveEdits([],this.selectedIds)}async refresh(){this._table&&await this._refresh()}async setColumnOrder(e){this._setColumnTemplates(e)}async beforeMapInfoChange(e){let t=e.detail.ref,i=e.detail.mapInfo;if(this._hasPendingEdits()){e.preventDefault();let s=await this._validateActiveEdits([],this.selectedIds);await t.setMapByID(s?i.id:e.detail.currentId,!s)}}async editorInitialized(e){this._shouldUpdateTableOnExtentChange=!1,this._editor=e.detail}async closeEdit(){this._shouldUpdateTableOnExtentChange=!0,this._filterByExtentHandle&&this._handleTableOnMapExtent()}async selectionChanged(e){let t=e.detail.selectedFeature[0],i=Number(t.getObjectId()),s=this._table;if(s.rowHighlightIds.length&&s.rowHighlightIds.removeAll(),s.rowHighlightIds.add(i),this._highlightFeatures(i),this.zoomAndScrollToSelected&&s&&this.mapView){let a=s.viewModel.getObjectIdIndex(i);s.scrollToIndex(a);let l=t.layer,h=this.mapView.allLayerViews.toArray(),n;h.some(async r=>r.layer.title===l?.title&&r.layer.type==="feature"?(n=r,this.mapView&&await y([i],n,this.mapView,!0,void 0,this.zoomToScale),!0):!1)}}async beforeLayerSelectionChange(e){if(this._hasPendingEdits()){e.preventDefault();let t=e.detail.ref,i=await this._validateActiveEdits([],this.selectedIds);return e.detail.selectedIds?await t.setLayerByIds(i?e.detail.newIds:e.detail.currentIds,!0):await t.setLayerById(i?e.detail.newId:e.detail.currentId,!0)}}async layerSelectionChange(e){await this._layerSelectionChanged(e)}async editsComplete(e){let t=e.detail;(t==="delete"||t==="add")&&(this._allIds=await this.queryAllIds()),await this._refresh()}async facilityChanged(e){this._updateFloorDefinitionExpression()}async levelChanged(e){this._floorLevel=e.detail,this._updateFloorDefinitionExpression()}async siteChanged(e){this._updateFloorDefinitionExpression()}async noLayersFound(){this._layer=void 0,this._allIds=[],this._size=0,this._clearSelection()}async clearSelection(){await this._validateActiveEdits([],this.selectedIds)&&this._clearSelection()}async mapChanged(){this._queryingData=!1,this._creatingFeature=!1,this._clearSelection()}async featuresSelected(e){e.detail.forEach(t=>{let i=this._table?.highlightIds.indexOf(t);i&&i<0&&this._table?.highlightIds.add(t)})}createWorkFlowStarted(){this._creatingFeature=!0}backFromCreateWorkFlow(){this._creatingFeature=!1}async load(){await this._initToolInfos()}render(){let e=this._fetchingData||this._hideTable?"display-none":"",t=this._fetchingData?"":"display-none",i=this._queryingData?"":"display-none",s=this._size.toString(),a=this.selectedIds.length.toString(),l=this.isMobile?"height-full":"height-full-adjusted",h=this._canShowFullTextSearch();return this._validateActiveActions(),o`<div><calcite-scrim class=${b(i)} .loading=${this._queryingData}></calcite-scrim><calcite-shell><div class=${`width-full ${l}`}><calcite-panel class="height-full width-full panel-header-override">${this._getMapLayerPicker("header-actions-start")}${!this.isMobile&&o`${this._getTableControlRow("header-content")}${this._getActionsEnd("header-actions-end")}`||""}${h&&o`<div class="search-container border-bottom"><calcite-input class=search clearable icon=search @calciteInputChange=${n=>{this._searchTextChanged(n)}} .placeholder=${this._searchPlaceHolder} title=${this._searchPlaceHolder??_} type=search ${g(this._searchNode)}></calcite-input></div>`||""}<calcite-loader class=${b(t)} .label=${this._translations.fetchingData} scale=l></calcite-loader><div class=${b(e)} ${g(this.onTableNodeCreate)}></div></calcite-panel></div>${this.isMobile?void 0:o`<div class="bottom-left text-color height-19" id=solutions-selected-count-div>${(this._translations.recordsTotal?.replace("{{total-number-of-records}}",s)+" | "+this._translations.recordsSelected.replace("{{selected-number-of-records}}",a)).replace("{{total}}",s).replace("{{selected}}",a)}</div>`}</calcite-shell></div>`}updated(){this._table&&this.updateRelatedAttachmentColumns()}async _searchTextChanged(e){this._fullTextSearchInfo.forEach(t=>{t.searchTerm=e.target.value}),this._searchFullText()}async _searchFullText(){let e=[],t=!1;if(this._showOnlySelected)e=this._tempSelectedIds,t=!0;else if(await this._validateActiveEdits([],this.selectedIds))this._clearSelection(),this._tempSelectedIds=[];else return;this._searchExpression&&this._clearSearchDefinitionExpression();let i=[];if(this._fullTextSearchInfo?.length&&this._fullTextSearchInfo[0].searchTerm){let s=this._layer?.createQuery();s.fullText=this._fullTextSearchInfo,i=this._layer?await this._layer.queryObjectIds(s):[],t&&e?.length&&(i=i.filter(a=>e.includes(a))),await this._updateSearchDefinitionExpression(i?.length?i:[-1])}t&&i?.length&&(this._showOnlySelected=!0,this._table?.highlightIds.addMany(i.reverse())),await new Promise(s=>setTimeout(s,800)),await this._updateAllIds()}_clearSearchDefinitionExpression(){let e=this._layer?.definitionExpression;this._searchExpression&&e&&e?.indexOf(this._searchExpression)>-1&&this._layer&&(e?.indexOf(" AND ("+this._searchExpression)>-1?this._layer.definitionExpression=e.replace(` AND (${this._searchExpression})`,""):this._layer.definitionExpression=e.replace(this._searchExpression,"")),this._searchExpression=""}async _updateSearchDefinitionExpression(e){let t=this._layer?.definitionExpression;if(this._layer)if(e?.length){let i=`objectId in(${e})`;this._layer.definitionExpression=this._searchExpression&&t&&t.includes(this._searchExpression)?t.replace(this._searchExpression,i):t?`${t} AND (${i})`:i,this._searchExpression=i}else this._clearSearchDefinitionExpression()}_canShowFullTextSearch(){return this._layer?.capabilities?.query?.supportsFullTextSearch&&this._layer.indexes.items.filter(e=>e.indexType=="FullText").length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],this._layer?.capabilities?.query?.supportsFullTextSearch){let e=this._layer.indexes?.filter(t=>t.indexType=="FullText");if(e?.length){let t=[];e.forEach(s=>{t.push(...s.fields.split(","))});let i=[];t.forEach(s=>{let a=this._layer?.getField(s.trim());a?.alias&&i.push(a.alias)}),this._searchPlaceHolder=this._translations.searchPlaceholder.replace("{{field_names}}",i.join(", ")),this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}_getMapLayerPicker(e){let t=this.isMobile?"display-none":"";return o`<div class=${`border-end ${t}`} id=solutions-map-layer-picker-container slot=${e??_}><map-layer-picker appearance=transparent .configLayerOrderDefined=${this._configLayerOrderDefined} .defaultLayerId=${this.defaultLayerId} display=inline-flex .enabledLayerIds=${this._enabledLayerIds} height=50 .isMobile=${this.isMobile} .mapView=${this.mapView} .showOnlyUpdatableLayers=${this.showOnlyUpdatableLayers} placeholder-icon=layers scale=l .selectedIds=${this._layer?[this._layer?.id]:[]} show-single-layer-as-label show-tables type=dropdown></map-layer-picker></div>`}_getLayerOption(e){let t;return this.mapInfo?.layerOptions?.layers.some(i=>i.id===e?(t=i,!0):!1),t}_getActionsEnd(e){let t=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer,i=this._relatedFeatureTable||this._table,s=this._getLayerOption(t?.id||"");return o`<div class="display-flex" slot=${e??_}><field-selection .configExtraFields=${s?.extraFields} .layer=${t} .mapView=${this.mapView} .table=${i} .tableRef=${this.el}></field-selection>${this.enableShare&&!this.isMobile?this._getShare("share"):void 0}</div>`}_getTableControlRow(e){return o`<div class=${"height-51-px width-full display-flex"} slot=${e??_} ${g(this._toolbar)}>${this._getActionBar()}</div>`}_getActionBar(){return o`<calcite-action-bar class=width-full expand-disabled id=${this._getId("bar")??_} layout=horizontal><calcite-action-group>${this.isMobile?void 0:this._getActions()}</calcite-action-group></calcite-action-bar>`}_getActions(){return this._toolInfos?.reduce((e,t)=>(t&&e.push(t.isDanger?this._getDangerAction(t.icon,t.label,t.func,t.disabled):this._getAction(t.active,t.icon,t.indicator,t.label,t.func,t.disabled,!!t.loading,t.toolTip)),e),[])}_validateEnabledActions(){let e=this._getIds().length,t=["zoom-to-object","pencil","trash","erase","selected-items-filter"];this._toolInfos?.forEach(i=>{i&&t.indexOf(i.icon)>-1&&(i.disabled=i.icon==="pencil"?e<2||e>m:e<1,i.toolTip=i.icon==="pencil"?e>m?this._translations.featureEditLimitNotice:this._translations.editMultiple:i.toolTip)})}_validateActiveActions(){let e=["filter","list-check-all","selected-items-filter"];this._toolInfos?.forEach(t=>{t&&e.indexOf(t.icon)>-1&&(t.icon==="filter"&&(t.indicator=this._filterActive),t.icon==="list-check-all"&&(t.active=this._selectAllActive),t.icon==="selected-items-filter"&&(t.active=this._showOnlySelected,t.label=this._showOnlySelected?this._translations.showAll:this._translations.showSelected))})}async _initToolInfos(){let e=this._getIds().length>0,t=this._relatedFeatureTable?this._relatedFeatureTable.layer.isTable:this._layer?.isTable,i=this.featureSelectionMode==="multiple"&&this._layer?.capabilities?.operations.supportsUpdate,s=this._getSelectedIds().length<2||this._getSelectedIds().length>m,a=!this.mapHidden&&!t,l=!this._relatedFeatureTable&&(!this._layer?.isTable||this._hasFilterExpressions()),h=this._featuresEmpty(),n=this.featureSelectionMode==="single",r=this.enableCSV;if(this._relatedFeatureTable){let u=await this._queryRelatedFeatures();r=u&&Object.keys(u).length>0}let d=[];l&&d.push({active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this.toggleFilter.emit(),disabled:!1,toolTip:this._translations.filters}),a&&d.push({active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!e,toolTip:this._translations.zoom}),i&&d.push({active:!1,icon:"pencil",indicator:!1,label:this._translations.editMultiple,func:()=>this.editMultipleFeatures.emit(this._getSelectedIds()),disabled:s,toolTip:this._translations.editMultiple}),this._deleteEnabled&&d.push({active:!1,icon:"trash",indicator:!1,label:this._translations.delete,func:()=>this._showDelete(),disabled:!e,isDanger:!0,toolTip:this._translations.delete}),d.push({active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>{this.clearSelection()},disabled:!e,toolTip:this._translations.clearSelection}),this._relatedFeatureTable||d.push({active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!e,toolTip:this._showOnlySelected?this._translations.showAll:this._translations.showSelected}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"list-check-all",indicator:!1,func:async()=>await this._selectAll(),label:this._translations.selectAll,disabled:h,toolTip:this._translations.selectAll}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"compare",indicator:!1,func:async()=>await this._switchSelected(),label:this._translations.switchSelected,disabled:h,toolTip:this._translations.switchSelected}),d.push({active:!1,icon:"refresh",indicator:!1,func:()=>{this._refresh()},label:this._translations.refresh,disabled:!1,toolTip:this._translations.refresh}),r&&d.push({active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:h,toolTip:this._translations.exportCSV}),this._toolInfos=[...d]}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){let e=`${this._floorField} = '${this._floorLevel}'`,t=this._layer?.definitionExpression;this._layer&&(this._layer.definitionExpression=t&&this._floorExpression&&t?.indexOf(this._floorExpression)>-1?t.replace(this._floorExpression,e):t?`${t} AND (${e})`:e),this._floorExpression=e}}_featuresEmpty(){return this._allIds?.length===0}_hasFilterExpressions(){let e=[],t=this._layer?.id;return this.mapInfo?.filterConfig?.layerExpressions&&t!==void 0&&(e=this.mapInfo.filterConfig.layerExpressions.filter(i=>i.id===t)),e.length>0}_getAction(e,t,i,s,a,l,h,n){let r=this._layer===void 0?!0:l;return o`<calcite-action .active=${e} appearance=solid .disabled=${r} .icon=${t} .id=${`layer-table-${t}`} .indicator=${i} .label=${s} .loading=${h} @click=${a} text text-enabled><div class="display-flex"><span class="label-override padding-start-1-4">${s}</span></div></calcite-action>${this._getToolTip("auto",`layer-table-${t}`,n)}`}_showDelete(){this.showDelete.emit({ids:this._getIds()})}_getShare(e){return o`<div id=${this._getId(e)??_}><instant-apps-social-share class="height-51 width-51 display-flex" .embed=${this.shareIncludeEmbed} flip-rtl popover-button-icon-scale=s scale=m share-button-color=neutral share-button-type=action .socialMedia=${this.shareIncludeSocial} .view=${this.mapView} ${g(this._shareNode)}></instant-apps-social-share>${this._getToolTip("bottom",e,this._translations.share)}</div>`}_updateShareUrl(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this.mapInfo?.id?t.searchParams.set("webmap",this.mapInfo.id):t.searchParams.delete("webmap"),this._layer?.id?t.searchParams.set("layer",this._layer.id):t.searchParams.delete("layer"),this.selectedIds?.length>0?t.searchParams.set("oid",this.selectedIds.reverse().join(",")):t.searchParams.delete("oid"),this.appLayout&&t.searchParams.set("applayout",this.appLayout),this.selectedRelatedIds?.length>0&&this._relatedFeatureTable?.layer?.id&&(t.searchParams.set("oid",this.selectedRelatedIds.join(",")),t.searchParams.set("layer",this._relatedFeatureTable?.layer?.id.toString())),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}_getToolTip(e,t,i){return o`<calcite-tooltip .placement=${e} .referenceElement=${t}><span>${i}</span></calcite-tooltip>`}_getId(e){return`solutions-action-${e}`}_getDangerAction(e,t,i,s){let a=this._layer===void 0?!0:s;return o`<div class="display-flex" id=${this._getId(e)??_}>${o`<calcite-action appearance=solid .disabled=${a} .id=${`layer-table-${e}`} @click=${i} text><calcite-icon class="danger-icon-color" .icon=${e} scale=s></calcite-icon><span class="label-override padding-start-1-4 danger-label-color">${t}</span></calcite-action>`}${this._getToolTip("bottom",`layer-table-${e}`,t)}</div>`}_getIds(){let e=this._relatedFeatureTable??this._table;return this._relatedFeatureTable&&this._table&&this._table.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(e=this._table),e?.highlightIds.map(t=>Number.parseInt(t.toString(),10)).toArray()??[]}onTableNodeCreate(e){this._tableNode=e}async _getTable(e,t){this._layer&&(await this._layer.when(()=>{this._table=new L({autoRefreshEnabled:this.enableAutoRefresh,autoSaveEnabled:this.enableTableAutosave,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,relatedRecordsEnabled:!0,attachmentsEnabled:!0,highlightEnabled:!1,multiSortEnabled:!1,visibleElements:{columnDescriptions:!1,header:!1,menu:!1,progress:!1},tableTemplate:{columnTemplates:t},container:e})}),await this._table?.when(()=>{this._table?.viewModel.addHandles(this._table.highlightIds.on("change",i=>{this._handleOnChange(i)})),this._table?.viewModel.addHandles(this._table.on("cell-pointerover",this.tempHighlightOnHover.bind(this))),this._table?.viewModel.addHandles(this._table.on("cell-pointerout",this._removeTempHighlight.bind(this))),this._table?.viewModel.addHandles(this._table.on("column-reorder",this._handleColumnReorder.bind(this))),this.listenOn(this._tableNode,"mouseleave",this._removeTempHighlight),this._table?.viewModel.addHandles(c.watch(()=>this._table.size,i=>{this._size=i})),c?.watch(()=>this._table?.relatedTable,async i=>{if(i){if(i.rowHighlightIds.length){let a={added:[i.rowHighlightIds.getItemAt(0)],removed:[]};this._handleOnChange(a)}let s=i.layer;if(this._layerEditHandle=s.on("edits",async()=>{await new Promise(a=>setTimeout(a,50)),await this._refresh(!0)}),this._checkEditEnabled(s),i.editingEnabled=this._editEnabled&&this.enableInlineEdit,i.autoSaveEnabled=this.enableTableAutosave,this._relatedFeatureTable=i,typeof i.layer?.id=="string"&&i.layer?.fields){let a=i.layer.popupTemplate?.fieldInfos,l=this._getColumnTemplates(i.layer.id,i.layer.fields,a);this._relatedFeatureTable.tableTemplate=new w({columnTemplates:l})}i.highlightIds.on("change",a=>{this._handleRelatedRecordsChange(a)})}else{this.selectedRelatedIds=[],this._relatedFeatureTable=void 0,this._layerEditHandle&&this._layerEditHandle.remove();let s=this._layer;this._refresh(),s&&this.relatedRecordToggled.emit(s),this._finishOnChange()}await this._initToolInfos()})}))}async _handleRelatedRecordsChange(e){await this._handleOnChange(e),this._updateShareUrl()}hasAttachmentsEnabled(e){if(!e?.capabilities)return!1;let{capabilities:{data:{supportsAttachment:t},operations:{supportsQueryAttachments:i}}}=e;return t&&i}async _handleOnChange(e){if(!await this._validateActiveEdits([...e.added],[...e.removed]))return;let t=[...this._getIds()],i=this._getSelectedLayer(t);this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(i=this._layer,await this._initToolInfos()),i&&this.relatedRecordToggled.emit(i),this.featureSelectionMode==="single"&&(this._relatedFeatureTable&&t.length>1?(this._relatedFeatureTable.highlightIds.remove(t[0]),t.shift()):t.length>1&&!this._selectAllActive&&(this._table?.highlightIds.remove(t[0]),t.shift())),!this._relatedFeatureTable||this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]?(this.selectedRelatedIds=[],this.selectedIds=t.reverse(),this._tempSelectedIds=[...this.selectedIds],this._highlightFeatures(this.selectedIds[0])):this.selectedRelatedIds=t.reverse(),this._finishOnChange()}async _validateActiveEdits(e,t){let i=!0;if(this._editor&&!this._skipEditCheck){if(this._hasPendingEdits()){let s=!1;try{this._editor.viewModel.activeWorkflow&&await this._editor.viewModel.activeWorkflow.cancel({force:!1})}catch(a){s=a?.name==="workflow:cancel-denied"}if(s){let a=this._relatedFeatureTable&&this._relatedFeatureTable.highlightIds.length>0?this._relatedFeatureTable:this._table;i=!1,this._skipEditCheck=!0,e.length>0?a?.highlightIds.removeMany(e):t.length>0&&a?.highlightIds.addMany(t)}}}else i=!this._skipEditCheck,this._skipEditCheck=!1;return this._shouldUpdateTableOnExtentChange=i,i}_hasPendingEdits(){let e=this._editor?.viewModel?.hasPendingEdits,t=this._editor?.activeWorkflow?.activeWorkflow?.hasPendingEdits;return e||t}_finishOnChange(){this._showOnlySelected&&!this._relatedFeatureTable&&(this._table&&this._getSelectedIds().length>0?this._table.filterBySelectionEnabled=!0:this._toggleShowSelected());let e=this._getSelectedIds();setTimeout(()=>{this.featureSelectionChange.emit(e)},50)}_handleColumnReorder(){this.columnReorder.emit()}tempHighlightOnHover(e){if(this._removeTempHighlight(),this._selectedLayerView){let t=e.feature;this._temporaryFeatureHandle=this._selectedLayerView?.highlight([t],{name:"temporary"})}}_removeTempHighlight(){this._temporaryFeatureHandle&&this._temporaryFeatureHandle.remove()}_highlightFeatures(e){if(this._clearHighlights(),this.selectedIds.length>0&&this._selectedLayerView&&(this._currentFeatureHighlightHandle=this._selectedLayerView?.highlight([e],{name:"current-selection"}),this.selectedIds.length>1)){let t=this.selectedIds.filter(i=>i!==e);this._defaultFeaturesHandle=this._selectedLayerView?.highlight(t,{name:"default"})}}_clearHighlights(){this._removeTempHighlight(),this._currentFeatureHighlightHandle&&this._currentFeatureHighlightHandle.remove(),this._defaultFeaturesHandle&&this._defaultFeaturesHandle.remove()}_resetColumnTemplates(){if(this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);t?.length===0?this._tableNode?.classList.add("display-none"):this._tableNode?.classList.remove("display-none");let i=this._table?.tableTemplate?.columnTemplates,s=i&&t&&i.length!==t.length||t?.some((a,l)=>i&&i[l]?JSON.stringify(i[l])!==JSON.stringify(a):!1);if(this._table&&t&&(s||!this._columnsInfo)){this._table.tableTemplate=new w({columnTemplates:t});let a=t.map(l=>l.fieldName);this._initColumnsInfo(a)}}}_setColumnTemplates(e){this._table&&e&&(this._table.tableTemplate=new w({columnTemplates:e}))}async _resetTable(){if(this._loaded=!1,this._clearSelection(),this._allIds=await this.queryAllIds(),!this._table&&this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);this._tableNode&&await this._getTable(this._tableNode,t)}else this._table&&(this._table.view=this.mapView,this._table.layer=this._layer);await this._initLayerRefresh(),this._checkEditEnabled(this._layer),this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._table.autoSaveEnabled=this.enableTableAutosave,await this._table.when(),setTimeout(()=>{this._loaded||this.finishLoading()},1e3),await c.once(()=>this._table?.state==="loaded").then(async()=>{await this.finishLoading()}))}async finishLoading(){try{this._loaded=!0,this._table?.highlightIds.removeAll(),this._table.objectIds.removeAll(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),await this._initToolInfos(),["esri-feature-table","esri-widget"].forEach(e=>{this._tableNode&&!this._tableNode.classList.contains(e)&&this._tableNode.classList.add(e)})}catch(e){console.log(e)}}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._layer&&(this._refreshHandle=this._layer.on("refresh",e=>{e.dataChanged&&this._updateAllIds()}))}async _updateAllIds(){let e=await this.queryAllIds(),t=this.selectedIds.filter(i=>this._allIds.indexOf(i)>-1);(JSON.stringify(e)!==JSON.stringify(this._allIds)||JSON.stringify(this.selectedIds)!==JSON.stringify(t))&&(this._allIds=e,this.selectedIds=t,await this._refresh())}async _handleDefaults(){if(!this._defaultOidHonored&&this.defaultOid?.length>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=[],this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&this.defaultGlobalId&&this.defaultGlobalId?.length>0&&this._table&&this._layer){let e=await O(this.defaultGlobalId,this._layer),t=e?.length>0?e.map(i=>Number(i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=[],this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(e){let t=this._table?.columns.reduce((s,a)=>((!e||e?.indexOf(a.name)>-1)&&(s[a.name]=!a.hidden),s),{}),i=this._table?.columns.map(s=>s.name);(e&&i?e.filter(s=>i.indexOf(s)<0):[]).forEach(s=>{t[s]=!0}),this._columnsInfo=e?e.reduce((s,a)=>(s[a]=t[a],s),{}):t}async _selectDefaultFeature(e){e.length>0&&this._table?.highlightIds.addMany(e)}_checkEditEnabled(e){this._editEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsUpdate),this._deleteEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsDelete)}async _sortTable(){let e=this._layer?.objectIdField,t="desc",i,s=this.mapInfo?.layerOptions?.layers,a=this._layer?.id;s&&s.length>0&&a!==void 0&&(i=s.filter(l=>l.id===a),i&&i.length>0&&(i=i[0],i.sortField&&i.fields?.includes(i.sortField)&&(e=i.sortField),t=i?.sortOrder?i.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when(()=>{e&&this._table?.sortColumn(e,t)}))}async _handleFilterListReset(){this._filterActive=!1,this._updateShareUrl(),await this._searchFullText()}async _handleFilterUpdate(e){if(this._floorExpression&&this._layer){let t=this._layer.definitionExpression,i=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=t&&this._floorField&&t.indexOf(`${this._floorField} = '`)>-1?t.replace(i,this._floorExpression):t?`${t} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=e,this._updateShareUrl(),await this._searchFullText()}_handleTableOnMapExtent(){this._table&&(this._filterByExtentHandle=c.when(()=>this.mapView?.stationary,async()=>{if(this._shouldUpdateTableOnExtentChange&&this.appLayout==="splitView"){if(await new Promise(e=>setTimeout(e,800)),this._table&&this.mapView){this._table.filterGeometry=this.mapView.extent;let e={geometry:this.mapView.extent},t=this._layer&&await this._layer.queryObjectIds(e),i=this.selectedIds.filter(a=>!t?.includes(a)),s=this._outOFExtentOids.filter(a=>t?.includes(a));i.length>0&&(this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table.highlightIds.removeMany(i),this._outOFExtentOids=[...this._outOFExtentOids,...i]),s.length>0&&(this.selectedIds=[...new Set([...this.selectedIds,...s])],this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(this.selectedIds.reverse()),this._outOFExtentOids=this._outOFExtentOids.filter(a=>!s.includes(a)))}this._allIds=await this.queryAllIds()}},{initial:!0}))}async _closeFilter(){this._allIds=await this.queryAllIds()}async queryAllIds(){if(this._layer){let e=this._layer.createQuery();return e.geometry=this._filterByExtentHandle&&this.mapView?this.mapView.extent:null,e.where=this._layer.definitionExpression||"1=1",await this._layer.queryObjectIds(e)}else return[]}async _mapClicked(e){let t={include:this._layer},i=await this.mapView?.hitTest(e.screenPoint,t);if(i&&i.results.length>0){let s=i.results;if(this.featureSelectionMode==="single"){this._table?.highlightIds.removeAll();let a=s[0].graphic.getObjectId();if(a){let l=this._table?.highlightIds.indexOf(a);l!==void 0&&l<0&&this._table?.highlightIds.add(a)}}else s.forEach(a=>{let l=Number(a.graphic.getObjectId()),h=this._table?.highlightIds.indexOf(l);h&&h<0&&l&&this._table?.highlightIds.add(l)});this._showOnlySelected&&this._table&&(this._table.filterBySelectionEnabled=!0)}else await this.clearSelection()}async _selectAll(){let e=this._allIds,t=e.filter(i=>this.selectedIds.indexOf(i)<0);await this._validateActiveEdits(t,this.selectedIds)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(e),this.selectedIds=e,this._finishOnChange(),this._selectAllActive=!0):this._skipEditCheck=!1}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._table&&(this._table.filterBySelectionEnabled=this._showOnlySelected)}_clearSelection(){this._relatedFeatureTable||(this.selectedIds=[],this._outOFExtentOids=[],this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table?.highlightIds.removeAll(),this._clearHighlights(),this._table?.rowHighlightIds.removeAll()),this._relatedFeatureTable&&(this._relatedFeatureTable?.highlightIds.removeAll(),this.selectedRelatedIds=[]),this._finishOnChange()}async _switchSelected(){let e=[...this.selectedIds],t=this._allIds.reduce((i,s)=>(e.indexOf(s)<0&&i.push(s),i),[]).sort((i,s)=>i-s);await this._validateActiveEdits(t,e)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()):this._skipEditCheck=!1}async _exportToCSV(){let e=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer;if(!e)return;let t={},i=this._getIds();if(this._relatedFeatureTable?.tableParent&&this._relatedFeatureTable.highlightIds.length===0){let l=this._relatedFeatureTable.tableParent.highlightIds?.getItemAt(0);if(l!==void 0){let h=await this._queryRelatedFeatures(),n=[];h&&h[l]?.features&&(h[l].features.forEach(r=>{r.attributes&&n.push(r.attributes[e.objectIdField])}),i=n.length>0?n:[])}}t[e.id]={selectionSetNames:[e.title||""],ids:i,layer:e};let s=this._relatedFeatureTable??this._table;if(!s)return;let a=s&&s.columns.toArray().reduce((l,h)=>{if(!h.hidden){let n=h?.name||h?.fieldName;n&&l.push(n.toLocaleLowerCase())}return l},[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,this.mapView?.map&&await $(this.mapView.map,t,!1,!1,!0,a,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}async _queryRelatedFeatures(){let e=this._relatedFeatureTable?this._relatedFeatureTable?this._relatedFeatureTable.layer:this._relatedFeatureTable.tableParent?.layer:this._layer,t=this._relatedFeatureTable?.tableParent?.highlightIds?.items[0],i=this._relatedFeatureTable?.tableParent?.layer,s=e?.relationships?.find(l=>i.relationships?.some(h=>h.id===l.id)),a=new M({objectIds:[t],outFields:["*"],relationshipId:s?.id});return t&&a&&await i.queryRelatedFeatures(a).catch(async l=>{console.error(l)})}_updateToolInfoLoading(e,t){this._toolInfos.some(i=>i?.icon===e?(i.loading=t,!0):!1)}async _refresh(e){if(await this._validateActiveEdits([],this.selectedIds)){this._table&&await this._table.refresh(),this._relatedFeatureTable&&await this._relatedFeatureTable.refresh(),this._allIds=await this.queryAllIds();let t=this._getSelectedLayer(this.selectedRelatedIds);if(t&&this.relatedRecordToggled.emit(t),!e){let i=this._getSelectedIds();this.featureSelectionChange.emit(i)}}}_getSelectedIds(){let e;return this._relatedFeatureTable?this.selectedRelatedIds.length>0?e=this.selectedRelatedIds:e=this._relatedFeatureTable.tableParent?.highlightIds.toArray()??[]:e=this.selectedIds,e}_getSelectedLayer(e){let t;return this._relatedFeatureTable?e.length>0?t=this._relatedFeatureTable.layer:t=this._relatedFeatureTable.tableParent?.layer:t=this._layer,t}async _clearSearchText(){if(this._searchNode.value){this._searchNode.value.value="";let e={target:{value:""}};await this._searchTextChanged(e)}}async _zoom(){this._layer&&this.mapView&&await y(this.selectedIds,this._selectedLayerView,this.mapView,!0,void 0,this.zoomToScale)}async _layerSelectionChanged(e){let t=e.detail[0];if(t!==this._layer?.id||this._featuresEmpty()){this._fetchingData=!0,await this._clearSearchText();let i=this.mapView&&await A(this.mapView,t);i&&await i.when(async()=>{this._selectedLayerView=!i.isTable&&this.mapView?await C(this.mapView,i.id):null,this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._shouldUpdateTableOnExtentChange=!0,this._layer=i,await this._initToolInfos(),this._getFullTextSearchInfo()})}this._creatingFeature=!1,this._fetchingData=!1}_getColumnTemplates(e,t,i){let s=this._getLayerOption(e),a=this._layer?.attributeTableTemplate?.elements,l=[];a?.length>0&&this.honorMapFieldSettings&&(l=a.map(r=>r.fieldName));let h=s?.fields&&s?.fieldOrder?s.fieldOrder.filter(r=>s?.fields&&s.fields.indexOf(r)>-1):l.length>0?l:void 0,n;return t&&(n=t.reduce((r,d)=>{let u={type:"field",fieldName:d.name,label:this.getFieldLabel(d,i),menuConfig:this._getMenuConfig(d.name)};return s&&s.fields&&s?.fields?.length>0?s.fields.indexOf(d.name)>-1&&r.push(u):l.length>0?l.indexOf(d.name)>-1&&r.push(u):r.push(u),r},[])),n?h?n?.sort(this._sortFields.bind(this,h)):n:[]}updateRelatedAttachmentColumns(){let e=this._getLayerOption(this._layer?.id||""),t=this.hasAttachmentsEnabled(this._layer),i=!0,s="attachments",a=(e?.extraFields||[]).reduce((h,n)=>(n.startsWith("related:")?h.related.push(n.split("related:")[1]):h.extra.push(n),h),{related:[],extra:[]}),l=a.extra.some(h=>h.toLowerCase()===s);a&&(t=l&&t,i=a.related.length>0,this._table?.columns.forEach(h=>{h.fieldName.startsWith("EsriFeatureTableRelationshipColumn")&&(h.hidden=!a.related.includes(h.effectiveLabel)),h.fieldName.startsWith("EsriFeatureTableAttachmentsColumn")&&(h.hidden=!a.extra.some(n=>n.toLowerCase()===h.effectiveLabel.toLowerCase()))})),this._table.relatedRecordsEnabled=i,this._table.attachmentsEnabled=t}getFieldLabel(e,t){let i=e.alias?e.alias:e.name;return t?.some(s=>s.fieldName===e.name?(i=s.label,!0):!1),i||e.name}_sortFields(e,t,i){return e?.indexOf(t.fieldName)-e.indexOf(i.fieldName)}_getMenuConfig(e){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(e)}}]}}_handleHideClick(e){this._columnsInfo&&this._table&&(this._columnsInfo[e]=!1,this._table.hideColumn(e),this._table.tableTemplate&&this._table.tableTemplate.columnTemplates.forEach(t=>{t.fieldName===e&&(t.visible=!1)}))}};E("layer-table",I);return I},"widgets/FeatureTable","core/reactiveUtils","rest/support/RelationshipQuery","widgets/FeatureTable/support/TableTemplate",a,c,d,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as n}from"./
|
|
2
|
+
import{a as n}from"./N4KU3YV3.js";import{b as i}from"./Y7OWLSUL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{H as o,h as a,i as s}from"./46DQNAMV.js";import"./OR4HXHSY.js";var p=a`[role=alert]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`,r=class extends o{constructor(){super(),this._messages=n({name:"instant-apps-app-error"}),this._handleErrorMessage=this._handleErrorMessage.bind(this),this.listenOn(document,"instant-apps-error",this._handleErrorMessage)}static{this.properties={errorMessage:16}}static{this.styles=p}async clearErrorMessage(){this.errorMessage=void 0}_handleErrorMessage(e){if(!e.detail||!this._messages?.errorMessages)return;let t=this._messages.errorMessages[e.detail];t&&(this.errorMessage=t)}render(){return s`<div role=alert>${this.errorMessage&&s`<p>${this.errorMessage}</p>`||""}</div>`}};i("instant-apps-app-error",r);export{r as InstantAppsAppError};
|