@arcgis/portal-components 6.0.0-next.20 → 6.0.0-next.22
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/{EHHFEPC2.js → 22TDAUX4.js} +1 -1
- package/dist/cdn/{5D5INKHG.js → 234TH32X.js} +1 -1
- package/dist/cdn/2D3FQXJ4.js +2 -0
- package/dist/cdn/{AXKMKCEW.js → 2DXO6FVX.js} +1 -1
- package/dist/cdn/{57MT7FOI.js → 2XJX2JUO.js} +1 -1
- package/dist/cdn/{SCRIVOPW.js → 3EQGUCO4.js} +1 -1
- package/dist/cdn/{HXFKOELM.js → 3J3ISO3E.js} +1 -1
- package/dist/cdn/{PXG2SRSN.js → 3RTST3I6.js} +1 -1
- package/dist/cdn/{TKTMO2NO.js → 3XH3JHOI.js} +1 -1
- package/dist/cdn/{SASCLFKY.js → 4ONCJSSP.js} +1 -1
- package/dist/cdn/{O5MB4QQ2.js → 4WQA7UAJ.js} +1 -1
- package/dist/cdn/5OWIWCEQ.js +2 -0
- package/dist/cdn/{AYHYABMC.js → 5R4JJWGB.js} +1 -1
- package/dist/cdn/{SQCDEL42.js → 63HYFDRU.js} +1 -1
- package/dist/cdn/{IRCWBDGJ.js → 6MATPHXT.js} +10 -10
- package/dist/cdn/{565U4WSN.js → 7IP3RVPH.js} +1 -1
- package/dist/cdn/{QKGHH3FS.js → 7ISSDO2T.js} +1 -1
- package/dist/cdn/AKTIIRJQ.js +2 -0
- package/dist/cdn/{APLSVK3C.js → ASID6YW7.js} +1 -1
- package/dist/cdn/{OQ3OHDEB.js → B3HV5JVN.js} +1 -1
- package/dist/cdn/B6666VUQ.js +2 -0
- package/dist/cdn/{LVUKORME.js → BOO7GG5L.js} +1 -1
- package/dist/cdn/CZ4FC4GM.js +2 -0
- package/dist/cdn/{LY7NVMME.js → D3LZFIHV.js} +1 -1
- package/dist/cdn/{UYROTXZP.js → D3Q72PPN.js} +1 -1
- package/dist/cdn/{RAWBYOFF.js → DABNV2OO.js} +1 -1
- package/dist/cdn/DOCNBKQZ.js +2 -0
- package/dist/cdn/DX7ZVMO3.js +70 -0
- package/dist/cdn/{VXYEF3XW.js → EP7NWEC5.js} +1 -1
- package/dist/cdn/{AAWXEOVL.js → ESKKH4DE.js} +1 -1
- package/dist/cdn/{CUJG43PQ.js → EUQQZIRW.js} +1 -1
- package/dist/cdn/F2HT5PVQ.js +2 -0
- package/dist/cdn/FE3O23SE.js +2 -0
- package/dist/cdn/{U4PHGRXB.js → FGRMURKX.js} +1 -1
- package/dist/cdn/{ULTSLT4L.js → FYVATGMR.js} +1 -1
- package/dist/cdn/{5SKCVK2P.js → G3WDR53S.js} +1 -1
- package/dist/cdn/GAU6DNV5.js +2 -0
- package/dist/cdn/GPAIXN52.js +2 -0
- package/dist/cdn/GRSBU4PD.js +2 -0
- package/dist/cdn/{4I7NKRIH.js → H7FA5HFE.js} +1 -1
- package/dist/cdn/{3ZC26CT6.js → HHGKNVCH.js} +1 -1
- package/dist/cdn/{OQE662U3.js → HJLWIQDI.js} +1 -1
- package/dist/cdn/I3EWDYTU.js +2 -0
- package/dist/cdn/{I4ZRFXQ3.js → IKPVMXXW.js} +1 -1
- package/dist/cdn/{C5FTQSU6.js → IOFXDIWC.js} +1 -1
- package/dist/cdn/IPHBVKMY.js +2 -0
- package/dist/cdn/{ZS3JUQN3.js → IUIFCQQU.js} +1 -1
- package/dist/cdn/{QJB32L7F.js → IVDZGUNZ.js} +1 -1
- package/dist/cdn/J6SI4Z4F.js +2 -0
- package/dist/cdn/K7LYYLUF.js +2 -0
- package/dist/cdn/{Y72W3QFF.js → KDORI7H4.js} +1 -1
- package/dist/cdn/{2267AKWE.js → LGJWULAW.js} +1 -1
- package/dist/cdn/LTMPXQTC.js +2 -0
- package/dist/cdn/M5STJJRX.js +2 -0
- package/dist/cdn/{VAJV46OF.js → M7J7RAM4.js} +1 -1
- package/dist/cdn/{HIPJAMO4.js → N4ZRMYZL.js} +1 -1
- package/dist/cdn/NBCYYUHP.js +2 -0
- package/dist/cdn/NHVPNSNH.js +2 -0
- package/dist/cdn/{VNVGVYX6.js → NQ2IAQKL.js} +2 -2
- package/dist/cdn/NXGTEDK4.js +2 -0
- package/dist/cdn/{I3ECBIYX.js → NYOXMT6S.js} +1 -1
- package/dist/cdn/O3JP4FQ3.js +2 -0
- package/dist/cdn/{MXUHZ474.js → ODSA6NNS.js} +1 -1
- package/dist/cdn/{PVPTFK7N.js → OHAQPQAP.js} +1 -1
- package/dist/cdn/OOXTSCQT.js +2 -0
- package/dist/cdn/OQ2JULON.js +2 -0
- package/dist/cdn/{7XBN6ZF4.js → OVH4YLTS.js} +1 -1
- package/dist/cdn/{6T4X4RAB.js → QB5BGHLA.js} +1 -1
- package/dist/cdn/QKCRNS75.js +2 -0
- package/dist/cdn/{6XAFP5OI.js → RKMW4FUN.js} +1 -1
- package/dist/cdn/{E26PFYPI.js → RT26JZP5.js} +1 -1
- package/dist/cdn/SKHFISBA.js +2 -0
- package/dist/cdn/SKIDJ4QI.js +2 -0
- package/dist/cdn/{VXDDXPD7.js → SSCKCDXD.js} +1 -1
- package/dist/cdn/{YERFI6P2.js → T66G7GIR.js} +1 -1
- package/dist/cdn/{MOE6L5RN.js → TIMYD2HM.js} +1 -1
- package/dist/cdn/TJWJ3LTU.js +2 -0
- package/dist/cdn/{EXEAVQRP.js → TMR4BRFI.js} +1 -1
- package/dist/cdn/{ZJWAM6OL.js → TTQGRN2V.js} +1 -1
- package/dist/cdn/{YTVLEHJT.js → UHOW7Q65.js} +1 -1
- package/dist/cdn/{2XIDYV73.js → US3N5L73.js} +1 -1
- package/dist/cdn/W5POIPYP.js +2 -0
- package/dist/cdn/{EQTGOMBD.js → WJWWYBZ7.js} +1 -1
- package/dist/cdn/WNEPEEPZ.js +2 -0
- package/dist/cdn/{NDCMZLMU.js → WPAZDJHU.js} +1 -1
- package/dist/cdn/WT72SOAU.js +2 -0
- package/dist/cdn/XJGKRAN5.js +2 -0
- package/dist/cdn/{MSP6STQ7.js → XS5EOWBK.js} +1 -1
- package/dist/cdn/{7PBECSW5.js → YCIFVZ4J.js} +1 -1
- package/dist/cdn/{TNRHHR67.js → YDXJHNDI.js} +1 -1
- package/dist/cdn/{TRFH3KNJ.js → YIOJIA4Y.js} +1 -1
- package/dist/cdn/{I57CRKF7.js → YK6FCXWU.js} +1 -1
- package/dist/cdn/{FLUCWAMC.js → YPDHSE2J.js} +1 -1
- package/dist/cdn/{ZJCG6JI7.js → YQLFXHFG.js} +1 -1
- package/dist/cdn/{QSRWVCWP.js → YSVPB3BO.js} +1 -1
- package/dist/cdn/{SHGPWFEC.js → YUOVGTP5.js} +1 -1
- package/dist/cdn/{GOUAS2Q5.js → Z5CA4C6H.js} +1 -1
- package/dist/cdn/{GDCXUNOL.js → ZD6XJVGV.js} +1 -1
- package/dist/cdn/{4B2URSFO.js → ZHQXYCPA.js} +1 -1
- package/dist/cdn/{Y6WQZMYW.js → ZOX4RLS4.js} +1 -1
- package/dist/cdn/assets/portal-item-card-sublayer-select/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/item2.js +29 -25
- package/dist/chunks/itemThumbnail.js +21 -21
- package/dist/chunks/request.js +51 -43
- package/dist/chunks/utils3.js +88 -657
- package/dist/chunks/utils4.js +664 -0
- package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +1 -1
- package/dist/components/arcgis-portal-item-card/customElement.d.ts +20 -8
- package/dist/components/arcgis-portal-item-card/customElement.js +79 -70
- package/dist/components/arcgis-portal-item-card/index.js +1 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.d.ts +102 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/customElement.js +352 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/index.js +8 -0
- package/dist/components/arcgis-portal-item-card-sublayer-select/types.d.ts +22 -0
- package/dist/components/arcgis-portal-item-thumbnail/customElement.d.ts +1 -0
- package/dist/components/arcgis-portal-item-thumbnail/customElement.js +13 -13
- package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/components/arcgis-portal-sublayer-type/customElement.js +13 -103
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/loader.js +2 -1
- package/dist/types/item.d.ts +11 -11
- package/dist/types/lumina.d.ts +9 -1
- package/dist/types/preact.d.ts +10 -1
- package/dist/types/react.d.ts +11 -1
- package/dist/types/services.d.ts +3 -0
- package/dist/types/stencil.d.ts +9 -1
- package/package.json +8 -8
- package/dist/cdn/225AERRK.js +0 -2
- package/dist/cdn/5VAV267L.js +0 -2
- package/dist/cdn/67QXUNKX.js +0 -2
- package/dist/cdn/6BQUKFTK.js +0 -2
- package/dist/cdn/723D3EKN.js +0 -2
- package/dist/cdn/AEPP4WJM.js +0 -2
- package/dist/cdn/B474WTYE.js +0 -2
- package/dist/cdn/C7KQT5QW.js +0 -2
- package/dist/cdn/CL5FABMT.js +0 -2
- package/dist/cdn/FTT33ZZJ.js +0 -2
- package/dist/cdn/FXTPC2Q5.js +0 -2
- package/dist/cdn/GJNGP34L.js +0 -2
- package/dist/cdn/IAK4F5SX.js +0 -2
- package/dist/cdn/JOQEFKCE.js +0 -2
- package/dist/cdn/K5Q4ZROX.js +0 -2
- package/dist/cdn/K6LF5U7K.js +0 -2
- package/dist/cdn/MK2KDBUL.js +0 -66
- package/dist/cdn/MUW2YNAS.js +0 -2
- package/dist/cdn/OQUQ7Z3E.js +0 -2
- package/dist/cdn/P74FP43E.js +0 -2
- package/dist/cdn/RA75BDVB.js +0 -2
- package/dist/cdn/RLI7T32U.js +0 -2
- package/dist/cdn/RYPYVJ5U.js +0 -2
- package/dist/cdn/TLZO6KZO.js +0 -2
- package/dist/cdn/UD4KPMGF.js +0 -2
- package/dist/cdn/UL3XBQUT.js +0 -2
- package/dist/cdn/VH2IMPMN.js +0 -2
- package/dist/cdn/VRGGPMVR.js +0 -2
- package/dist/cdn/WQWJVM5B.js +0 -2
- package/dist/cdn/XT6IKL7A.js +0 -2
- /package/dist/cdn/{OUMTV5H5.js → KHKREBVZ.js} +0 -0
- /package/dist/cdn/{XYT4533U.js → U2HTYOBB.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as g}from"./
|
|
2
|
+
import{a as g}from"./5R4JJWGB.js";import{K as m,N as l,Q as u,h as p,j as s,v as d}from"./HHGKNVCH.js";var w=p`.sort-accordion-wrap{border-bottom:1px solid var(--calcite-color-border-2)}.sort-title{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);padding:1rem .5rem;margin:0 0 -1px;line-height:1;border-bottom:1px solid var(--calcite-color-border-2)}.dropdown-sort-order-items--in-dialog{max-height:var(--arcgis-browser-sort-max-height, none)}.sort-accordion-item{--calcite-accordion-item-content-space: .75rem .25rem;--calcite-accordion-icon-margin: .5rem;border-top:1px solid var(--calcite-color-border-1)}.sort-accordion-content{margin:-.75rem .5rem 0}`,b={title:["asc","alphabetical"],owner:["asc","alphabetical"],numviews:["desc","num"],relevance:["desc"],modified:["desc","recent"],created:["desc","recent"],size:["desc","size"],fullname:["asc","alphabetical"],username:["asc","alphabetical"],name:["asc","alphabetical"],membertype:["asc","alphabetical"],joined:["desc","recent"],lastlogin:["desc","recent"],added:["desc","recent"],dataset:["asc","alphabetical"],mfaenabled:["desc","default"],description:["asc","alphabetical"],lastSyncFailureCount:["desc","num"],invitationsPendingCount:["desc","num"],participantGroupLinksCount:["desc","num"]};function n(a,e,r){let[t,o]=b[a],i=a==="modified"&&r?e.deleted||"Date deleted":e[a]||a,c={asc:(o?e[`${o}Asc`]:void 0)||e.defaultAsc,desc:(o?e[`${o}Desc`]:void 0)||e.defaultDesc};return{label:i,showSortOrder:!!o,defaultSortOrder:t,sortOrderLabels:c}}var h=class extends m{constructor(){super(...arguments),this._messages=g({name:"portal-browser",blocking:!0}),this.sortOrders=["asc","desc"],this.options=[],this.appearance="dropdown",this.showText=!0,this.useDeleted=!1,this.arcgisBrowserSortFieldChange=d(),this.arcgisBrowserSortOrderChange=d()}static{this.properties={options:0,field:1,order:1,appearance:1,showText:5,useDeleted:5}}static{this.styles=w}getI18n(){return this._messages.sort}renderFieldOption(e,r){let t=this.getI18n(),o=n(e,t,this.useDeleted);return s`<calcite-dropdown-item .selected=${r===e} @calciteDropdownItemSelect=${()=>this.arcgisBrowserSortFieldChange.emit(e)}>${o.label}</calcite-dropdown-item>`}renderButton(e){let r=this.getI18n(),t=n(e,r,this.useDeleted),o=`${r.sortBy} ${t.label}`;return s`<calcite-button class="button" slot=trigger scale=m appearance=outline-fill kind=neutral icon-start=sort-descending icon-flip-rtl=start .label=${o}>${this.showText?t.label:null}</calcite-button>`}renderDropdown(){if(!this.options.length)return null;let e=this.getI18n(),r=this.field&&this.options.includes(this.field)?this.field:this.options[0],t=n(r,e,this.useDeleted),o=this.order||t.defaultSortOrder;return s`<calcite-dropdown placement=bottom-end scale=m overlay-positioning=fixed width=m>${this.renderButton(r)}<calcite-dropdown-group selection-mode=single .groupTitle=${e.sortBy}>${this.options.map(i=>this.renderFieldOption(i,r))}</calcite-dropdown-group>${t.showSortOrder&&s`<calcite-dropdown-group selection-mode=single .groupTitle=${e.sortDirection}>${this.sortOrders.map(i=>s`<calcite-dropdown-item .selected=${o===i} @calciteDropdownItemSelect=${()=>this.arcgisBrowserSortOrderChange.emit(i)}>${t.sortOrderLabels[i]}</calcite-dropdown-item>`)}</calcite-dropdown-group>`||""}</calcite-dropdown>`}renderTreeItem(e,r){let t=this.getI18n(),o=n(e,t,this.useDeleted);return s`<calcite-tree-item data-value=${e??l} .selected=${r===e}><a>${o.label}</a></calcite-tree-item>`}renderAccordion(e,r,t){return t?null:s`<calcite-accordion-item .heading=${e} class="sort-accordion-item"><div class="sort-accordion-content">${r}</div></calcite-accordion-item>`}renderAccordions(){if(!this.options.length)return null;let e=this.getI18n(),r=this.field&&this.options.includes(this.field)?this.field:this.options[0],t=n(r,e,this.useDeleted),o=this.order||t.defaultSortOrder;return s`<div class="sort-accordion-wrap"><h3 class="sort-title">${e.sort}</h3><calcite-accordion appearance=transparent icon-type=chevron scale=m icon-position=start>${this.renderAccordion(e.sortBy,s`<calcite-tree @calciteTreeSelect=${i=>{let c=i.target.selectedItems?.[0]?.dataset.value;c&&typeof c=="string"&&this.arcgisBrowserSortFieldChange.emit(c)}}>${this.options.map(i=>this.renderTreeItem(i,r))}</calcite-tree>`)}${this.renderAccordion(e.sortDirection,s`<calcite-tree @calciteTreeSelect=${i=>{let c=i.target.selectedItems?.[0]?.dataset.value;(c==="asc"||c==="desc")&&this.arcgisBrowserSortOrderChange.emit(c)}}>${this.sortOrders.map(i=>s`<calcite-tree-item data-value=${i??l} .selected=${o===i}><a>${t.sortOrderLabels[i]}</a></calcite-tree-item>`)}</calcite-tree>`,!t.showSortOrder)}</calcite-accordion></div>`}render(){return this.appearance==="accordion"?this.renderAccordions():this.renderDropdown()}};u("arcgis-portal-browser-sort",h);export{h as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{$ as _e,$a as Vt,A as _i,Aa as Zi,B as vi,C as bi,D as wi,Da as Ui,E as ki,Ea as tn,F as We,G as _r,Ha as wr,I as Pn,J as Tt,Ja as $n,K as Gr,Ka as Vi,L as xi,M as Ti,Ma as iu,N as Si,P as Ei,Pa as kr,Q as vr,R as Ai,Ra as Dn,S as Ra,U as zt,V as Jr,Va as Ln,W as Oi,Wa as tt,X as Ci,Y as Ge,Ya as Oe,Z as br,_ as qr,_a as he,a as M,aa as Hr,ab as q,b as gr,ba as Kr,bb as Y,c as si,ca as Ii,cb as xe,d as yr,da as Ni,ea as Yr,fa as Xr,ga as Pi,ha as Ri,ia as et,ja as Qr,k as On,ka as Mi,l as ii,la as $i,m as Cn,ma as en,n as In,na as Bt,o as oi,oa as Zt,p as ci,pa as Di,q as Nn,qa as Li,r as ui,ra as ji,s as li,sa as St,t as di,ta as Rn,u as fi,ua as Mn,v as pi,va as Fi,w as mi,wa as zi,x as hi,xa as Ut,y as gi,ya as Bi,z as yi}from"./
|
|
2
|
+
import{$ as _e,$a as Vt,A as _i,Aa as Zi,B as vi,C as bi,D as wi,Da as Ui,E as ki,Ea as tn,F as We,G as _r,Ha as wr,I as Pn,J as Tt,Ja as $n,K as Gr,Ka as Vi,L as xi,M as Ti,Ma as iu,N as Si,P as Ei,Pa as kr,Q as vr,R as Ai,Ra as Dn,S as Ra,U as zt,V as Jr,Va as Ln,W as Oi,Wa as tt,X as Ci,Y as Ge,Ya as Oe,Z as br,_ as qr,_a as he,a as M,aa as Hr,ab as q,b as gr,ba as Kr,bb as Y,c as si,ca as Ii,cb as xe,d as yr,da as Ni,ea as Yr,fa as Xr,ga as Pi,ha as Ri,ia as et,ja as Qr,k as On,ka as Mi,l as ii,la as $i,m as Cn,ma as en,n as In,na as Bt,o as oi,oa as Zt,p as ci,pa as Di,q as Nn,qa as Li,r as ui,ra as ji,s as li,sa as St,t as di,ta as Rn,u as fi,ua as Mn,v as pi,va as Fi,w as mi,wa as zi,x as hi,xa as Ut,y as gi,ya as Bi,z as yi}from"./U2HTYOBB.js";import{a as rt,b as Ma,c as jn,d as $a,e as Wi,f as Gi,g as Da,j as Te,k as Ji,l as qi,m as La,o as ja}from"./K3GAZFRI.js";import{a as au,b as su,c as ai}from"./5PV2GUZW.js";var Cc=au(wa=>{"use strict";wa.byteLength=jd;wa.toByteArray=zd;wa.fromByteArray=Ud;var lt=[],Be=[],Ld=typeof Uint8Array<"u"?Uint8Array:Array,Ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(fr=0,Ac=Ws.length;fr<Ac;++fr)lt[fr]=Ws[fr],Be[Ws.charCodeAt(fr)]=fr;var fr,Ac;Be[45]=62;Be[95]=63;function Oc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function jd(e){var t=Oc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Fd(e,t,r){return(t+r)*3/4-r}function zd(e){var t,r=Oc(e),n=r[0],a=r[1],s=new Ld(Fd(e,n,a)),i=0,o=a>0?n-4:n,c;for(c=0;c<o;c+=4)t=Be[e.charCodeAt(c)]<<18|Be[e.charCodeAt(c+1)]<<12|Be[e.charCodeAt(c+2)]<<6|Be[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return a===2&&(t=Be[e.charCodeAt(c)]<<2|Be[e.charCodeAt(c+1)]>>4,s[i++]=t&255),a===1&&(t=Be[e.charCodeAt(c)]<<10|Be[e.charCodeAt(c+1)]<<4|Be[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function Bd(e){return lt[e>>18&63]+lt[e>>12&63]+lt[e>>6&63]+lt[e&63]}function Zd(e,t,r){for(var n,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push(Bd(n));return a.join("")}function Ud(e){for(var t,r=e.length,n=r%3,a=[],s=16383,i=0,o=r-n;i<o;i+=s)a.push(Zd(e,i,i+s>o?o:i+s));return n===1?(t=e[r-1],a.push(lt[t>>2]+lt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(lt[t>>10]+lt[t>>4&63]+lt[t<<2&63]+"=")),a.join("")}});async function Ce(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(n=>{if(!t?.aborted)throw n}),new Promise((n,a)=>{r=()=>{a(Et(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&a(Et(t))})]).finally(()=>t.removeEventListener("abort",r))}function Et(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}var Bf=M({AsyncGeneratorWithSetup:()=>At,IterableReadableStream:()=>ve,atee:()=>Fn,concat:()=>Ie,pipeGeneratorWithSetup:()=>za}),ve=class Fa extends ReadableStream{reader;ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){let t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){let r=this.reader.cancel();this.reader.releaseLock(),await r}throw t}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(t){let r=t.getReader();return new Fa({start(n){return a();function a(){return r.read().then(({done:s,value:i})=>{if(s){n.close();return}return n.enqueue(i),a()})}},cancel(){r.releaseLock()}})}static fromAsyncGenerator(t){return new Fa({async pull(r){let{value:n,done:a}=await t.next();a&&r.close(),r.enqueue(n)},async cancel(r){await t.return(r)}})}};function Fn(e,t=2){let r=Array.from({length:t},()=>[]);return r.map(async function*(a){for(;;)if(a.length===0){let s=await e.next();for(let i of r)i.push(s)}else{if(a[0].done)return;yield a.shift().value}})}function Ie(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t);if(typeof e=="string"&&typeof t=="string")return e+t;if(typeof e=="number"&&typeof t=="number")return e+t;if("concat"in e&&typeof e.concat=="function")return e.concat(t);if(typeof e=="object"&&typeof t=="object"){let r={...e};for(let[n,a]of Object.entries(t))n in r&&!Array.isArray(r[n])?r[n]=Ie(r[n],a):r[n]=a;return r}else throw new Error(`Cannot concat ${typeof e} and ${typeof t}`)}var At=class{generator;setup;config;signal;firstResult;firstResultUsed=!1;constructor(e){this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((t,r)=>{Oe.runWithConfig(xe(e.config),async()=>{this.firstResult=this.signal?Ce(e.generator.next(),this.signal):e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(t,r):this.firstResult.then(n=>t(void 0),r)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Oe.runWithConfig(xe(this.config),this.signal?async()=>Ce(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}};async function za(e,t,r,n,...a){let s=new At({generator:t,startSetup:r,signal:n}),i=await s.setup;return{output:e(s,i,...a),setup:i}}var ou=Object.prototype.hasOwnProperty;function Bn(e,t){return ou.call(e,t)}function Zn(e){if(Array.isArray(e)){let r=new Array(e.length);for(let n=0;n<r.length;n++)r[n]=""+n;return r}if(Object.keys)return Object.keys(e);let t=[];for(let r in e)Bn(e,r)&&t.push(r);return t}function Ne(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Un(e){let t=0,r=e.length,n;for(;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Wt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ki(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function zn(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(zn(e[r]))return!0}else if(typeof e=="object"){let r=Zn(e),n=r.length;for(var t=0;t<n;t++)if(zn(e[r[t]]))return!0}}return!1}function Hi(e,t){let r=[e];for(let n in t){let a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(`${n}: ${a}`)}return r.join(`
|
|
3
3
|
`)}var Yi=class extends Error{name;index;operation;tree;constructor(e,t,r,n,a){super(Hi(e,{name:t,index:r,operation:n,tree:a})),this.name=t,this.index=r,this.operation=n,this.tree=a,Object.setPrototypeOf(this,new.target.prototype),this.message=Hi(e,{name:t,index:r,operation:n,tree:a})}};var Xi=M({JsonPatchError:()=>ae,_areEquals:()=>Tr,applyOperation:()=>Ot,applyPatch:()=>pt,applyReducer:()=>Qi,deepClone:()=>cu,getValueByPointer:()=>rn,validate:()=>Ba,validator:()=>nn});var ae=Yi,cu=Ne,xr={add:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){let n=rn(r,this.path);n&&(n=Ne(n));let a=Ot(r,{op:"remove",path:this.from}).removed;return Ot(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){let n=rn(r,this.from);return Ot(r,{op:"add",path:this.path,value:Ne(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Tr(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},uu={add:function(e,t,r){return Un(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:xr.move,copy:xr.copy,test:xr.test,_get:xr._get};function rn(e,t){if(t=="")return e;var r={op:"_get",path:t};return Ot(e,r),r.value}function Ot(e,t,r=!1,n=!0,a=!0,s=0){if(r&&(typeof r=="function"?r(t,0,e,t.path):nn(t,0)),t.path===""){let i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=rn(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Tr(e,t.value),i.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new ae("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return i}}else{n||(e=Ne(e));let i=(t.path||"").split("/"),o=e,c=1,l=i.length,f,p,y;for(typeof r=="function"?y=r:y=nn;;){if(p=i[c],p&&p.indexOf("~")!=-1&&(p=Ki(p)),a&&(p=="__proto__"||p=="prototype"&&c>0&&i[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&f===void 0&&(o[p]===void 0?f=i.slice(0,c).join("/"):c==l-1&&(f=t.path),f!==void 0&&y(t,0,e,f)),c++,Array.isArray(o)){if(p==="-")p=o.length;else{if(r&&!Un(p))throw new ae("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Un(p)&&(p=~~p)}if(c>=l){if(r&&t.op==="add"&&p>o.length)throw new ae("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);let h=uu[t.op].call(t,o,p,e);if(h.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return h}}else if(c>=l){let h=xr[t.op].call(t,o,p,e);if(h.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return h}if(o=o[p],r&&c<l&&(!o||typeof o!="object"))throw new ae("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function pt(e,t,r,n=!0,a=!0){if(r&&!Array.isArray(t))throw new ae("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Ne(e));let s=new Array(t.length);for(let i=0,o=t.length;i<o;i++)s[i]=Ot(e,t[i],r,!0,a,i),e=s[i].newDocument;return s.newDocument=e,s}function Qi(e,t,r){let n=Ot(e,t);if(n.test===!1)throw new ae("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function nn(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new ae("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(xr[e.op]){if(typeof e.path!="string")throw new ae("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ae('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ae("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ae("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&zn(e.value))throw new ae("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new ae("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new ae("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i=Ba([{op:"_get",path:e.from,value:void 0}],r);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new ae("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new ae("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Ba(e,t,r){try{if(!Array.isArray(e))throw new ae("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)pt(Ne(t),Ne(e),r||!0);else{r=r||nn;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof ae)return a;throw a}}function Tr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),a,s,i;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!Tr(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var o=Object.keys(e);if(s=o.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(o[a]))return!1;for(a=s;a--!==0;)if(i=o[a],!Tr(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}function eo(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Zn(t),i=Zn(e),o=!1,c=i.length-1;c>=0;c--){var l=i[c],f=e[l];if(Bn(t,l)&&!(t[l]===void 0&&f!==void 0&&Array.isArray(t)===!1)){var p=t[l];typeof f=="object"&&f!=null&&typeof p=="object"&&p!=null&&Array.isArray(f)===Array.isArray(p)?eo(f,p,r,n+"/"+Wt(l),a):f!==p&&(a&&r.push({op:"test",path:n+"/"+Wt(l),value:Ne(f)}),r.push({op:"replace",path:n+"/"+Wt(l),value:Ne(p)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+Wt(l),value:Ne(f)}),r.push({op:"remove",path:n+"/"+Wt(l)}),o=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}))}if(!(!o&&s.length==i.length))for(var c=0;c<s.length;c++){var l=s[c];!Bn(e,l)&&t[l]!==void 0&&r.push({op:"add",path:n+"/"+Wt(l),value:Ne(t[l])})}}}function Gt(e,t,r=!1){var n=[];return eo(e,t,n,"",r),n}({...Xi});var cp=M({LogStreamCallbackHandler:()=>Wn,RunLog:()=>Vn,RunLogPatch:()=>nt,isLogStreamHandler:()=>Ua}),nt=class{ops;constructor(e){this.ops=e.ops??[]}concat(e){let t=this.ops.concat(e.ops),r=pt({},t);return new Vn({ops:t,state:r[r.length-1].newDocument})}},Vn=class Za extends nt{state;constructor(t){super(t),this.state=t.state}concat(t){let r=this.ops.concat(t.ops),n=pt(this.state,t.ops);return new Za({ops:r,state:n[n.length-1].newDocument})}static fromRunLogPatch(t){let r=pt({},t.ops);return new Za({ops:t.ops,state:r[r.length-1].newDocument})}},Ua=e=>e.name==="log_stream_tracer";async function to(e,t){if(t==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:r}=e;if(["retriever","llm","prompt"].includes(e.run_type))return r;if(!(Object.keys(r).length===1&&r?.input===""))return r.input}async function ro(e,t){let{outputs:r}=e;return t==="original"||["retriever","llm","prompt"].includes(e.run_type)?r:r!==void 0&&Object.keys(r).length===1&&r?.output!==void 0?r.output:r}function lu(e){return e!==void 0&&e.message!==void 0}var Wn=class extends kr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;_schemaFormat="original";rootId;keyMapByRunId={};counterMapByRunName={};transformStream;writer;receiveStream;name="log_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=ve.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let t=e.tags??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(r=r||t.find(n=>this.includeTags?.includes(n))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(r=r&&t.every(n=>!this.excludeTags?.includes(n))),r}async*tapOutputIterable(e,t){for await(let r of t){if(e!==this.rootId){let n=this.keyMapByRunId[e];n&&await this.writer.write(new nt({ops:[{op:"add",path:`/logs/${n}/streamed_output/-`,value:r}]}))}yield r}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new nt({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let t=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=t===1?e.name:`${e.name}:${t}`;let r={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(r.inputs=await to(e,this._schemaFormat)),await this.writer.write(new nt({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:r}]}))}async onRunUpdate(e){try{let t=this.keyMapByRunId[e.id];if(t===void 0)return;let r=[];this._schemaFormat==="streaming_events"&&r.push({op:"replace",path:`/logs/${t}/inputs`,value:await to(e,this._schemaFormat)}),r.push({op:"add",path:`/logs/${t}/final_output`,value:await ro(e,this._schemaFormat)}),e.end_time!==void 0&&r.push({op:"add",path:`/logs/${t}/end_time`,value:new Date(e.end_time).toISOString()});let n=new nt({ops:r});await this.writer.write(n)}finally{if(e.id===this.rootId){let t=new nt({ops:[{op:"replace",path:"/final_output",value:await ro(e,this._schemaFormat)}]});await this.writer.write(t),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,t,r){let n=this.keyMapByRunId[e.id];if(n===void 0)return;let a=e.inputs.messages!==void 0,s;a?lu(r?.chunk)?s=r?.chunk:s=new _e({id:`run-${e.id}`,content:t}):s=t;let i=new nt({ops:[{op:"add",path:`/logs/${n}/streamed_output_str/-`,value:t},{op:"add",path:`/logs/${n}/streamed_output/-`,value:s}]});await this.writer.write(i)}};var pp=M({ChatGenerationChunk:()=>Gn,GenerationChunk:()=>mt,RUN_KEY:()=>Jt}),Jt="__run",mt=class no{text;generationInfo;constructor(t){this.text=t.text,this.generationInfo=t.generationInfo}concat(t){return new no({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo}})}},Gn=class ao extends mt{message;constructor(t){super(t),this.message=t.message}concat(t){return new ao({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo},message:this.message.concat(t.message)})}};function Jn({name:e,serialized:t}){return e!==void 0?e:t?.name!==void 0?t.name:t?.id!==void 0&&Array.isArray(t?.id)?t.id[t.id.length-1]:"Unnamed"}var so=e=>e.name==="event_stream_tracer",io=class extends kr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;runInfoMap=new Map;tappedPromises=new Map;transformStream;writer;receiveStream;readableStreamClosed=!1;name="event_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream({flush:()=>{this.readableStreamClosed=!0}}),this.writer=this.transformStream.writable.getWriter(),this.receiveStream=ve.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let t=e.tags??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(r=r||t.find(n=>this.includeTags?.includes(n))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(r=r&&t.every(n=>!this.excludeTags?.includes(n))),r}async*tapOutputIterable(e,t){let r=await t.next();if(r.done)return;let n=this.runInfoMap.get(e);if(n===void 0){yield r.value;return}function a(i,o){return i==="llm"&&typeof o=="string"?new mt({text:o}):o}let s=this.tappedPromises.get(e);if(s===void 0){let i;s=new Promise(o=>{i=o}),this.tappedPromises.set(e,s);try{let o={event:`on_${n.runType}_stream`,run_id:e,name:n.name,tags:n.tags,metadata:n.metadata,data:{}};await this.send({...o,data:{chunk:a(n.runType,r.value)}},n),yield r.value;for await(let c of t)n.runType!=="tool"&&n.runType!=="retriever"&&await this.send({...o,data:{chunk:a(n.runType,c)}},n),yield c}finally{i?.()}}else{yield r.value;for await(let i of t)yield i}}async send(e,t){this.readableStreamClosed||this._includeRun(t)&&await this.writer.write(e)}async sendEndEvent(e,t){let r=this.tappedPromises.get(e.run_id);r!==void 0?r.then(()=>{this.send(e,t)}):await this.send(e,t)}async onLLMStart(e){let t=Jn(e),r=e.inputs.messages!==void 0?"chat_model":"llm",n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:r,inputs:e.inputs};this.runInfoMap.set(e.id,n);let a=`on_${r}_start`;await this.send({event:a,data:{input:e.inputs},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},n)}async onLLMNewToken(e,t,r){let n=this.runInfoMap.get(e.id),a,s;if(n===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(n.runType==="chat_model")s="on_chat_model_stream",r?.chunk===void 0?a=new _e({content:t,id:`run-${e.id}`}):a=r.chunk.message;else if(n.runType==="llm")s="on_llm_stream",r?.chunk===void 0?a=new mt({text:t}):a=r.chunk;else throw new Error(`Unexpected run type ${n.runType}`);await this.send({event:s,data:{chunk:a},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}}async onLLMEnd(e){let t=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let r;if(t===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let n=e.outputs?.generations,a;if(t.runType==="chat_model"){for(let s of n??[]){if(a!==void 0)break;a=s[0]?.message}r="on_chat_model_end"}else if(t.runType==="llm")a={generations:n?.map(s=>s.map(i=>({text:i.text,generationInfo:i.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},r="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${t.runType}`);await this.sendEndEvent({event:r,data:{output:a,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onChainStart(e){let t=Jn(e),r=e.run_type??"chain",n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:e.run_type},a={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(a={},n.inputs={}):e.inputs.input!==void 0?(a.input=e.inputs.input,n.inputs=e.inputs.input):(a.input=e.inputs,n.inputs=e.inputs),this.runInfoMap.set(e.id,n),await this.send({event:`on_${r}_start`,data:a,name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},n)}async onChainEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let r=`on_${e.run_type}_end`,n=e.inputs??t.inputs??{},a={output:e.outputs?.output??e.outputs,input:n};n.input&&Object.keys(n).length===1&&(a.input=n.input,t.inputs=n.input),await this.sendEndEvent({event:r,data:a,run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata??{}},t)}async onToolStart(e){let t=Jn(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,r),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:t,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},r)}async onToolEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let r=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:r,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onToolError(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);await this.sendEndEvent({event:"on_tool_error",data:{input:t.inputs,error:e.error},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onRetrieverStart(e){let t=Jn(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,r),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},r)}async onRetrieverEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async handleCustomEvent(e,t,r){let n=this.runInfoMap.get(r);if(n===void 0)throw new Error(`handleCustomEvent: Run ID ${r} not found in run map.`);await this.send({event:"on_custom_event",run_id:r,name:e,tags:n.tags,metadata:n.metadata,data:t},n)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}};var du=Object.prototype.toString,fu=e=>du.call(e)==="[object Error]",pu=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function oo(e){if(!(e&&fu(e)&&e.name==="TypeError"&&typeof e.message=="string"))return!1;let{message:t,stack:r}=e;return t==="Load failed"?r===void 0||"__sentry_captured__"in e:t.startsWith("error sending request for url")?!0:pu.has(t)}function mu(e){if(typeof e=="number"){if(e<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function qn(e,t,{min:r=0,allowInfinity:n=!1}={}){if(t!==void 0){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected \`${e}\` to be a number${n?" or Infinity":""}.`);if(!n&&!Number.isFinite(t))throw new TypeError(`Expected \`${e}\` to be a finite number.`);if(t<r)throw new TypeError(`Expected \`${e}\` to be \u2265 ${r}.`)}}var hu=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};function gu(e,t){let r=Math.max(1,e+1),n=t.randomize?Math.random()+1:1,a=Math.round(n*t.minTimeout*t.factor**(r-1));return a=Math.min(a,t.maxTimeout),a}function co(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function yu({error:e,attemptNumber:t,retriesConsumed:r,startTime:n,options:a}){let s=e instanceof Error?e:new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(s instanceof hu)throw s.originalError;let i=Number.isFinite(a.retries)?Math.max(0,a.retries-r):a.retries,o=a.maxRetryTime??Number.POSITIVE_INFINITY,c=Object.freeze({error:s,attemptNumber:t,retriesLeft:i,retriesConsumed:r});if(await a.onFailedAttempt(c),co(n,o)<=0)throw s;let l=await a.shouldConsumeRetry(c),f=co(n,o);if(f<=0||i<=0)throw s;if(s instanceof TypeError&&!oo(s)){if(l)throw s;return a.signal?.throwIfAborted(),!1}if(!await a.shouldRetry(c))throw s;if(!l)return a.signal?.throwIfAborted(),!1;let p=gu(r,a),y=typeof s.retryAfterMs=="number"&&s.retryAfterMs>=0?s.retryAfterMs:void 0;y!==void 0&&(p=Math.max(p,y));let h=Math.min(p,f);return h>0&&await new Promise((m,v)=>{let b=()=>{clearTimeout(k),a.signal?.removeEventListener("abort",b),v(a.signal.reason)},k=setTimeout(()=>{a.signal?.removeEventListener("abort",b),m()},h);a.unref&&k.unref?.(),a.signal?.addEventListener("abort",b,{once:!0})}),a.signal?.throwIfAborted(),!0}async function an(e,t={}){if(t={...t},mu(t.retries),Object.hasOwn(t,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=Number.POSITIVE_INFINITY,t.maxRetryTime??=Number.POSITIVE_INFINITY,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,qn("factor",t.factor,{min:0,allowInfinity:!1}),qn("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),qn("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),qn("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let r=0,n=0,a=performance.now();for(;!Number.isFinite(t.retries)||n<=t.retries;){r++;try{t.signal?.throwIfAborted();let s=await e(r);return t.signal?.throwIfAborted(),s}catch(s){await yu({error:s,attemptNumber:r,retriesConsumed:n,startTime:a,options:t})&&n++}}throw new Error("Retry attempts exhausted without throwing an error.")}var Hn=ai(iu(),1),Cp=M({AsyncCaller:()=>ht,classifyRateLimitError:()=>ho,parseRetryAfterMs:()=>mo}),_u=[400,401,402,403,404,405,406,407,409,413],vu=6e4,bu=[/insufficient[_ -]?quota/i,/exceeded (?:your|the current|the available).+quota/i,/usage quota/i,/quota (?:has been )?exhausted/i,/billing/i,/credit balance/i,/out of credits/i,/will reset at/i],wu=/(?:try again in|retry after)\s+(\d+(?:\.\d+)?)\s*(milliseconds?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h)\b/i;function lo(e){return typeof e=="object"&&e!==null&&"response"in e&&typeof e.response=="object"&&e.response!==null&&"status"in e.response&&typeof e.response.status=="number"?e.response.status:void 0}function fo(e){if(!(typeof e!="object"||e===null)){if("status"in e&&typeof e.status=="number")return e.status;if("statusCode"in e&&typeof e.statusCode=="number")return e.statusCode}}function Wa(e){return typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:void 0}function po(e){if(!(typeof e!="object"||e===null))return"code"in e&&typeof e.code=="string"?e.code:"error"in e&&typeof e.error=="object"&&e.error!==null&&"code"in e.error&&typeof e.error.code=="string"?e.error.code:void 0}function ku(e){if(e?.headers)return typeof e.headers.get=="function"?e.headers.get("retry-after"):e.headers["retry-after"]??e.headers["Retry-After"];if(e?.response?.headers)return typeof e.response.headers.get=="function"?e.response.headers.get("retry-after"):e.response.headers["retry-after"]??e.response.headers["Retry-After"]}function xu(e){if(e==null)return;let t=wu.exec(e);if(!t)return;let r=Number(t[1]),n=t[2]?.toLowerCase();if(!(Number.isNaN(r)||!n))return n==="ms"||n.startsWith("millisecond")?r:n==="m"||n.startsWith("min")?r*6e4:n==="h"||n.startsWith("hr")||n.startsWith("hour")?r*36e5:r*1e3}function uo(e,t){if(e instanceof Error)return e;let r=new Error(t);return typeof e=="object"&&e!==null&&Object.assign(r,e),r}function Va(e,t){if(typeof e!="object"||e===null)return;let r=e;r.rateLimitType=t.action,r.rateLimitReason=t.reason,t.retryAfterMs!==void 0&&(r.retryAfterMs=t.retryAfterMs)}function mo(e){if(e==null)return;let t=e.trim();if(!t)return;let r=Number(t);if(!Number.isNaN(r)&&r>=0)return r*1e3;let n=Date.parse(t);if(!Number.isNaN(n)){let a=n-Date.now();return a>0?a:0}}function ho(e){if((lo(e)??fo(e))!==429)return;if(po(e)==="insufficient_quota")return{action:"stop",reason:"insufficient_quota"};let t=Wa(e);if(t&&bu.some(n=>n.test(t)))return{action:"stop",reason:"quota_message"};let r=mo(ku(e))??xu(t);return r!==void 0?r<=vu?{action:"wait",retryAfterMs:r,reason:"retry_after_hint"}:{action:"capacity",retryAfterMs:r,reason:"retry_after_too_large"}:{action:"capacity",reason:"headerless_429"}}var Tu=e=>{if(typeof e!="object"||e===null)return;if(Ai(e)===!1)throw e;if("message"in e&&typeof e.message=="string"&&(e.message.startsWith("Cancel")||e.message.startsWith("AbortError"))||"name"in e&&typeof e.name=="string"&&e.name==="AbortError")throw vr(e,!1);if("code"in e&&typeof e.code=="string"&&e.code==="ECONNABORTED")throw e;let t=lo(e)??fo(e);if(t&&_u.includes(+t))throw vr(e,!1);if(po(e)==="insufficient_quota"){let n=uo(e,Wa(e)??"Insufficient quota");throw n.name="InsufficientQuotaError",Va(n,{action:"stop",reason:"insufficient_quota"}),vr(n,!1)}let r=ho(e);if(r){if(r.action==="wait"){Va(e,r),vr(e,!0);return}let n=uo(e,Wa(e)??"Rate limit exceeded");throw n.name==="Error"&&(n.name=r.action==="stop"?"RateLimitQuotaExhaustedError":"RateLimitCapacityError"),Va(n,r),vr(n,r.action!=="stop")}},ht=class{maxConcurrency;maxRetries;onFailedAttempt;queue;constructor(e){this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??Tu;let t="default"in Hn.default?Hn.default.default:Hn.default;this.queue=new t({concurrency:this.maxConcurrency})}async call(e,...t){return this.callWithRetries(this.maxRetries,e,t)}callWithRetries(e,t,r){return this.queue.add(()=>an(()=>t(...r).catch(n=>{throw n instanceof Error?n:new Error(n)}),{onFailedAttempt:({error:n})=>this.onFailedAttempt?.(n),retries:e,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,t,...r){let n=e.maxRetries??this.maxRetries;if(e.signal){let a;return Promise.race([this.callWithRetries(n,t,r),new Promise((s,i)=>{a=()=>{i(Et(e.signal))},e.signal?.addEventListener("abort",a,{once:!0})})]).finally(()=>{e.signal&&a&&e.signal.removeEventListener("abort",a)})}return this.callWithRetries(n,t,r)}fetch(...e){return this.call(()=>fetch(...e).then(t=>t.ok?t:Promise.reject(t)))}};var Ga=class extends kr{name="RootListenersTracer";rootId;config;argOnStart;argOnEnd;argOnError;constructor({config:e,onStart:t,onEnd:r,onError:n}){super({_awaitHandler:!0}),this.config=e,this.argOnStart=t,this.argOnEnd=r,this.argOnError=n}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&await this.argOnStart(e,this.config))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&await this.argOnError(e,this.config):this.argOnEnd&&await this.argOnEnd(e,this.config))}};function sn(e){return e?e.lc_runnable:!1}var go=class{includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;constructor(e){this.includeNames=e.includeNames,this.includeTypes=e.includeTypes,this.includeTags=e.includeTags,this.excludeNames=e.excludeNames,this.excludeTypes=e.excludeTypes,this.excludeTags=e.excludeTags}includeEvent(e,t){let r=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,n=e.tags??[];return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(t)),this.includeTags!==void 0&&(r=r||n.some(a=>this.includeTags?.includes(a))),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(t)),this.excludeTags!==void 0&&(r=r&&n.every(a=>!this.excludeTags?.includes(a))),r}},yo=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function te(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let r=t._zod;return typeof r=="object"&&r!==null&&"def"in r}function oe(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let r=t._def;return typeof r=="object"&&r!=null&&"typeName"in r}function _o(e){return te(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),oe(e)}function Se(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(te(e)||oe(e))}function Ja(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodLiteral"}function qa(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="literal":!1}function vo(e){return!!(Ja(e)||qa(e))}async function Xn(e,t){if(te(e))try{return{success:!0,data:await $a(e,t)}}catch(r){return{success:!1,error:r}}if(oe(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function Ct(e,t){if(te(e))return await $a(e,t);if(oe(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function bo(e,t){if(te(e))try{return{success:!0,data:jn(e,t)}}catch(r){return{success:!1,error:r}}if(oe(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function wo(e,t){if(te(e))return jn(e,t);if(oe(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Er(e){if(te(e))return Te.get(e)?.description;if(oe(e)||"description"in e&&typeof e.description=="string")return e.description}function ko(e){if(!Se(e))return!1;if(oe(e)){let t=e._def;if(t.typeName==="ZodObject"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(te(e)){let t=e._zod.def;if(t.type==="object"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function Ar(e){return Se(e)?oe(e)?e._def.typeName==="ZodString":te(e)?e._zod.def.type==="string":!1:!1}function on(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodObject"}function $e(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="object":!1}function cn(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="array":!1}function Ha(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="optional":!1}function Ka(e){return te(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="nullable":!1}function xo(e){return!!(on(e)||$e(e))}function Kn(e){if(oe(e))return e.shape;if(te(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function To(e,t){if(oe(e))return e.extend(t);if(te(e))return Ma.extend(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function So(e){if(oe(e))return e.partial();if(te(e))return Ma.partial(Da,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Sr(e,t=!1){if(on(e))return e.strict();if($e(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if($e(i))r[s]=Sr(i,t);else if(cn(i)){let c=i._zod.def.element;$e(c)&&(c=Sr(c,t)),r[s]=rt(i,{...i._zod.def,element:c})}else r[s]=i;let o=Te.get(i);o&&Te.add(r[s],o)}let n=rt(e,{...e._zod.def,shape:r,catchall:qi(Gi)}),a=Te.get(e);return a&&Te.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Yn(e,t=!1){if(on(e))return e.passthrough();if($e(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if($e(i))r[s]=Yn(i,t);else if(cn(i)){let c=i._zod.def.element;$e(c)&&(c=Yn(c,t)),r[s]=rt(i,{...i._zod.def,element:c})}else r[s]=i;let o=Te.get(i);o&&Te.add(r[s],o)}let n=rt(e,{...e._zod.def,shape:r,catchall:Ji(Wi)}),a=Te.get(e);return a&&Te.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Eo(e){if(oe(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(te(e))try{let t=jn(e,void 0);return()=>t}catch{return}}function Su(e){return oe(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function Eu(e){return te(e)&&e._zod.def.type==="pipe"}function qt(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(oe(e))return Su(e)?qt(e._def.schema,t,r):e;if(te(e)){let a=e;if(Eu(e)&&(a=qt(e._zod.def.in,t,r)),t){if($e(a)){let i={};for(let[o,c]of Object.entries(a._zod.def.shape))i[o]=qt(c,t,r);a=rt(a,{...a._zod.def,shape:i})}else if(cn(a)){let i=qt(a._zod.def.element,t,r);a=rt(a,{...a._zod.def,element:i})}else if(Ha(a)){let i=qt(a._zod.def.innerType,t,r);a=rt(a,{...a._zod.def,innerType:i})}else if(Ka(a)){let i=qt(a._zod.def.innerType,t,r);a=rt(a,{...a._zod.def,innerType:i})}}let s=Te.get(e);return s&&Te.add(a,s),r.set(e,a),a}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Qn(e,t=!1){return qt(e,t,new WeakMap)}function Ao(e,t){if(oe(e)){let r=Kn(e),n={};for(let[a,s]of Object.entries(r))t(a,s)?n[a]=s.optional():n[a]=s;return e.extend(n)}if(te(e)){let r=Kn(e),n={...e._zod.def.shape};for(let[i,o]of Object.entries(r))t(i,o)&&(n[i]=new Da({type:"optional",innerType:o}));let a=rt(e,{...e._zod.def,shape:n}),s=Te.get(e);return s&&Te.add(a,s),a}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function ea(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}function Ya(e){return e.replace(/[^a-zA-Z-_0-9]/g,"_")}var Au=["*","_","`"];function Ou(e){let t="";for(let[r,n]of Object.entries(e))t+=` classDef ${r} ${n};
|
|
4
4
|
`;return t}function Oo(e,t,r){let{firstNode:n,lastNode:a,nodeColors:s,withStyles:i=!0,curveStyle:o="linear",wrapLabelNWords:c=9}=r??{},l=i?`%%{init: {'flowchart': {'curve': '${o}'}}}%%
|
|
5
5
|
graph TD;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import d from"./ODSA6NNS.js";import"./PKA745KL.js";import c from"./TIMYD2HM.js";import b from"./TIPQ2ZWK.js";import"./MLTZSPZQ.js";import a from"./OQ2JULON.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,a])=>{return a},a,b,c,d)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{K as n,Q as c,j as d,v as a}from"./
|
|
2
|
+
import{K as n,Q as c,j as d,v as a}from"./HHGKNVCH.js";var i=class extends n{constructor(){super(...arguments),this.cardProps={},this.arcgisGroupCardSelect=a(),this.arcgisGroupBrowserCardPreview=a()}static{this.properties={group:0,browser:0,cardProps:0}}async restoreFocus(){await this.renderRoot.querySelector("arcgis-portal-group-card")?.restoreFocus?.()}getBrowser(){let r=this.el.closest("arcgis-portal-group-browser");return this.browser??r}isSelected(r,t){if(!r)return!1;let e=t.selectedGroupsState;return Array.isArray(e)&&e.some(({id:o})=>o===r)}render(){let r=this.getBrowser(),t=this.group;if(!r||!t)return;let e=this.cardProps,o=r.store.view??"list";return d`<arcgis-portal-group-card .portal=${r.portal} .group=${t} .user=${e.user} .indeterminate=${e.indeterminate} .view=${o} .selection=${r.selection} .selected=${e.selected??this.isSelected(t.id,r)} .preview=${e.preview??r.preview} .previewed=${e.previewed??r.previewedGroupId===t.id} .name=${e.name} .showSummary=${e.showSummary??!0} .hideBadges=${e.hideBadges??!1} .hideDateUpdated=${e.hideDateUpdated??!1} .showDateCreated=${e.showDateCreated??!1} .hideViewableBy=${e.hideViewableBy??!1} .hideOwner=${e.hideOwner??!1} .link=${e.link} .linkHandler=${e.linkHandler} .newTab=${e.newTab??!1} .disabled=${e.disabled??!1} @arcgisGroupCardSelect=${s=>{s.stopPropagation(),this.arcgisGroupCardSelect.emit(s.detail)}} @arcgisGroupBrowserCardPreview=${s=>{s.stopPropagation(),this.arcgisGroupBrowserCardPreview.emit(s.detail)}}><slot name=content-top slot=content-top></slot><div slot=content-end><slot name=content-end></slot></div><slot name=actions-start slot=actions-start></slot><slot name=actions-end slot=actions-end></slot></arcgis-portal-group-card>`}};c("arcgis-portal-group-browser-card",i);export{i as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{A as s,B as i,E as o,m as r}from"./
|
|
2
|
+
import{A as s,B as i,E as o,m as r}from"./HHGKNVCH.js";var u=s(class extends i{constructor(){super(...arguments),this.key=r}render(t,e){return this.key=t,e}update(t,[e,m]){return e!==this.key&&(o(t),this.key=e),m}});export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{c as f}from"./
|
|
2
|
+
import{c as f}from"./F2HT5PVQ.js";import{a as g}from"./4KTRAA2J.js";import{b as _}from"./KV4ZZSNW.js";import{I as d,J as n,K as w,L as p,N as o,Q as u,h as v,j as r,v as l}from"./HHGKNVCH.js";export default $arcgis.t(([{formatDate:y}])=>{var $=v`:host{display:block;min-width:0;container-type:inline-size}.preview-card{position:relative;display:flex;width:100%;height:100%;flex-direction:column;color:var(--calcite-color-text-1);opacity:0;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-border-3);transition:background-color .15s ease-in-out,opacity .15s ease-in-out}.preview-card--loaded{opacity:1}.preview-card--hoverable{cursor:pointer}.preview-card--hoverable .preview-card__upper:hover{background-color:var(--calcite-color-background)}.preview-card__upper{display:flex;align-items:stretch;min-width:0;flex:1 1 auto;padding:.75rem;background-color:var(--calcite-color-foreground-1)}.preview-card__upper--link{color:var(--calcite-color-text-1);text-decoration:none}.preview-card__top{display:flex;align-self:stretch;flex:0 0 auto}.preview-card__thumbnail{box-sizing:border-box;display:grid;place-items:center;width:4rem;height:100%;margin:0;margin-inline-start:.75rem;border-radius:2px;overflow:hidden;background-color:var(--calcite-color-foreground-2)}.preview-card__thumbnail-image{width:100%;height:100%;object-fit:cover}.preview-card__thumbnail--fallback{color:var(--calcite-color-text-3)}.preview-card__content{min-width:0;flex:1 1 auto}.preview-card__body{display:grid;min-width:0;gap:.25rem}.preview-card__title{margin:0;height:2rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);line-height:1.15;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}.preview-card__title--padded{margin-bottom:.125rem}.preview-card__title-span{position:relative}.preview-card__summary{color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--2);line-height:1.35;margin:0;overflow:hidden;text-overflow:ellipsis}.preview-card__details{align-items:center;display:flex;flex-wrap:wrap;gap:.25rem}.preview-card__detail,.preview-card__meta{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--2);margin:0}.preview-card__meta{color:var(--calcite-color-text-2)}.preview-card__status{--calcite-chip-background-color: var(--calcite-color-foreground-2);text-transform:capitalize}.preview-card__divider{align-items:center;display:flex;flex:0 0 auto}.preview-card__divider:before{content:"";height:1rem;width:1px;margin-inline-end:.5rem;background-color:var(--calcite-color-border-2)}.preview-card__details :first-child.preview-card__divider:before{display:none}.preview-card__footer{align-items:center;border-top:1px solid var(--calcite-color-border-2);display:flex;margin-top:auto;min-height:2.25rem;padding:.375rem .75rem}.preview-card__footer-start{align-items:center;display:flex;flex:1 1 auto;min-width:0}.preview-card__owner{min-width:0}@container (max-width: 480px){.preview-card__upper{padding:.625rem}.preview-card__thumbnail{width:3.5rem;margin-inline-start:.5rem}.preview-card__footer{padding:.25rem .625rem}}`,h=class extends w{constructor(){super(...arguments),this.sectionEl=d(),this.linkEl=d(),this.cachedOwner="",this.cachedStatus="",this.cachedTitle="-",this.cachedType="-",this.cachedSummary="",this.cachedUpdatedText="",this.cachedThumbnailUri=null,this.handleCardClick=()=>{let{link:e,item:t}=this;e||this.arcgisGroupBrowserPreviewCardSelect.emit(t)},this.isLoaded=!1,this.imageError=!1,this.newTab=!1,this.hideThumbnail=!1,this.hideOwner=!1,this.hideItemType=!1,this.showDateUpdated=!1,this.showSummary=!1,this.showBadges=!1,this.showOwnerPopup=!1,this.interactive=!1,this.arcgisGroupBrowserInternalUIAction=l(),this.arcgisGroupBrowserPreviewCardSelect=l()}static{this.properties={isLoaded:16,imageError:16,item:0,portal:0,user:0,baseUrl:1,link:1,newTab:5,hideThumbnail:5,hideOwner:5,hideItemType:5,showDateUpdated:5,showSummary:5,showBadges:5,showOwnerPopup:5,interactive:5}}static{this.styles=$}async restoreFocus(){if(this.link&&this.linkEl.value){this.linkEl.value.focus();return}this.sectionEl.value?.focus()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this.isLoaded=!0})}willUpdate(e){(e.has("item")||e.has("portal")||e.has("showSummary")||e.has("showDateUpdated"))&&(this.imageError=!1,this.updateCachedItemData())}get resolvedBaseUrl(){if(!this.portal)return"";let e=_({portal:this.portal});return this.baseUrl||`${e}/home`}getItemThumbnailUri(e){return e.thumbnailUrl?e.thumbnailUrl:this.portal?f(this.portal,e):null}updateCachedItemData(){let{item:e,showSummary:t,showDateUpdated:s}=this,i=g(e),a=i.snippet?.trim()||"";this.cachedOwner=i.owner||"",this.cachedStatus=i.contentStatus||"",this.cachedTitle=i.title?.trim()||e.title?.trim()||"-",this.cachedType=i.type?.trim()||"-",this.cachedSummary=t?a.length>250?`${a.slice(0,250)}...`:a:"",this.cachedUpdatedText=s?y(i.modified??e.modified,{dateStyle:"medium"}):"",this.cachedThumbnailUri=this.getItemThumbnailUri(e)}renderStatusBadge(){let e=this.cachedStatus;return!this.showBadges||!e?null:r`<calcite-chip class="preview-card__status" scale=s .value=${e} .label=${e}>${e}</calcite-chip>`}renderThumbnail(){if(this.hideThumbnail)return null;let e=this.cachedThumbnailUri;return e&&!this.imageError?r`<figure class="preview-card__thumbnail"><img class="preview-card__thumbnail-image" src=${e??o} alt @error=${()=>{this.imageError=!0}}></figure>`:r`<figure class="preview-card__thumbnail preview-card__thumbnail--fallback" aria-hidden=true><calcite-icon icon=file scale=m></calcite-icon></figure>`}renderOwner(){let e=this.cachedOwner;return this.hideOwner||!e||!this.portal?null:this.showOwnerPopup?r`<arcgis-portal-user-popup underline .username=${e} .portal=${this.portal} .baseUrl=${this.resolvedBaseUrl} class="preview-card__owner" scale=s @arcgisUserPopupInternalUIAction=${t=>{t.stopPropagation(),this.arcgisGroupBrowserInternalUIAction.emit(t.detail)}}></arcgis-portal-user-popup>`:r`<arcgis-portal-user-avatar scale=s show-name hide-avatar .username=${e} .portal=${this.portal} class="preview-card__owner"></arcgis-portal-user-avatar>`}renderBody(e){let{showSummary:t,showDateUpdated:s}=this,i=!this.hideItemType,a=this.cachedTitle,b=this.cachedType,c=this.cachedSummary,m=this.cachedUpdatedText;return r`<div class="preview-card__body"><h3 class=${p({"preview-card__title":!0,"preview-card__title--padded":i||t&&!!c})}><span class="preview-card__title-span">${a}</span></h3>${t&&c?r`<p class="preview-card__summary">${c}</p>`:null}${i?r`<arcgis-portal-item-type scale=s .item=${e} .portal=${this.portal} .user=${this.user}></arcgis-portal-item-type>`:null}<div class="preview-card__details">${s&&m?r`<span class="preview-card__detail preview-card__divider">${m}</span>`:null}${this.renderStatusBadge()}${i?null:r`<p class="preview-card__meta">${b}</p>`}</div></div>`}render(){let{item:e,interactive:t,link:s,newTab:i}=this;return r`<section class=${p({"preview-card":!0,"preview-card--hoverable":t,"preview-card--loaded":this.isLoaded})} .part=${"card"} tabindex=${(t?0:void 0)??o} @click=${s?void 0:this.handleCardClick} ${n(this.sectionEl)}><slot name=content-top></slot>${s?r`<a class="preview-card__upper preview-card__upper--link" href=${s??o} target=${(i?"_blank":void 0)??o} rel=${(i?"noopener noreferrer":void 0)??o} ${n(this.linkEl)}>${r`<div class="preview-card__content">${this.renderBody(e)}</div><div class="preview-card__top">${this.renderThumbnail()}</div>`}</a>`:r`<div class="preview-card__upper"><div class="preview-card__content">${this.renderBody(e)}</div><div class="preview-card__top">${this.renderThumbnail()}</div></div>`}<div class="preview-card__footer" @click=${a=>{a.stopPropagation()}} @keydown=${a=>{(a.key==="Enter"||a.key===" ")&&a.stopPropagation()}}><div class="preview-card__footer-start">${this.renderOwner()}</div><slot name=actions-end></slot></div></section>`}};u("arcgis-portal-group-browser-preview-card",h);return h},"intl")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{i as o}from"./
|
|
2
|
+
import{i as o}from"./HHGKNVCH.js";var c={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,r=l}if(this.p===i){if(s===n)this.i=0;else{if(a===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!o(s,t[r])));export{c as a,e as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{e as f}from"./VDXESPJK.js";import{a as g}from"./ULGME5RT.js";import{a as m}from"./
|
|
2
|
+
import{e as f}from"./VDXESPJK.js";import{a as g}from"./ULGME5RT.js";import{a as m}from"./2XJX2JUO.js";import{a as b}from"./5R4JJWGB.js";import{K as p,Q as u,h,j as i,v as r}from"./HHGKNVCH.js";var w=h`:host{display:flex;align-items:center}.status-list{display:flex;align-items:center;max-width:100%}.status-chip{max-width:100%;--calcite-color-foreground-2: var(--calcite-color-foreground-1)}.chip-group{max-width:100%;min-width:0}.status-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.popover-content{max-width:28rem;padding:.75rem}.clear-button{margin-inline-start:.25rem}`,o=class extends p{constructor(){super(...arguments),this._messages=b({name:"portal-browser",blocking:!0}),this.inBounds=[],this.outOfBounds=[],this.filters={},this.hiddenFilterIds=[],this.arcgisBrowserFilterClear=r(),this.arcgisBrowserFilterRemove=r()}static{this.properties={inBounds:16,outOfBounds:16,filters:0,hiddenFilterIds:0,componentWidth:9,browserWidth:9}}static{this.styles=w}connectedCallback(){super.connectedCallback(),this.processValidFilters()}willUpdate(t){(t.has("filters")||t.has("hiddenFilterIds")||t.has("componentWidth")||t.has("browserWidth"))&&this.processValidFilters()}isFilterValid(t){return this.hiddenFilterIds.includes(t.id)?!1:t.id==="collaborations"&&"additionalParams"in t?!!(t.additionalParams&&t.label):!!(t.value&&t.label)}processValidFilters(){let t=Object.values(this.filters).filter(this.isFilterValid.bind(this)),e=this.componentWidth??0;if((this.browserWidth??e??window.innerWidth)<g.sm){this.inBounds=t,this.outOfBounds=[];return}let a=Math.max(e-460,0),s=0,n=[],c=[];t.forEach(l=>{let d=f({text:l.label});!e||s+d<=a?(n.push(l),s+=d):c.push(l)}),this.inBounds=n,this.outOfBounds=c}renderChip(t){return m(t.id,i`<calcite-chip class="status-chip" scale=s .label=${t.label} .value=${t.id} closable appearance=outline @calciteChipClose=${()=>{this.arcgisBrowserFilterRemove.emit(t.id)}}><span class="status-chip__label">${t.label}</span></calcite-chip>`)}render(){let t=this._messages.filterStatus,e=this.outOfBounds.length>0,a=this.inBounds.length+this.outOfBounds.length;return a?i`<div class="status-list"><calcite-chip-group class="chip-group" .label=${t.filters} scale=s>${this.inBounds.map(s=>this.renderChip(s))}${e&&i`<calcite-button id=popover-button round kind=neutral appearance=outline scale=s>+ ${this.outOfBounds.length}</calcite-button>`||""}</calcite-chip-group>${e&&i`<calcite-popover .label=${t.additional} reference-element=popover-button placement=bottom-end><div class="popover-content"><calcite-chip-group .label=${t.additional} scale=s>${this.outOfBounds.map(s=>this.renderChip(s))}</calcite-chip-group></div></calcite-popover>`||""}${a>1&&i`<calcite-button class="clear-button" scale=s appearance=transparent kind=brand @click=${()=>this.arcgisBrowserFilterClear.emit(null)}>${t.clearAllFilters}</calcite-button>`||""}</div>`:null}};u("arcgis-portal-browser-filter-status",o);export{o as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as r}from"./
|
|
2
|
+
import{a as r}from"./US3N5L73.js";import{a as n}from"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import{I as i,J as a,K as o,Q as l,j as e,v as c}from"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([{substitute:p}])=>{var s=class extends o{constructor(){super(...arguments),this.messages=n({blocking:!0,name:"portal-account-switcher"}),this.dialogRef=i(),this.accounts=[],this.arcgisAccountsLinkAll=c(),this.arcgisAccountsCloseDialog=c()}static{this.properties={portal:0,targetUser:1,accounts:0}}static{this.styles=r}render(){let{messages:t,portal:u,accounts:g,targetUser:m}=this;return e`<calcite-dialog open modal width=s .heading=${t.linkTitle} heading-level=2 outside-close-disabled @calciteDialogClose=${()=>this.arcgisAccountsCloseDialog.emit()} ${a(this.dialogRef)}><calcite-block .heading=${p(t.linkWarning,{targetUser:m})} expanded class="linked-accounts-block"><arcgis-portal-account-switcher-list .portal=${u} .linkedAccounts=${g}></arcgis-portal-account-switcher-list></calcite-block><calcite-button slot=footer-end appearance=outline @click=${()=>{this.dialogRef.value.open=!1}}>${t.cancel}</calcite-button><calcite-button slot=footer-end kind=brand @click=${()=>{this.arcgisAccountsLinkAll.emit(),this.dialogRef.value.open=!1}}>${t.linkAll}</calcite-button></calcite-dialog>`}};l("arcgis-portal-account-switcher-accounts",s);return s},"intl")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import a from"./IAK4F5SX.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import{c as F}from"./FN2QMDEW.js";import{a as O}from"./AYHYABMC.js";import"./OQ3OHDEB.js";import"./I57CRKF7.js";import{K as _,Q as q,h as f,j as y,v as h}from"./3ZC26CT6.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([C,L,T,{b:g}])=>{var w=f`:host{background-color:var(--calcite-color-foreground-1)}.scrim-container{position:relative}.base-fields-control{margin-inline-end:.75rem}.added{display:inline-flex;gap:.5rem;flex-shrink:0;white-space:nowrap}.added calcite-icon{color:var(--calcite-color-status-success)}.add-fields-button{margin:.75rem 0}calcite-block{border-bottom:0}calcite-list-item:last-child:after{display:block;margin-inline-start:var(--calcite-spacing-md);border-block-end:1px solid var(--calcite-list-border-color, var(--calcite-color-border-3));content:""}`;async function P({item:t,layers:e}){let{url:a}=t,l=new Map;if(!a)return{result:l};try{let s=(await T(a,{cacheBust:!0,query:{f:"json"},responseType:"json"})).data;if(s.fields){let n=e?.[0];return e?.length===1&&n?.layerId!=null&&l.set(n.layerId,s.fields),{result:l}}if(!s.layers?.length)return{result:l};let i=a.replace(/\/$/u,"");return await Promise.all(s.layers.map(async({id:n})=>{let d=(await T(`${i}/${n}`,{cacheBust:!0,query:{f:"json"},responseType:"json"})).data;l.set(n,d.fields??[])})),{result:l}}catch(s){return console.error("Error getting layer fields:",s),{error:{code:"unhandledError"}}}}var I=t=>{let{url:e}=t;return e?e.replace("/rest/services","/rest/admin/services").replace(/\/$/u,""):null};async function z({fields:t,item:e,portal:a,layerId:l}){let s=I(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await g({url:`${s}/${l!=null?`${l}/`:""}addToDefinition`,portal:a,method:"post",params:{addToDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message}}:{result:i}}catch(i){return console.error("Error adding fields to the feature service definition:",i),{error:{code:"unhandledError"}}}}async function A({fields:t,item:e,portal:a,layerId:l}){let s=I(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await g({url:`${s}/${l!=null?`${l}/`:""}updateDefinition`,portal:a,method:"post",params:{updateDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message??"Failed to update the feature service definition."}}:{result:i}}catch(i){return console.error("Error updating the feature service definition:",i),{error:{code:"unhandledError"}}}}async function x(t){let{url:e}=t;if(!e)return{error:{code:"unhandledError"}};try{return{result:(await T(e,{query:{f:"json"}})).data}}catch(a){return console.error("Error getting service info:",a),{error:{code:"unhandledError"}}}}var G=(t,e)=>{let a=t.domain??null,l=e.domain??null;return a===null||l===null?a===l:a.type!==l.type?!1:a.type==="codedValue"&&l.type==="codedValue"?a.codedValues.length===l.codedValues.length&&a.codedValues.every(({code:s,name:i},n)=>s===l.codedValues[n]?.code&&i===l.codedValues[n]?.name):a.type==="range"&&l.type==="range"?a.range[0]===l.range[0]&&a.range[1]===l.range[1]:!0},R=(t,e)=>{let a=new Map(e.map(i=>[i.name,i])),l=[],s=[];for(let i of t){let n=a.get(i.name);n?G(i,n)||s.push({name:i.name,domain:i.domain}):l.push(i)}return{missingFields:l,modifiedFields:s}},E=t=>{switch(t){case"esriGeometryPolyline":case"esriGeometryPolygon":return[...M];case"esriGeometryPoint":return[...N];default:return[]}},V=t=>t==="esriGeometryPoint"?[...k]:[],D=t=>t==="esriGeometryPoint"?[...$]:[],M=[{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_h_rms",type:"esriFieldTypeDouble",alias:"Worst horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_v_rms",type:"esriFieldTypeDouble",alias:"Worst vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_fixtype",type:"esriFieldTypeSmallInteger",alias:"Worst fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_manual_locations",type:"esriFieldTypeInteger",alias:"Number of manual locations",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],N=[{name:"esrignss_speed",type:"esriFieldTypeDouble",alias:"Speed (km/h)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_direction",type:"esriFieldTypeDouble",alias:"Direction of travel (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_azimuth",type:"esriFieldTypeDouble",alias:"Compass reading (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_positionsourcetype",type:"esriFieldTypeInteger",alias:"Position source type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_POSITIONSOURCETYPE_DOMAIN",codedValues:[{name:"Unknown",code:0},{name:"User defined",code:1},{name:"Integrated (System) Location Provider",code:2},{name:"External GNSS Receiver",code:3},{name:"Network Location Provider",code:4},{name:"Snapped",code:5}]},defaultValue:null},{name:"esrignss_receiver",type:"esriFieldTypeString",alias:"Receiver name",sqlType:"sqlTypeOther",length:50,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_rms",type:"esriFieldTypeDouble",alias:"Horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_v_rms",type:"esriFieldTypeDouble",alias:"Vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_latitude",type:"esriFieldTypeDouble",alias:"Latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_longitude",type:"esriFieldTypeDouble",alias:"Longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_altitude",type:"esriFieldTypeDouble",alias:"Ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_pdop",type:"esriFieldTypeDouble",alias:"PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_hdop",type:"esriFieldTypeDouble",alias:"HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_vdop",type:"esriFieldTypeDouble",alias:"VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_fixtype",type:"esriFieldTypeSmallInteger",alias:"Fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_correctionage",type:"esriFieldTypeDouble",alias:"Correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_stationid",type:"esriFieldTypeSmallInteger",alias:"Station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_numsats",type:"esriFieldTypeSmallInteger",alias:"Number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"range",name:"ESRI_NUM_SATS_DOMAIN",range:[0,99]},defaultValue:null},{name:"esrignss_fixdatetime",type:"esriFieldTypeDate",alias:"Fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_positions",type:"esriFieldTypeInteger",alias:"Averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_stddev",type:"esriFieldTypeDouble",alias:"Standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_name",type:"esriFieldTypeString",alias:"Correction source name",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_type",type:"esriFieldTypeString",alias:"Correction source type",sqlType:"sqlTypeOther",length:25,nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_correction_source_domain",codedValues:[{name:"Unknown",code:"Unknown"},{name:"Direct IP",code:"Direct IP"},{name:"NTRIP",code:"NTRIP"},{name:"PPP",code:"PPP"},{name:"Radio",code:"Radio"},{name:"SBAS",code:"SBAS"}]},defaultValue:null},{name:"esrignss_custom_attributes",type:"esriFieldTypeString",alias:"GNSS custom attributes",sqlType:"sqlTypeOther",length:2e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_95_status",type:"esriFieldTypeSmallInteger",alias:"95% accuracy applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_ntrip_mount_point",type:"esriFieldTypeString",alias:"NTRIP mount point",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_antenna_height",type:"esriFieldTypeDouble",alias:"GNSS antenna height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_orthometric_height",type:"esriFieldTypeDouble",alias:"Orthometric height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_profile_has_hor_xform",type:"esriFieldTypeSmallInteger",alias:"Location profile horizontal datum transformation applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_profile_hor_xform",type:"esriFieldTypeString",alias:"Location profile horizontal datum transformation",sqlType:"sqlTypeOther",length:255,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs",type:"esriFieldTypeString",alias:"Geographic coordinate system",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs_wkid",type:"esriFieldTypeInteger",alias:"Geographic coordinate system WKID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_geoid",type:"esriFieldTypeString",alias:"Receiver geoid model",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_ref_epoch",type:"esriFieldTypeDouble",alias:"Reference epoch",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],k=[{name:"esrisnsr_tilt_azimuth_accuracy",type:"esriFieldTypeDouble",alias:"Tilt azimuth accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_azimuth",type:"esriFieldTypeDouble",alias:"Tilt azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle_accuracy",type:"esriFieldTypeDouble",alias:"Tilt angle accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle",type:"esriFieldTypeDouble",alias:"Tilt angle (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_tilt_compensated",type:"esriFieldTypeSmallInteger",alias:"Tilt compensated",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null}],$=[{name:"esrignss_cp1_latitude",type:"esriFieldTypeDouble",alias:"CP1 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_longitude",type:"esriFieldTypeDouble",alias:"CP1 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_altitude",type:"esriFieldTypeDouble",alias:"CP1 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_rms",type:"esriFieldTypeDouble",alias:"CP1 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_v_rms",type:"esriFieldTypeDouble",alias:"CP1 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixdatetime",type:"esriFieldTypeDate",alias:"CP1 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP1 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp1_corr_age",type:"esriFieldTypeDouble",alias:"CP1 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_stationid",type:"esriFieldTypeSmallInteger",alias:"CP1 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_numsats",type:"esriFieldTypeSmallInteger",alias:"CP1 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_pdop",type:"esriFieldTypeDouble",alias:"CP1 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_hdop",type:"esriFieldTypeDouble",alias:"CP1 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_vdop",type:"esriFieldTypeDouble",alias:"CP1 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP1 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP1 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_positions",type:"esriFieldTypeInteger",alias:"CP1 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_stddev",type:"esriFieldTypeDouble",alias:"CP1 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_slope_dist",type:"esriFieldTypeDouble",alias:"CP1 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_inclination",type:"esriFieldTypeDouble",alias:"CP1 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_azimuth",type:"esriFieldTypeDouble",alias:"CP1 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_latitude",type:"esriFieldTypeDouble",alias:"CP2 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_longitude",type:"esriFieldTypeDouble",alias:"CP2 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_altitude",type:"esriFieldTypeDouble",alias:"CP2 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_rms",type:"esriFieldTypeDouble",alias:"CP2 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_v_rms",type:"esriFieldTypeDouble",alias:"CP2 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixdatetime",type:"esriFieldTypeDate",alias:"CP2 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP2 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp2_corr_age",type:"esriFieldTypeDouble",alias:"CP2 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_stationid",type:"esriFieldTypeSmallInteger",alias:"CP2 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_numsats",type:"esriFieldTypeSmallInteger",alias:"CP2 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_pdop",type:"esriFieldTypeDouble",alias:"CP2 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_hdop",type:"esriFieldTypeDouble",alias:"CP2 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_vdop",type:"esriFieldTypeDouble",alias:"CP2 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP2 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP2 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_positions",type:"esriFieldTypeInteger",alias:"CP2 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_stddev",type:"esriFieldTypeDouble",alias:"CP2 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_slope_dist",type:"esriFieldTypeDouble",alias:"CP2 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_inclination",type:"esriFieldTypeDouble",alias:"CP2 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_azimuth",type:"esriFieldTypeDouble",alias:"CP2 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_method",type:"esriFieldTypeString",alias:"Offset method",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_OFFSET_METHOD_DOMAIN",codedValues:[{name:"Azimuth-Azimuth",code:"azimuth-azimuth"},{name:"Distance-Angle",code:"distance-angle"},{name:"Distance-Azimuth",code:"distance-azimuth"},{name:"Distance-Distance",code:"distance-distance"},{name:"Azimuth-Azimuth-Backsight",code:"azimuth-azimuth-backsight"},{name:"Distance-Azimuth-Backsight",code:"distance-azimuth-backsight"},{name:"Distance-Distance-Backsight",code:"distance-distance-backsight"},{name:"User-defined",code:"user-defined"}]},defaultValue:null},{name:"esrisnsr_offset_device",type:"esriFieldTypeString",alias:"Rangefinder name",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_height",type:"esriFieldTypeDouble",alias:"Rangefinder height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_target_ht",type:"esriFieldTypeDouble",alias:"Laser target height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_mag_var",type:"esriFieldTypeDouble",alias:"Rangefinder magnetic variation (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}];function B(t){if(t.geometryType==="polyline"||t.geometryType==="polygon"){let e=t.capabilities;return e?.data?.supportsAttachment&&e?.operations?.supportsQueryAttachments}return!0}var U=t=>t.every(B),K=["point","polyline","polygon"],S=t=>t?.type==="Feature Service",b=class extends _{constructor(){super(...arguments),this.messages=O({blocking:!0}),this.initCount=0,this.supportsAttachments=!1,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.loadedItem=null,this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.initializing=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1,this.addingGPSFieldMetadata=[],this.item=null,this.itemId=null,this.messageOverrides={},this.arcgisGPSMetadataFieldsAdded=h(),this.arcgisReadOnlyMode=h()}static{this.properties={loadedItem:16,gpsFieldFixesBySet:16,addFieldsDisabled:16,initializing:16,hasLineOrPolygonLayer:16,hasPointFeatureLayer:16,addingGPSFieldMetadata:16,item:0,itemId:1,portal:0,messageOverrides:0}}static{this.styles=w}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.initItem()}willUpdate(e){(e.has("item")||e.has("itemId"))&&this.initItem()}async initItem({showLoading:e=!0}={}){let a=++this.initCount;if(!this.item&&!this.itemId){this.resetItemState(),this.initializing=!1;return}e&&(this.resetItemState(),this.initializing=!0);let{item:l,itemId:s,portal:i}=this,n=l?await l.load():await new L({id:s,portal:i}).load();if(!this.isCurrentInitialization(a))return;if(!S(n)){this.resetItemState(),this.initializing=!1;return}this.loadedItem=n;let d=!e&&this.layersLoaded?[...this.pointLayers,...this.lineOrPolygonLayers]:await this.getFeatureLayers(n),{result:m}=await x(n);if(!this.isCurrentInitialization(a))return;this.layersLoaded=!0,this.pointLayers=d.filter(o=>o.geometryType==="point"),this.lineOrPolygonLayers=d.filter(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasLineOrPolygonLayer=d.some(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasPointFeatureLayer=d.some(o=>o.geometryType==="point");let{result:u,error:c}=d.length>0?await P({item:n,layers:d}):{};if(!this.isCurrentInitialization(a))return;if(c){this.resetItemState(),this.initializing=!1;return}let r=u??new Map;this.gpsFieldFixesBySet={base:this.analyzeFieldSet([...this.pointLayers,...this.lineOrPolygonLayers],r,"base"),gnss:this.analyzeFieldSet(this.pointLayers,r,"gnss"),rangefinder:this.analyzeFieldSet(this.pointLayers,r,"rangefinder")},this.supportsAttachments=U(d);let p=m?.sourceSchemaChangesAllowed!==!1;this.addFieldsDisabled=!this.supportsAttachments||!p,this.initializing=!1}isCurrentInitialization(e){return e===this.initCount}resetItemState(){this.loadedItem=null,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1}async getFeatureLayers(e){let a=await C.fromPortalItem({portalItem:e});return await a.load(),"layers"in a?(await Promise.all(a.layers.map(async l=>(await l.load(),this.isSupportedFeatureLayer(l)?l:null)))).filter(l=>!!l):this.isSupportedFeatureLayer(a)?[a]:[]}isSupportedFeatureLayer(e){return e.type==="feature"&&K.some(a=>a===e.geometryType)}getCompatibleEsriGeometryType(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";default:return null}}analyzeFieldSet(e,a,l){let s=[];for(let i of e){if(i.layerId==null)continue;let n=a.get(i.layerId)??[],d=this.getCompatibleEsriGeometryType(i),m=d?l==="base"?E(d):l==="gnss"?V(d):D(d):[],u=R(m,n);(u.missingFields.length>0||u.modifiedFields.length>0)&&s.push({layerId:i.layerId,fieldsToAdd:u.missingFields,domainsToUpdate:u.modifiedFields})}return s}hasFieldChanges(e){return(this.gpsFieldFixesBySet?.[e].length??0)>0}isLoading(e){return this.addingGPSFieldMetadata.includes(e)}async addFields(e){let a=this.portal??this.loadedItem?.portal,l=this.loadedItem,s=this.gpsFieldFixesBySet;if(!a||!l||!s)return;if(a.isReadOnly){this.arcgisReadOnlyMode.emit();return}this.addingGPSFieldMetadata=[...this.addingGPSFieldMetadata,e];let i=[...this.pointLayers,...this.lineOrPolygonLayers];try{let n=s[e],d=(await Promise.all(n.filter(({fieldsToAdd:r})=>r.length>0).map(async({fieldsToAdd:r,layerId:p})=>await z({fields:r,item:l,layerId:p,portal:a})))).every(({error:r})=>!r),m=d?await Promise.all(n.filter(({domainsToUpdate:r})=>r.length>0).map(async({domainsToUpdate:r,layerId:p})=>await A({fields:r,item:l,layerId:p,portal:a}))):[],u=d&&m.every(({error:r})=>!r);if(!u||this.loadedItem!==l)return;let c;if(await F(async()=>{if(this.loadedItem!==l)return!0;let{result:r,error:p}=await P({item:l,layers:i});if(p||this.loadedItem!==l)return!0;if(!r)return!1;let o=e==="base"?i:i.filter(v=>v.geometryType==="point");return this.analyzeFieldSet(o,r,e).length>0?!1:(c=r,!0)},10)||console.warn("Fields were not verified on the service.",{itemId:l.id,fieldSet:e}),!c||this.loadedItem!==l)return;await this.initItem({showLoading:!1}),d&&u&&this.gpsFieldFixesBySet&&!this.hasFieldChanges(e)&&this.arcgisGPSMetadataFieldsAdded.emit(e)}finally{this.addingGPSFieldMetadata=this.addingGPSFieldMetadata.filter(n=>n!==e)}}canShowAddGPSMetadata(){let e=this.loadedItem??this.item;return!!e&&S(e)}showAdvancedFields(){let e=this.gpsFieldFixesBySet;return!this.hasPointFeatureLayer||!e?!1:this.hasFieldChanges("base")?this.pointLayers.some(a=>a.layerId==null?!1:["gnss","rangefinder"].some(l=>{let s=l==="gnss"?V("esriGeometryPoint"):D("esriGeometryPoint");return(e[l].find(({layerId:i})=>i===a.layerId)?.fieldsToAdd??[]).length<s.length})):!0}renderAddFieldsControl(e,a=!1){let l=this.gpsFieldFixesBySet;if(!a&&l&&!this.hasFieldChanges(e))return y`<span slot=actions-end class="added"><calcite-icon icon=check-circle scale=s aria-hidden></calcite-icon>${this.messages.added}</span>`;let s=this.isLoading(e);return y`<calcite-button slot=actions-end class="add-fields-button" appearance=outline-fill .disabled=${a||!l||s||this.addFieldsDisabled} .loading=${s} @click=${async()=>await this.addFields(e)}>${s?this.messages.addingFields:this.messages.addFields}</calcite-button>`}render(){return this.canShowAddGPSMetadata()?y`<div class="scrim-container"><calcite-block scale=m expanded>${this.initializing&&y`<calcite-scrim loading></calcite-scrim>`||""}<calcite-list .label=${this.messages.gpsOptions} selection-mode=none><calcite-list-item .label=${this.messages.accordionHeading}>${this.renderAddFieldsControl("base")}</calcite-list-item>${this.showAdvancedFields()&&y`<calcite-list-item .label=${this.messages.gnssReceiverFields}>${this.renderAddFieldsControl("gnss")}</calcite-list-item><calcite-list-item .label=${this.messages.laserRangefinderFields}>${this.renderAddFieldsControl("rangefinder")}</calcite-list-item>`||""}</calcite-list></calcite-block></div>`:null}};q("arcgis-portal-add-gps-metadata",b);return b},"layers/Layer","portal/PortalItem","request",a)
|
|
2
|
+
import a from"./OQ2JULON.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import{c as F}from"./FN2QMDEW.js";import{a as O}from"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import{K as _,Q as q,h as f,j as y,v as h}from"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([C,L,T,{d:g}])=>{var w=f`:host{background-color:var(--calcite-color-foreground-1)}.scrim-container{position:relative}.base-fields-control{margin-inline-end:.75rem}.added{display:inline-flex;gap:.5rem;flex-shrink:0;white-space:nowrap}.added calcite-icon{color:var(--calcite-color-status-success)}.add-fields-button{margin:.75rem 0}calcite-block{border-bottom:0}calcite-list-item:last-child:after{display:block;margin-inline-start:var(--calcite-spacing-md);border-block-end:1px solid var(--calcite-list-border-color, var(--calcite-color-border-3));content:""}`;async function P({item:t,layers:e}){let{url:a}=t,l=new Map;if(!a)return{result:l};try{let s=(await T(a,{cacheBust:!0,query:{f:"json"},responseType:"json"})).data;if(s.fields){let n=e?.[0];return e?.length===1&&n?.layerId!=null&&l.set(n.layerId,s.fields),{result:l}}if(!s.layers?.length)return{result:l};let i=a.replace(/\/$/u,"");return await Promise.all(s.layers.map(async({id:n})=>{let d=(await T(`${i}/${n}`,{cacheBust:!0,query:{f:"json"},responseType:"json"})).data;l.set(n,d.fields??[])})),{result:l}}catch(s){return console.error("Error getting layer fields:",s),{error:{code:"unhandledError"}}}}var I=t=>{let{url:e}=t;return e?e.replace("/rest/services","/rest/admin/services").replace(/\/$/u,""):null};async function z({fields:t,item:e,portal:a,layerId:l}){let s=I(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await g({url:`${s}/${l!=null?`${l}/`:""}addToDefinition`,portal:a,method:"post",params:{addToDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message}}:{result:i}}catch(i){return console.error("Error adding fields to the feature service definition:",i),{error:{code:"unhandledError"}}}}async function A({fields:t,item:e,portal:a,layerId:l}){let s=I(e);if(!s)return{error:{code:"unhandledError",message:"A feature service URL is required."}};try{let i=await g({url:`${s}/${l!=null?`${l}/`:""}updateDefinition`,portal:a,method:"post",params:{updateDefinition:JSON.stringify({fields:t})}});return i.success===!1||i.error?{error:{code:"unhandledError",message:i.error?.message??"Failed to update the feature service definition."}}:{result:i}}catch(i){return console.error("Error updating the feature service definition:",i),{error:{code:"unhandledError"}}}}async function x(t){let{url:e}=t;if(!e)return{error:{code:"unhandledError"}};try{return{result:(await T(e,{query:{f:"json"}})).data}}catch(a){return console.error("Error getting service info:",a),{error:{code:"unhandledError"}}}}var G=(t,e)=>{let a=t.domain??null,l=e.domain??null;return a===null||l===null?a===l:a.type!==l.type?!1:a.type==="codedValue"&&l.type==="codedValue"?a.codedValues.length===l.codedValues.length&&a.codedValues.every(({code:s,name:i},n)=>s===l.codedValues[n]?.code&&i===l.codedValues[n]?.name):a.type==="range"&&l.type==="range"?a.range[0]===l.range[0]&&a.range[1]===l.range[1]:!0},R=(t,e)=>{let a=new Map(e.map(i=>[i.name,i])),l=[],s=[];for(let i of t){let n=a.get(i.name);n?G(i,n)||s.push({name:i.name,domain:i.domain}):l.push(i)}return{missingFields:l,modifiedFields:s}},E=t=>{switch(t){case"esriGeometryPolyline":case"esriGeometryPolygon":return[...M];case"esriGeometryPoint":return[...N];default:return[]}},V=t=>t==="esriGeometryPoint"?[...k]:[],D=t=>t==="esriGeometryPoint"?[...$]:[],M=[{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_h_rms",type:"esriFieldTypeDouble",alias:"Worst horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_v_rms",type:"esriFieldTypeDouble",alias:"Worst vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_worst_fixtype",type:"esriFieldTypeSmallInteger",alias:"Worst fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_manual_locations",type:"esriFieldTypeInteger",alias:"Number of manual locations",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],N=[{name:"esrignss_speed",type:"esriFieldTypeDouble",alias:"Speed (km/h)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_direction",type:"esriFieldTypeDouble",alias:"Direction of travel (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_azimuth",type:"esriFieldTypeDouble",alias:"Compass reading (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_positionsourcetype",type:"esriFieldTypeInteger",alias:"Position source type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_POSITIONSOURCETYPE_DOMAIN",codedValues:[{name:"Unknown",code:0},{name:"User defined",code:1},{name:"Integrated (System) Location Provider",code:2},{name:"External GNSS Receiver",code:3},{name:"Network Location Provider",code:4},{name:"Snapped",code:5}]},defaultValue:null},{name:"esrignss_receiver",type:"esriFieldTypeString",alias:"Receiver name",sqlType:"sqlTypeOther",length:50,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_rms",type:"esriFieldTypeDouble",alias:"Horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_v_rms",type:"esriFieldTypeDouble",alias:"Vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_latitude",type:"esriFieldTypeDouble",alias:"Latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_longitude",type:"esriFieldTypeDouble",alias:"Longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_altitude",type:"esriFieldTypeDouble",alias:"Ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_pdop",type:"esriFieldTypeDouble",alias:"PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_hdop",type:"esriFieldTypeDouble",alias:"HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_vdop",type:"esriFieldTypeDouble",alias:"VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_fixtype",type:"esriFieldTypeSmallInteger",alias:"Fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"NoFix",code:0},{name:"GPS",code:1},{name:"DifferentialGPS",code:2},{name:"PrecisePositioningService",code:3},{name:"RTKFixed",code:4},{name:"RTKFloat",code:5}]},defaultValue:null},{name:"esrignss_correctionage",type:"esriFieldTypeDouble",alias:"Correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_stationid",type:"esriFieldTypeSmallInteger",alias:"Station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_numsats",type:"esriFieldTypeSmallInteger",alias:"Number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"range",name:"ESRI_NUM_SATS_DOMAIN",range:[0,99]},defaultValue:null},{name:"esrignss_fixdatetime",type:"esriFieldTypeDate",alias:"Fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_h_rms",type:"esriFieldTypeDouble",alias:"Average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_v_rms",type:"esriFieldTypeDouble",alias:"Average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_avg_positions",type:"esriFieldTypeInteger",alias:"Averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_stddev",type:"esriFieldTypeDouble",alias:"Standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_name",type:"esriFieldTypeString",alias:"Correction source name",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_correction_source_type",type:"esriFieldTypeString",alias:"Correction source type",sqlType:"sqlTypeOther",length:25,nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_correction_source_domain",codedValues:[{name:"Unknown",code:"Unknown"},{name:"Direct IP",code:"Direct IP"},{name:"NTRIP",code:"NTRIP"},{name:"PPP",code:"PPP"},{name:"Radio",code:"Radio"},{name:"SBAS",code:"SBAS"}]},defaultValue:null},{name:"esrignss_custom_attributes",type:"esriFieldTypeString",alias:"GNSS custom attributes",sqlType:"sqlTypeOther",length:2e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_h_95_status",type:"esriFieldTypeSmallInteger",alias:"95% accuracy applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_ntrip_mount_point",type:"esriFieldTypeString",alias:"NTRIP mount point",sqlType:"sqlTypeOther",length:100,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_antenna_height",type:"esriFieldTypeDouble",alias:"GNSS antenna height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_orthometric_height",type:"esriFieldTypeDouble",alias:"Orthometric height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_profile_has_hor_xform",type:"esriFieldTypeSmallInteger",alias:"Location profile horizontal datum transformation applied",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null},{name:"esrignss_profile_hor_xform",type:"esriFieldTypeString",alias:"Location profile horizontal datum transformation",sqlType:"sqlTypeOther",length:255,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs",type:"esriFieldTypeString",alias:"Geographic coordinate system",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_gcs_wkid",type:"esriFieldTypeInteger",alias:"Geographic coordinate system WKID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_geoid",type:"esriFieldTypeString",alias:"Receiver geoid model",sqlType:"sqlTypeOther",length:60,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_receiver_ref_epoch",type:"esriFieldTypeDouble",alias:"Reference epoch",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}],k=[{name:"esrisnsr_tilt_azimuth_accuracy",type:"esriFieldTypeDouble",alias:"Tilt azimuth accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_azimuth",type:"esriFieldTypeDouble",alias:"Tilt azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle_accuracy",type:"esriFieldTypeDouble",alias:"Tilt angle accuracy (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_tilt_angle",type:"esriFieldTypeDouble",alias:"Tilt angle (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_tilt_compensated",type:"esriFieldTypeSmallInteger",alias:"Tilt compensated",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"esrignss_yesno_domain",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]},defaultValue:null}],$=[{name:"esrignss_cp1_latitude",type:"esriFieldTypeDouble",alias:"CP1 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_longitude",type:"esriFieldTypeDouble",alias:"CP1 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_altitude",type:"esriFieldTypeDouble",alias:"CP1 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_rms",type:"esriFieldTypeDouble",alias:"CP1 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_v_rms",type:"esriFieldTypeDouble",alias:"CP1 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixdatetime",type:"esriFieldTypeDate",alias:"CP1 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP1 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp1_corr_age",type:"esriFieldTypeDouble",alias:"CP1 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_stationid",type:"esriFieldTypeSmallInteger",alias:"CP1 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_numsats",type:"esriFieldTypeSmallInteger",alias:"CP1 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_pdop",type:"esriFieldTypeDouble",alias:"CP1 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_hdop",type:"esriFieldTypeDouble",alias:"CP1 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_vdop",type:"esriFieldTypeDouble",alias:"CP1 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP1 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP1 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_avg_positions",type:"esriFieldTypeInteger",alias:"CP1 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp1_h_stddev",type:"esriFieldTypeDouble",alias:"CP1 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_slope_dist",type:"esriFieldTypeDouble",alias:"CP1 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_inclination",type:"esriFieldTypeDouble",alias:"CP1 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp1_azimuth",type:"esriFieldTypeDouble",alias:"CP1 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_latitude",type:"esriFieldTypeDouble",alias:"CP2 latitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_longitude",type:"esriFieldTypeDouble",alias:"CP2 longitude",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_altitude",type:"esriFieldTypeDouble",alias:"CP2 ellipsoidal height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_rms",type:"esriFieldTypeDouble",alias:"CP2 horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_v_rms",type:"esriFieldTypeDouble",alias:"CP2 vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixdatetime",type:"esriFieldTypeDate",alias:"CP2 fix time",sqlType:"sqlTypeOther",length:8,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_fixtype",type:"esriFieldTypeSmallInteger",alias:"CP2 fix type",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_FIX_TYPE_DOMAIN",codedValues:[{name:"Fix not valid",code:0},{name:"GPS",code:1},{name:"Differential GPS",code:2},{name:"RTK Fixed",code:4},{name:"RTK Float",code:5}]},defaultValue:null},{name:"esrignss_cp2_corr_age",type:"esriFieldTypeDouble",alias:"CP2 correction age",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_stationid",type:"esriFieldTypeSmallInteger",alias:"CP2 station ID",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_numsats",type:"esriFieldTypeSmallInteger",alias:"CP2 number of satellites",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_pdop",type:"esriFieldTypeDouble",alias:"CP2 PDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_hdop",type:"esriFieldTypeDouble",alias:"CP2 HDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_vdop",type:"esriFieldTypeDouble",alias:"CP2 VDOP",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_h_rms",type:"esriFieldTypeDouble",alias:"CP2 average horizontal accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_v_rms",type:"esriFieldTypeDouble",alias:"CP2 average vertical accuracy (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_avg_positions",type:"esriFieldTypeInteger",alias:"CP2 averaged positions",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrignss_cp2_h_stddev",type:"esriFieldTypeDouble",alias:"CP2 standard deviation (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_slope_dist",type:"esriFieldTypeDouble",alias:"CP2 laser slope distance (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_inclination",type:"esriFieldTypeDouble",alias:"CP2 laser inclination (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_cp2_azimuth",type:"esriFieldTypeDouble",alias:"CP2 laser azimuth (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_method",type:"esriFieldTypeString",alias:"Offset method",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:{type:"codedValue",name:"ESRI_OFFSET_METHOD_DOMAIN",codedValues:[{name:"Azimuth-Azimuth",code:"azimuth-azimuth"},{name:"Distance-Angle",code:"distance-angle"},{name:"Distance-Azimuth",code:"distance-azimuth"},{name:"Distance-Distance",code:"distance-distance"},{name:"Azimuth-Azimuth-Backsight",code:"azimuth-azimuth-backsight"},{name:"Distance-Azimuth-Backsight",code:"distance-azimuth-backsight"},{name:"Distance-Distance-Backsight",code:"distance-distance-backsight"},{name:"User-defined",code:"user-defined"}]},defaultValue:null},{name:"esrisnsr_offset_device",type:"esriFieldTypeString",alias:"Rangefinder name",sqlType:"sqlTypeOther",length:5e3,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_height",type:"esriFieldTypeDouble",alias:"Rangefinder height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_laser_target_ht",type:"esriFieldTypeDouble",alias:"Laser target height (m)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"esrisnsr_offset_mag_var",type:"esriFieldTypeDouble",alias:"Rangefinder magnetic variation (\xB0)",sqlType:"sqlTypeOther",nullable:!0,editable:!0,domain:null,defaultValue:null}];function B(t){if(t.geometryType==="polyline"||t.geometryType==="polygon"){let e=t.capabilities;return e?.data?.supportsAttachment&&e?.operations?.supportsQueryAttachments}return!0}var U=t=>t.every(B),K=["point","polyline","polygon"],S=t=>t?.type==="Feature Service",b=class extends _{constructor(){super(...arguments),this.messages=O({blocking:!0}),this.initCount=0,this.supportsAttachments=!1,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.loadedItem=null,this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.initializing=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1,this.addingGPSFieldMetadata=[],this.item=null,this.itemId=null,this.messageOverrides={},this.arcgisGPSMetadataFieldsAdded=h(),this.arcgisReadOnlyMode=h()}static{this.properties={loadedItem:16,gpsFieldFixesBySet:16,addFieldsDisabled:16,initializing:16,hasLineOrPolygonLayer:16,hasPointFeatureLayer:16,addingGPSFieldMetadata:16,item:0,itemId:1,portal:0,messageOverrides:0}}static{this.styles=w}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.initItem()}willUpdate(e){(e.has("item")||e.has("itemId"))&&this.initItem()}async initItem({showLoading:e=!0}={}){let a=++this.initCount;if(!this.item&&!this.itemId){this.resetItemState(),this.initializing=!1;return}e&&(this.resetItemState(),this.initializing=!0);let{item:l,itemId:s,portal:i}=this,n=l?await l.load():await new L({id:s,portal:i}).load();if(!this.isCurrentInitialization(a))return;if(!S(n)){this.resetItemState(),this.initializing=!1;return}this.loadedItem=n;let d=!e&&this.layersLoaded?[...this.pointLayers,...this.lineOrPolygonLayers]:await this.getFeatureLayers(n),{result:m}=await x(n);if(!this.isCurrentInitialization(a))return;this.layersLoaded=!0,this.pointLayers=d.filter(o=>o.geometryType==="point"),this.lineOrPolygonLayers=d.filter(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasLineOrPolygonLayer=d.some(o=>o.geometryType==="polyline"||o.geometryType==="polygon"),this.hasPointFeatureLayer=d.some(o=>o.geometryType==="point");let{result:u,error:c}=d.length>0?await P({item:n,layers:d}):{};if(!this.isCurrentInitialization(a))return;if(c){this.resetItemState(),this.initializing=!1;return}let r=u??new Map;this.gpsFieldFixesBySet={base:this.analyzeFieldSet([...this.pointLayers,...this.lineOrPolygonLayers],r,"base"),gnss:this.analyzeFieldSet(this.pointLayers,r,"gnss"),rangefinder:this.analyzeFieldSet(this.pointLayers,r,"rangefinder")},this.supportsAttachments=U(d);let p=m?.sourceSchemaChangesAllowed!==!1;this.addFieldsDisabled=!this.supportsAttachments||!p,this.initializing=!1}isCurrentInitialization(e){return e===this.initCount}resetItemState(){this.loadedItem=null,this.layersLoaded=!1,this.pointLayers=[],this.lineOrPolygonLayers=[],this.gpsFieldFixesBySet=null,this.addFieldsDisabled=!0,this.hasLineOrPolygonLayer=!1,this.hasPointFeatureLayer=!1}async getFeatureLayers(e){let a=await C.fromPortalItem({portalItem:e});return await a.load(),"layers"in a?(await Promise.all(a.layers.map(async l=>(await l.load(),this.isSupportedFeatureLayer(l)?l:null)))).filter(l=>!!l):this.isSupportedFeatureLayer(a)?[a]:[]}isSupportedFeatureLayer(e){return e.type==="feature"&&K.some(a=>a===e.geometryType)}getCompatibleEsriGeometryType(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";default:return null}}analyzeFieldSet(e,a,l){let s=[];for(let i of e){if(i.layerId==null)continue;let n=a.get(i.layerId)??[],d=this.getCompatibleEsriGeometryType(i),m=d?l==="base"?E(d):l==="gnss"?V(d):D(d):[],u=R(m,n);(u.missingFields.length>0||u.modifiedFields.length>0)&&s.push({layerId:i.layerId,fieldsToAdd:u.missingFields,domainsToUpdate:u.modifiedFields})}return s}hasFieldChanges(e){return(this.gpsFieldFixesBySet?.[e].length??0)>0}isLoading(e){return this.addingGPSFieldMetadata.includes(e)}async addFields(e){let a=this.portal??this.loadedItem?.portal,l=this.loadedItem,s=this.gpsFieldFixesBySet;if(!a||!l||!s)return;if(a.isReadOnly){this.arcgisReadOnlyMode.emit();return}this.addingGPSFieldMetadata=[...this.addingGPSFieldMetadata,e];let i=[...this.pointLayers,...this.lineOrPolygonLayers];try{let n=s[e],d=(await Promise.all(n.filter(({fieldsToAdd:r})=>r.length>0).map(async({fieldsToAdd:r,layerId:p})=>await z({fields:r,item:l,layerId:p,portal:a})))).every(({error:r})=>!r),m=d?await Promise.all(n.filter(({domainsToUpdate:r})=>r.length>0).map(async({domainsToUpdate:r,layerId:p})=>await A({fields:r,item:l,layerId:p,portal:a}))):[],u=d&&m.every(({error:r})=>!r);if(!u||this.loadedItem!==l)return;let c;if(await F(async()=>{if(this.loadedItem!==l)return!0;let{result:r,error:p}=await P({item:l,layers:i});if(p||this.loadedItem!==l)return!0;if(!r)return!1;let o=e==="base"?i:i.filter(v=>v.geometryType==="point");return this.analyzeFieldSet(o,r,e).length>0?!1:(c=r,!0)},10)||console.warn("Fields were not verified on the service.",{itemId:l.id,fieldSet:e}),!c||this.loadedItem!==l)return;await this.initItem({showLoading:!1}),d&&u&&this.gpsFieldFixesBySet&&!this.hasFieldChanges(e)&&this.arcgisGPSMetadataFieldsAdded.emit(e)}finally{this.addingGPSFieldMetadata=this.addingGPSFieldMetadata.filter(n=>n!==e)}}canShowAddGPSMetadata(){let e=this.loadedItem??this.item;return!!e&&S(e)}showAdvancedFields(){let e=this.gpsFieldFixesBySet;return!this.hasPointFeatureLayer||!e?!1:this.hasFieldChanges("base")?this.pointLayers.some(a=>a.layerId==null?!1:["gnss","rangefinder"].some(l=>{let s=l==="gnss"?V("esriGeometryPoint"):D("esriGeometryPoint");return(e[l].find(({layerId:i})=>i===a.layerId)?.fieldsToAdd??[]).length<s.length})):!0}renderAddFieldsControl(e,a=!1){let l=this.gpsFieldFixesBySet;if(!a&&l&&!this.hasFieldChanges(e))return y`<span slot=actions-end class="added"><calcite-icon icon=check-circle scale=s aria-hidden></calcite-icon>${this.messages.added}</span>`;let s=this.isLoading(e);return y`<calcite-button slot=actions-end class="add-fields-button" appearance=outline-fill .disabled=${a||!l||s||this.addFieldsDisabled} .loading=${s} @click=${async()=>await this.addFields(e)}>${s?this.messages.addingFields:this.messages.addFields}</calcite-button>`}render(){return this.canShowAddGPSMetadata()?y`<div class="scrim-container"><calcite-block scale=m expanded>${this.initializing&&y`<calcite-scrim loading></calcite-scrim>`||""}<calcite-list .label=${this.messages.gpsOptions} selection-mode=none><calcite-list-item .label=${this.messages.accordionHeading}>${this.renderAddFieldsControl("base")}</calcite-list-item>${this.showAdvancedFields()&&y`<calcite-list-item .label=${this.messages.gnssReceiverFields}>${this.renderAddFieldsControl("gnss")}</calcite-list-item><calcite-list-item .label=${this.messages.laserRangefinderFields}>${this.renderAddFieldsControl("rangefinder")}</calcite-list-item>`||""}</calcite-list></calcite-block></div>`:null}};q("arcgis-portal-add-gps-metadata",b);return b},"layers/Layer","portal/PortalItem","request",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as g}from"./
|
|
2
|
+
import{a as g}from"./UHOW7Q65.js";import{a as f}from"./MLTZSPZQ.js";import{a as m}from"./US3N5L73.js";import"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import{a as d}from"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import{K as h,Q as p,j as n,v as a}from"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([{substitute:o}])=>{var l=class extends h{constructor(){super(...arguments),this.messages=d({blocking:!0,name:"portal-account-switcher"}),this.tipReference=null,this.tooltipText="",this.linkedAccounts=[],this.interactive=!1,this.signedInUsers=[],this.accountAccess={},this.actions=[],this.arcgisAccountListSwitch=a({bubbles:!1}),this.arcgisAccountListUnlink=a()}static{this.properties={tipReference:16,tooltipText:16,portal:0,linkedAccounts:0,interactive:5,signedInUsers:0,accountAccess:0,actions:0}}static{this.styles=m}connectedCallback(){super.connectedCallback(),this.interactive&&this.actions.length===0?this.actions=["switch","unlink"]:this.interactive||(this.actions=[])}formatProvider(i){if(i.startsWith("oidc_"))return"OpenID";switch(i){case"arcgis":return"ArcGIS";case"enterprise":return"SAML";case"apple":return"Apple";case"facebook":return"Facebook";case"github":return"GitHub";case"google":return"Google";default:return"Unknown"}}formatProviderLabel(i){let{messages:e}=this;if(i.startsWith("oidc_"))return e.oidcProvider;switch(i){case"arcgis":return e.arcgisProvider;case"enterprise":return e.samlProvider;case"apple":return e.appleProvider;case"facebook":return e.facebookProvider;case"github":return e.githubProvider;case"google":return e.googleProvider;default:return"Account provider"}}formatSwitchToLabel(i,e,c=!0){let{messages:s}=this;return i.disabled?s.userDisabled:e[i.username]?.allowed??!0?c?i.orgName?o(s.switchToOrgUser,i):o(s.switchToPublicUser,i):s.switchTo:s.userNotAllowed}render(){let{linkedAccounts:i,messages:e,accountAccess:c,interactive:s,portal:$,actions:u}=this;return n`${g(i,t=>t.id??t.username,t=>n`<calcite-block .label=${t.orgName?`${t.username}, ${t.orgName}`:t.username} heading-level=4 .heading=${t.username} .description=${t.orgName?`${t.fullname}, ${t.orgName}`:t.fullname} class="linked-account"><calcite-avatar slot=content-start inert .fullName=${t.fullname} .username=${t.username} .userId=${t.id} .thumbnail=${f({fullName:t.fullname,...t},$)??void 0}></calcite-avatar><calcite-chip slot=content-end kind=neutral scale=s .label=${this.formatProviderLabel(t.provider)} class="provider-chip" @mouseenter=${r=>{this.tipReference=r.currentTarget,this.tooltipText=this.formatProviderLabel(t.provider)}} @mouseleave=${()=>{this.tipReference=null,this.tooltipText=""}}>${this.formatProvider(t.provider)}</calcite-chip>${s&&n`${u.includes("unlink")&&n`<calcite-button appearance=transparent slot=actions-end kind=danger icon-start=unlink .label=${o(t.orgName?e.unlinkOrgUser:e.unlinkPublicUser,t)} .id=${`unlink-${t.username}`} @mouseenter=${r=>{this.tipReference=r.currentTarget,this.tooltipText=e.unlinkAccount}} @mouseleave=${()=>{this.tipReference=null,this.tooltipText=""}} @focusin=${r=>{this.tipReference=r.currentTarget,this.tooltipText=e.unlinkAccount}} @focusout=${()=>{this.tipReference=null,this.tooltipText=""}} @click=${r=>{r.preventDefault(),this.arcgisAccountListUnlink.emit({account:t})}}></calcite-button>`||""}${u.includes("switch")&&n`<calcite-button appearance=transparent slot=actions-end kind=neutral icon-start=sign-in .label=${this.formatSwitchToLabel(t,c)} .disabled=${t.disabled||!(c[t.username]?.allowed??!0)} .id=${`switch-${t.username}`} @mouseenter=${r=>{this.tipReference=r.currentTarget,this.tooltipText=this.formatSwitchToLabel(t,c,!1)}} @mouseleave=${()=>{this.tipReference=null,this.tooltipText=""}} @focusin=${r=>{this.tipReference=r.currentTarget,this.tooltipText=this.formatSwitchToLabel(t,c,!1)}} @focusout=${()=>{this.tipReference=null,this.tooltipText=""}} @click=${r=>{r.preventDefault(),this.arcgisAccountListSwitch.emit({account:t})}}></calcite-button>`||""}`||""}</calcite-block>`)}<calcite-tooltip .open=${!!this.tipReference} .referenceElement=${this.tipReference}>${this.tooltipText}</calcite-tooltip>`}};p("arcgis-portal-account-switcher-list",l);return l},"intl")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import b from"./TGCJUIEL.js";import a from"./TIPQ2ZWK.js";import{a as o}from"./UHOW7Q65.js";import{a as h}from"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import{K as n,Q as r,h as c,j as e}from"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([{c:f,d:d},{f:v}])=>{var C=c`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: var(--calcite-color-surface-3)}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`,l=class extends n{constructor(){super(...arguments),this.messages=h(),this.selectFavoriteClassification=i=>{let a=i.target.value;if(a){this.hasUpdateError=!1;let t=this.favoriteClassifications.find(({name:s})=>s===a);t&&this.updateClassificationData(t)}},this.uploadFavoriteClassificationValueHandle=async i=>{let a=await d(this.portalItem,this.favoriteClassifications);if(this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i}),a){let{result:t,error:s}=a;if(s){console.error(s),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.uploadClassificationFavoriteError??"Failed to upload classification favorites"});return}t&&this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i})}},this.retrieveFavoriteClassificationHandle=async()=>{let i=await f(this.portalItem);if(i){let{result:a,error:t}=i;if(t){console.error(t),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.retrieveClassificationFavoriteError??"Failed to retrieve classification favorites"});return}a&&this.resetFavoriteClassification(a.favorites)}},this.changeFavoriteClassificationName=i=>{let a=i.target.value;this.newFavoriteClassificationName=a,this.hasDuplicatedClassificationError=this.favoriteClassifications.some(t=>t.name===a)},this.saveNewFavoriteClassification=async()=>{let i=this.newFavoriteClassificationName;if(this.favoriteClassifications.some(s=>s.name===i)){this.hasDuplicatedClassificationError=!0;return}if(!i)return;let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a};this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.addClassificationFavoriteSuccessMessage??"Classification Favorite added successfully"),await this.retrieveFavoriteClassificationHandle(),this.showSaveClassificationDialog=!1},this.updateFavoriteClassification=async()=>{if(!this.selectedFavoriteClassificationName){this.hasUpdateError=!0;return}await this.addFavoriteClassification(this.selectedFavoriteClassificationName),await this.retrieveFavoriteClassificationHandle()},this.deleteNonEnabledAttributes=()=>{let i=structuredClone(this.portalItem?.classification??{}),a=Object.fromEntries(Object.entries(i).filter(([t])=>this.attributeExpressionResults?.get(t)?.enabled!==!1));return{...a,...v(this.portalItem,a)}},this.addFavoriteClassification=async i=>{let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a},s=this.favoriteClassifications.findIndex(m=>m.name===i);s>=0?this.favoriteClassifications[s].classification=a:this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.updateClassificationFavoriteSuccessMessage??"Classification Favorite updated successfully")},this.removeFavoriteClassification=async i=>{this.favoriteClassifications=this.favoriteClassifications.filter(a=>a.name!==i),this.favoriteClassifications.length===0&&(this.showManageClassificationDialog=!1),await this.uploadFavoriteClassificationValueHandle(this.messages.removeClassificationFavoriteSuccessMessage??"Classification Favorite removed successfully"),await this.retrieveFavoriteClassificationHandle()},this.newFavoriteClassificationName="",this.showManageClassificationDialog=!1,this.showSaveClassificationDialog=!1,this.hasDuplicatedClassificationError=!1,this.hasUpdateError=!1,this.alertIndicator={alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:""},this.isNotificationModalActive=!1,this.favoriteClassifications=[],this.selectedFavoriteClassificationName="",this.resetFavoriteClassification=()=>{},this.updateClassificationData=()=>{},this.renderFavoriteClassificationError=i=>{let{alertIndicatorType:a,alertIndicatorIcon:t,alertIndicatorInfo:s}=i;return e`<calcite-alert .icon=${t} .label=${this.messages.classificationNotificationHandler??"Classification notification handler"} auto-close-duration=medium open .kind=${a} @calciteAlertClose=${()=>this.alertIndicator===null}><div slot=message>${s}</div></calcite-alert>`}}static{this.properties={newFavoriteClassificationName:16,showManageClassificationDialog:16,showSaveClassificationDialog:16,hasDuplicatedClassificationError:16,hasUpdateError:16,alertIndicator:16,isNotificationModalActive:16,portalItem:0,classificationValue:0,favoriteClassifications:0,selectedFavoriteClassificationName:1,attributeExpressionResults:0,resetFavoriteClassification:0,updateClassificationData:0}}static{this.styles=C}load(){this.newFavoriteClassificationName=this.classificationValue?.banner??""}onOpenFavoriteClassificationModal(){this.newFavoriteClassificationName=this.classificationValue?.banner??"",this.showSaveClassificationDialog=!0}getValidationMessage(){return this.newFavoriteClassificationName?this.hasDuplicatedClassificationError?this.messages.duplicatedClassificationError:"":this.messages.emptyFavoriteError}render(){return e`<div>${this.favoriteClassifications.length>0?e`<div><calcite-label><div class="select-favorite-label">${this.messages.applyClassificationFavoriteLabel}<calcite-link @click=${()=>this.showManageClassificationDialog=!0}>${this.messages.manageClassificationFavoriteBtn}</calcite-link></div><calcite-combobox label=select-calcite-combobox selection-mode=single .placeholder=${this.messages.selectFavoritePlaceholder} placeholder-icon=folder-star @calciteComboboxChange=${this.selectFavoriteClassification} .status=${this.hasUpdateError?"invalid":"idle"} .validationIcon=${this.hasUpdateError?"exclamation-mark-triangle":void 0} .validationMessage=${this.hasUpdateError?this.messages.updateWarning:""}>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-combobox-item .selected=${this.selectedFavoriteClassificationName===i} icon=folder-star .value=${i} .heading=${i}></calcite-combobox-item>`)}</calcite-combobox></calcite-label><div class="favorite-actions"><calcite-link icon-start=refresh @click=${this.updateFavoriteClassification}>${this.messages.updateClassificationFavoriteBtn}</calcite-link><calcite-link icon-start=star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationBtn}</calcite-link></div></div>`:e`<div class="save-new-favorite-button"><calcite-link icon-start=folder-star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationFavoriteBtn}</calcite-link></div>`}<calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.manageClassificationFavoriteLabel} .open=${this.showManageClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showManageClassificationDialog=!1}><calcite-list class="classification-favorite-list" .label=${this.messages.classificationFavoriteListLabel??"Classification Favorite list label"} selection-appearance=border selection-mode=single-persist>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-list-item .label=${i} .value=${i} class="classification-favorite-item"><div slot=content-end><calcite-icon icon=trash scale=s @click=${async()=>await this.removeFavoriteClassification(i)}></calcite-icon></div></calcite-list-item>`)}</calcite-list><calcite-button slot=footer-end scale=l @click=${()=>this.showManageClassificationDialog=!1}><div>${this.messages.favoriteClassificationBtnDone}</div></calcite-button></calcite-dialog><calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.addFavoriteDialogHeading} .open=${this.showSaveClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showSaveClassificationDialog=!1}><calcite-label class="classification-favorite-input-section">${this.messages.addClassificationFavorite}<calcite-input id=classification-favorite-name name=classification-favorite-name scale=m .value=${this.newFavoriteClassificationName} @calciteInputInput=${this.changeFavoriteClassificationName} .status=${!this.newFavoriteClassificationName||this.hasDuplicatedClassificationError?"invalid":"idle"} validation-icon=exclamation-mark-triangle .validationMessage=${this.getValidationMessage()}></calcite-input></calcite-label><calcite-button scale=l slot=footer-end @click=${this.saveNewFavoriteClassification}>${this.messages.favoriteClassificationBtnDone}</calcite-button></calcite-dialog></div>`}};r("arcgis-portal-classification-favorite",l);return l},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{e as r}from"./
|
|
2
|
+
import{e as r}from"./B3HV5JVN.js";import{R as o}from"./HHGKNVCH.js";var s=r(o);export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./7ISSDO2T.js";import{c as u}from"./KV4ZZSNW.js";import{a as g}from"./5R4JJWGB.js";import{K as h,Q as p,h as m,j as c}from"./HHGKNVCH.js";export default $arcgis.t(([{substitute:k},{a:d,b:f}])=>{var w=m`:host{display:block}calcite-notice{margin-top:.75rem}calcite-list{margin-block:.75rem}`;function I(o,s,t,e){let i=["id","ja","ko","th","vi","zh-cn","zh-hk","zh-tw"],n=["en","ca","da","de","el","es","et","fi","hi","hu","it","nb","nl","pt-pt","sv","tr"],l=o??"en",r=s.unknown;return(t===1||i.includes(l))&&(r=s.single),t!==1&&n.includes(l)&&(r=s.multiple),k(r,{...e,number:t})}var a=class extends h{constructor(){super(...arguments),this.messages=g({blocking:!0}),this.items=[],this.user=null}static{this.properties={items:0,portal:0,user:0}}static{this.styles=[w,d]}render(){let s=this.items.filter(({usedByItems:t})=>t.length>0);return s.length?c`<calcite-notice open icon kind=warning class="notice"><span slot=message>${I(this.messages._lang,this.messages.notice,0,{affectedCount:this.items.length,totalCount:this.items.reduce((t,{usedByItems:e})=>t+e.length,0)})}</span></calcite-notice><calcite-list .label=${this.messages.reviewItemsList}>${s.map(({item:t,usedByItems:e})=>f({item:t,portal:this.portal,user:this.user,lang:this.messages._lang,relatedItemsCount:e.length,relatedItemsCountTitle:this.messages.usedBy.replace("{count}",String(e.length)),onRelatedItemsClick:()=>{let i=new URL(`${u({portal:this.portal})}/search.html`);i.searchParams.set("searchTerm",e.map(({id:n})=>`id: ${n}`).join(" OR ")),window.open(i.toString(),"_blank","noopener,noreferrer")},showAccessInfo:!1}))}</calcite-list>`:null}};p("arcgis-portal-delete-items-review",a);return{a:I,b:a}},"intl",a)
|