@arcgis/common-components 6.0.0-next.21 → 6.0.0-next.23

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.
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{b as g}from"./ZJMMAZFG.js";import{a as p}from"./LLLQXE2U.js";import{c as u,e as y}from"./JYWWX277.js";import"./XMMFL5H3.js";import{L as d,M as r,P as n,S as m,h,j as i,t as s}from"./4IMLX5B4.js";var _=h`:host{display:inline-flex;max-inline-size:100%}:host([layout="horizontal"]){min-block-size:var(--calcite-size-xl)}:host([layout="vertical"]){min-inline-size:var(--calcite-size-xl);calcite-action-bar{min-block-size:min-content}}slot{display:flex;flex:1 1 auto;min-block-size:var(--calcite-size-xl);min-inline-size:0}slot.empty{display:none}.container{display:flex;flex-direction:column;block-size:100%;inline-size:100%;min-block-size:0;min-inline-size:0}.root{display:flex;flex-direction:row;align-items:stretch;flex:1;background-color:var(--calcite-color-surface-2);min-block-size:0;min-inline-size:0}.root.vertical-slider{flex-direction:column}.root.vertical-slider slot{flex-direction:column}.root.vertical-slider .separator{border-inline-end:none;border-block-end:solid var(--calcite-border-width-sm) var(--calcite-color-border-3)}calcite-action-bar{flex-shrink:0}:host([floating]) .root{border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-corner-radius-sm));box-shadow:var(--calcite-action-bar-shadow, var(--calcite-shadow-md));overflow:hidden}calcite-action{align-self:center}:host([layout="vertical"]) calcite-action{margin-block-start:auto}:host([layout="vertical"]) calcite-action:last-of-type{margin-block-end:auto}.separator{border-inline-end:solid var(--calcite-border-width-sm) var(--calcite-color-border-3)}`,c=class extends d{constructor(){super(),this._direction=u(),this.messages=p({blocking:!0}),this._isPlaying=!1,this.autoDestroyDisabled=!1,this.disabled=!1,this.floating=!1,this.hideNextButton=!1,this.hidePlayButton=!1,this.hidePreviousButton=!1,this.icon="list-rectangle",this.label="",this.layout="horizontal",this.loop=!1,this.playRate=1e3,this.arcgisAnimate=s(),this.arcgisNext=s(),this.arcgisPause=s(),this.arcgisPlay=s(),this.arcgisPrevious=s(),this.arcgisPropertyChange=y()("layout","loop","playRate","state"),this.arcgisSlottedElementChange=s(),this.listen("arcgisPropertyChange",()=>this.requestUpdate())}static{this.properties={_isPlaying:16,_slottedElement:16,autoDestroyDisabled:5,disabled:5,floating:7,hideNextButton:5,hidePlayButton:5,hidePreviousButton:5,icon:1,label:1,layout:3,loop:5,playRate:9,state:32}}static{this.styles=_}get state(){return this._isPlaying?"playing":"ready"}async destroy(){await this.manager.destroy()}next(){this.arcgisNext.emit(),this._slottedElement?.canNext&&this._slottedElement.step("next")}pause(){this._isPlaying=!1,this.arcgisPause.emit()}play(){this._isPlaying||(this._isPlaying=!0,this.arcgisPlay.emit(),this._startPlayRate(!0))}previous(){this.arcgisPrevious.emit(),this._slottedElement?.canPrevious&&this._slottedElement.step("previous")}willUpdate(t){t.has("layout")&&this._isElementWithLayout(this._slottedElement)&&(this._slottedElement.layout=this.layout),t.has("disabled")&&this._isElementWithDisabled(this._slottedElement)&&(this._slottedElement.disabled=this.disabled)}disconnectedCallback(){super.disconnectedCallback(),this._isPlaying&&this.pause()}_handleSlotChange(t){let[e]=g(t);this._slottedElement=e,this.arcgisSlottedElementChange.emit({slottedElement:e}),!e&&this._isPlaying&&this.pause(),this._isElementWithLayout(e)&&(e.layout=this.layout),this._isElementWithDisabled(e)&&(e.disabled=this.disabled),this._isElementWithComponentOnReady(e)&&e.componentOnReady().then(()=>{this._slottedElement===e&&this.requestUpdate()})}_isElementWithComponentOnReady(t){return!!t&&"componentOnReady"in t}_isElementWithLayout(t){return!!t&&"layout"in t}_isElementWithDisabled(t){return!!t&&"disabled"in t}_startPlayRate(t){setTimeout(()=>{if(this._isPlaying){if(!this._slottedElement?.canNext&&this.loop)this._slottedElement?.reset();else if(this._slottedElement?.step("next"),this._slottedElement&&!this._slottedElement?.canNext&&!this.loop){this.pause();return}this.arcgisAnimate.emit({first:t}),this._startPlayRate(!1)}},this.playRate)}_renderActions(){let t=this.state==="playing",e=this.layout==="vertical"&&this._slottedElement?.localName==="arcgis-value-picker-slider",a=!this.hidePlayButton&&i`<calcite-action alignment=center .disabled=${this.disabled||this._slottedElement&&!this._slottedElement.canPlay} .icon=${t?"pause":"play"} .text=${t?this.messages.pause:this.messages.play} title=${(t?this.messages.pause:this.messages.play)??n} @click=${()=>{if(this._slottedElement&&!this._slottedElement.canNext&&!this.loop){this._slottedElement.reset(),this.play();return}t?this.pause():this.play()}}></calcite-action>`||"",l=!this.hidePreviousButton&&i`<calcite-action alignment=center .disabled=${this.disabled||t||this._slottedElement&&!this._slottedElement.canPrevious} .icon=${this.layout==="horizontal"?"chevron-left":e?"chevron-down":"chevron-up"} .text=${this.messages.previous} title=${this.messages.previous??n} @click=${this.previous}></calcite-action>`||"",o=!this.hideNextButton&&i`<calcite-action alignment=center .disabled=${this.disabled||t||this._slottedElement&&!this._slottedElement.canNext} .icon=${this.layout==="horizontal"?"chevron-right":e?"chevron-up":"chevron-down"} .text=${this.messages.next} title=${this.messages.next??n} @click=${this.next}></calcite-action>`||"";return(this._direction==="rtl"&&this.layout==="horizontal"||e?[a,o,l]:[a,l,o]).filter(Boolean)}render(){let t=!!this._slottedElement&&!this._slottedElement.hidden,e=this._renderActions(),a=e.length>0&&t,l=this.layout==="vertical"&&this._slottedElement?.localName==="arcgis-value-picker-slider";return i`<div class="container"><div class=${r(l?"root vertical-slider":"root")}>${e.length>0&&i`<calcite-action-bar expand-toggle-disabled .layout=${this.layout}>${e}</calcite-action-bar>`||""}${a&&i`<div class="separator"></div>`||""}<slot @slotchange=${({currentTarget:o})=>{this._handleSlotChange(o)}} class=${r(t?"component-slot":"empty")}></slot></div></div>`}};m("arcgis-value-picker",c);export{c as ArcgisValuePicker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{e as w,g as x,o as E,p as D}from"./TTFTN2LD.js";import{a as B,b as f,c as T}from"./BDIGRQ2U.js";import{a as A}from"./LLLQXE2U.js";import"./JYWWX277.js";import"./XMMFL5H3.js";import{a as C}from"./TE77L77R.js";import{J as R,K as U,L as H,S as _,h as O,j as Z,o as $,p as F,t as I}from"./4IMLX5B4.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(i){switch(i.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return i.type}}var de=O`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=f(e)&&f(s)||f(t);if(!f(t)&&!f(e)&&!f(s)?$("error",this,F("uniqueValues")):f(t)||(f(e)||$("error",this,F("layer")),f(s)||$("error",this,F("fieldName"))),f(e)&&f(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(f(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>f(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!0}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,p)=>h.count<=p.count?1:-1)},Y=v=>{let h=r?.length;v.sort((p,V)=>{if(!h&&g)return(typeof p.value=="string"?Number.parseFloat(p.value):p.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let q=h?L(p.value,r):p.label??p.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((p,V)=>{let q=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(p=>p.value);!r&&d==="date-only"?h=h?.map(p=>P(p)):!r&&d==="time-only"?h=h?.map(p=>W(p)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(p=>Number.parseInt(p)):d&&["single","double"].includes(d)&&(h=h?.map(p=>Number.parseFloat(p))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${U(this.dropdownNode)}><calcite-action slot=trigger .label=${l.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${t==="count"||!f(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${f(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
2
+ import{e as w,g as x,o as E,p as D}from"./TTFTN2LD.js";import{a as B,b as p,c as T}from"./BDIGRQ2U.js";import{a as A}from"./LLLQXE2U.js";import"./JYWWX277.js";import"./XMMFL5H3.js";import{a as C}from"./TE77L77R.js";import{J as R,K as U,L as H,S as _,h as O,j as Z,o as $,p as F,t as I}from"./4IMLX5B4.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(i){switch(i.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return i.type}}var de=O`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=p(e)&&p(s)||p(t);if(!p(t)&&!p(e)&&!p(s)?$("error",this,F("uniqueValues")):p(t)||(p(e)||$("error",this,F("layer")),p(s)||$("error",this,F("fieldName"))),p(e)&&p(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(p(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(p(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>p(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!0}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,f)=>h.count<=f.count?1:-1)},Y=v=>{let h=r?.length;v.sort((f,V)=>{if(!h&&g)return(typeof f.value=="string"?Number.parseFloat(f.value):f.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let q=h?L(f.value,r):f.label??f.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((f,V)=>{let q=h?.indexOf(f.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(f=>f.value);!r&&d==="date-only"?h=h?.map(f=>P(f)):!r&&d==="time-only"?h=h?.map(f=>W(f)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(f=>Number.parseInt(f)):d&&["single","double"].includes(d)&&(h=h?.map(f=>Number.parseFloat(f))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-action id=sort-action slot=filter-actions-end .label=${l.sortValues} text><calcite-icon scale=s icon=sort-descending flip-rtl></calcite-icon></calcite-action><calcite-dropdown placement=bottom-end overlay-positioning=fixed reference-element=sort-action @calciteDropdownSelect=${this.onSortMenuSelect} ${U(this.dropdownNode)}><calcite-dropdown-group><calcite-dropdown-item .selected=${t==="count"||!p(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${p(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as A}from"./ZJMMAZFG.js";import{a as he}from"./5KBPWYPL.js";import{a as ce}from"./LLLQXE2U.js";import{a as oe,c as le}from"./JYWWX277.js";import{a as ae,c as se}from"./XMMFL5H3.js";import{a as q}from"./TE77L77R.js";import{J as K,K as O,L as ne,M as R,N as z,P as E,S as ie,h as Q,j as y,q as ee,r as te,t as M,v as re,w as j}from"./4IMLX5B4.js";export default $arcgis.t(([{on:rt,watch:de},{createObservable:we,trackAccess:Pe},{property:ot,subclass:lt},ht,$e,{property:$,subclass:Ie},{watch:Y}])=>{var ue=(i,e)=>t=>De(t,i),B=class extends re{constructor(e,t){super(e),this.Y=new Map,this.A=void 0,this.#r=we();let r=this;r.#e=t,r.Z(),r.setProvisionalExports(ge(e,new WeakRef(r),e.M.length-1,r.instance,r.Y),!1),ee(e,a=>{if(a){let n=de(()=>e[a],o=>{if(o===r.instance)return;let s=r.instance;r.exports=o,r.instance=o,r.Y.forEach((l,c)=>e.requestUpdate(l,s[c])),r.#t&&s.destroy(),r.#t=!1},{sync:!0});r.onDestroy(n.remove)}},r.exports)}#t;#r;#e;get exports(){return Pe(this.#r),super.exports}set exports(e){super.exports=e,this.#r.notify()}Z(){let e=this;e.instance="prototype"in e.#e&&"declaredClass"in e.#e.prototype?new e.#e:e.#e(),e.#t=!0}hostConnected(){this.exports=this.instance}hostDestroy(){this.#t&&this.instance.destroy?.()}},De=oe(B),ge=(i,e,t,r,a)=>new Proxy(r,{get:(n,o)=>{let s=n[o];if(typeof o=="symbol"||a.has(o))return s;let l=i.M[t];return l.A=o,te(i,c=>{if(l.A=void 0,c!==void 0){let h=c.key;a.set(o,h);let u=i.constructor.getPropertyOptions(h),d=o!==h&&h.toLowerCase().includes("disable");Ce(e,u,o,h,d),u.i===void 0&&Ee(u,t,o,d)}},s)}}),Ce=(i,e,t,r,a,n)=>n=de(()=>{let o=i.deref();return o===void 0||o.component.manager.destroyed?n=n.remove():o.exports[t]},(o,s)=>{if(!n)return;i.deref().component?.requestUpdate(r,a?!s:s),e.c=!1},{sync:!0}),Ee=(i,e,t,r)=>{i.d.get=function(){let a=this.M[e]?.exports[t];return r?!a:a},i.d.set=function(a){let n=this.M[e];n.A!==t&&(n.exports[t]=r?!a:a)}};var me=ue;function*W(i,e){if(i!==void 0){let t=0;for(let r of i)yield e(r,t++)}}var _={increment:"ArrowUp",incrementHorizontal:"ArrowRight",decrement:"ArrowDown",decrementHorizontal:"ArrowLeft",pageIncrement:"PageUp",pageDecrement:"PageDown",jumpToStart:"Home",jumpToEnd:"End",confirmEdit:"Enter"};function pe({key:i,shiftKey:e},t,r){let a=Re(i);if(a==null)return null;let n=Me(i)||Te(i)&&e?ze(t):1;return{direction:r?a*-1:a,count:n}}function Re(i){return i===_.increment||i===_.incrementHorizontal||i===_.pageIncrement?1:i===_.decrement||i===_.decrementHorizontal||i===_.pageDecrement?-1:null}function ve(i){return i===_.jumpToEnd||i===_.jumpToStart}function Te(i){return i===_.increment||i===_.decrement||i===_.decrementHorizontal||i===_.incrementHorizontal}function Me(i){return i===_.pageIncrement||i===_.pageDecrement}function ze(i){let e=Number.isFinite(i)?Math.floor(i):1;return Math.max(1,e)}var Se=Q`:host{display:flex;width:100%;height:100%;font-size:var(--calcite-font-size--2);font-variant-numeric:tabular-nums;--arcgis-slider-dash-length: 5px;--arcgis-slider-handle-size: .875rem;--arcgis-slider-track-background-color: var(--calcite-color-border-2);--arcgis-internal-slider-show-range-labels: 0;--arcgis-internal-slider-show-value-labels: 0;--arcgis-internal-slider-value-labels-placement-start: 0;--arcgis-internal-slider-value-labels-placement-end: 0;--arcgis-internal-slider-range-labels-placement-center: 0;--arcgis-internal-slider-range-labels-placement-end: 0;--arcgis-internal-slider-handle-color: var(--calcite-color-text-3);--arcgis-internal-slider-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-internal-slider-label-input-margin: calc(var(--arcgis-internal-slider-handle-offset) + 4px);--arcgis-internal-slider-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-brand);--arcgis-internal-slider-track-size: 2px}:host([show-range-labels]){--arcgis-internal-slider-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-internal-slider-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-internal-slider-value-labels-placement-start: var(--arcgis-internal-slider-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-internal-slider-value-labels-placement-end: var(--arcgis-internal-slider-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-internal-slider-range-labels-placement-center: var(--arcgis-internal-slider-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-internal-slider-range-labels-placement-end: var(--arcgis-internal-slider-show-range-labels)}:host([disabled]){cursor:default;opacity:var(--calcite-opacity-disabled);pointer-events:none}.content{direction:ltr;flex:1;touch-action:none;user-select:none;display:grid;word-wrap:normal;word-break:normal;padding-block:var(--arcgis-internal-slider-handle-offset)}.track-container{grid-area:track-container;position:relative;display:flex;justify-content:center;align-items:center}.track{touch-action:none;position:relative}.track-bounds{background-color:var(--arcgis-slider-track-background-color)}:host([layout="vertical"]){.track-effective-start{background:repeating-linear-gradient(to bottom,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to top,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}:host([layout="horizontal"]){.track-effective-start{background:repeating-linear-gradient(to right,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to left,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}.track-range-interactive{&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-border-2)}&.filled.active{outline-color:var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}.track-range{background-color:var(--arcgis-internal-slider-track-range-background-color);pointer-events:none}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range-interactive.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range-interactive.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range-interactive.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-left:1px;writing-mode:vertical-lr}}.segment{transform-origin:0 0;inset-block-start:0px;block-size:var(--arcgis-internal-slider-track-size);position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;width:2px;height:2px;margin:-1px;position:absolute}.thumb-content{width:0;height:0;position:absolute;top:50%;left:50%}.thumb:focus,.thumb.active{.handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px #00000029;outline:2px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}.thumb.labels-only .handle{visibility:hidden;pointer-events:none}.thumb.labels-only{background-color:transparent}.handle{cursor:pointer;box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 2px var(--arcgis-internal-slider-handle-color) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--arcgis-internal-slider-transition-duration, var(--calcite-animation-timing, .125s)) ease-in-out;position:absolute;top:calc(var(--arcgis-internal-slider-handle-offset) * -1);left:calc(var(--arcgis-internal-slider-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}:host([layout="vertical"]) .fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) / 1.5);height:calc(var(--arcgis-slider-handle-size) * 1.5);cursor:ns-resize}.fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) * 1.5);height:calc(var(--arcgis-slider-handle-size) / 1.5);top:0;left:0;transform:translate(-50%,-50%);cursor:ew-resize}.label{position:absolute;will-change:transform}.min{grid-area:range-start}.max{grid-area:range-end}:host([layout="horizontal"][mirrored][range-labels-placement="center"]),:host([layout="vertical"]:not([mirrored])){.min{grid-area:range-end}.max{grid-area:range-start}}.content-start{grid-area:content-start;display:flex}.content-end{grid-area:content-end;display:flex}:dir(rtl){.content-start,.content-end,.label,.max,.min,.popover{direction:rtl}}:host([layout="vertical"]){.content{grid-template:". range-start range-start range-start ." "content-start content-start track-container content-end content-end" ". range-end range-end range-end .";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto auto auto 1fr;row-gap:var(--arcgis-internal-slider-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-internal-slider-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-internal-slider-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-internal-slider-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-internal-slider-content-start-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height)) );--arcgis-internal-slider-content-end-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) );column-gap:calc(var(--arcgis-internal-slider-show-range-labels) * var(--arcgis-internal-slider-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset));grid-template:". content-start ." "range-start content-start range-end" "range-start track-container range-end" "range-start content-end range-end" ". content-end .";grid-template-columns:auto 1fr auto;grid-template-rows:minmax(var(--arcgis-internal-slider-content-start-min-height),auto) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) var(--arcgis-internal-slider-track-size) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label,.label-separator{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label,.label-separator{top:var(--arcgis-internal-slider-label-input-margin)}}}.label-separator{position:absolute;width:1em;height:var(--arcgis-internal-slider-label-input-height);margin:0;padding:0;pointer-events:none;text-align:center;z-index:0}.label-separator:before{content:"—"}:host([layout="horizontal"]) .label-separator{transform:translate(-50%)}:host([layout="horizontal"][range-labels-placement="end"]){min-inline-size:min-content;.content{--arcgis-internal-slider-content-start-min-height: calc( var(--arcgis-internal-slider-handle-offset) + var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height) );--arcgis-internal-slider-content-end-min-height: calc( var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height) );padding-inline:var(--arcgis-internal-slider-handle-offset);grid-template:"content-start content-start content-start" "track-container track-container track-container" "content-end content-end content-end" "content-end content-end content-end" "content-end content-end content-end";grid-template-columns:auto 0 auto;grid-template-rows:minmax(var(--arcgis-internal-slider-content-start-min-height),auto) var(--arcgis-internal-slider-track-size) var(--arcgis-internal-slider-handle-offset) calc(var(--arcgis-internal-slider-range-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label,.label-separator{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label,.label-separator{top:calc(var(--arcgis-internal-slider-label-input-margin) + var(--arcgis-internal-slider-range-labels-placement-end) * (var(--arcgis-internal-slider-label-input-height)))}}.min,.max{--arcgis-internal-slider-range-translation: calc(var(--arcgis-internal-slider-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;margin-left:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:3;margin-right:calc(var(--arcgis-internal-slider-range-translation) * -1)}}&:host([mirrored]){.min{grid-column:3;margin-right:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:1;margin-left:calc(var(--arcgis-internal-slider-range-translation) * -1)}}}`,Ve=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,_e=i=>{throw TypeError(i)},D=(i,e,t,r)=>{for(var a=r>1?void 0:r?Fe(e,t):e,n=i.length-1,o;n>=0;n--)(o=i[n])&&(a=(r?o(e,t,a):o(a))||a);return r&&a&&Ve(e,t,a),a},xe=(i,e,t)=>e.has(i)||_e("Cannot "+t),Le=(i,e,t)=>(xe(i,e,"read from private field"),e.get(i)),Oe=(i,e,t)=>e.has(i)?_e("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ae=(i,e,t,r)=>(xe(i,e,"write to private field"),e.set(i,t),t),U;function Be(){return{min:0,max:100,values:[]}}var w=class extends $e{constructor(i={}){super({...Be(),properties:i}),this._entries=new Map,this.precision=4,this.ready=!1,Oe(this,U)}startup(){let{precision:i}=this,{min:e,max:t,values:r}=this;t=k(t,i),e=k(e,i),r=r?.map(n=>L(k(n,i),e,t)).sort((n,o)=>n-o),this._set("min",e),this._set("max",t),this._set("values",r);let a=new Map(r?.map(n=>[j(),n]));this._entries=a,Y(()=>this.min,n=>{let o=this.values;n!=null&&o?.length&&o.some(s=>s<n)&&(this._entries.forEach((s,l)=>{s<n&&this._entries.set(l,n)}),this._updatesValues())},{sync:!0}),Y(()=>this.max,n=>{let o=this.values;n!=null&&o?.length&&o.some(s=>s>n)&&(this._entries.forEach((s,l)=>{s>n&&this._entries.set(l,n)}),this._updatesValues())},{sync:!0}),Y(()=>this.precision,n=>{let{min:o,max:s,values:l}=this;this._set("min",k(o,n)),this._set("max",k(s,n)),l?.length&&(this._entries.forEach((c,h)=>{this._entries.set(h,k(c,n))}),this._updatesValues())},{sync:!0}),this._set("ready",!0)}get entries(){return this._entries}set max(i){if(!this.ready){this._set("max",i);return}let e=this._get("max"),t=k(i,this.precision);e!==t&&this._set("max",t)}set min(i){if(!this.ready){this._set("min",i);return}let e=this._get("min"),t=k(i,this.precision);e!==t&&this._set("min",t)}set values(i){if(Le(this,U)===i)return;if(Ae(this,U,i),!this.ready){this._set("values",i);return}let e=this._get("values");if(i=i?.map(r=>L(k(r,this.precision),this.min,this.max)).sort((r,a)=>r-a),e?.length===i?.length&&e.every((r,a)=>r===i[a]))return;let t=new Map(i?.map(r=>[j(),r]));this._entries=t,this._set("values",i)}getValue(i){return this._entries.get(i)}setValue(i,e){if(this.values==null)return!1;let{min:t,max:r}=this,a=this._entries.get(i),n=L(k(e,this.precision),t,r);return a===n?!1:(this._entries.set(i,n),this._updatesValues(),!0)}setValues(i){if(this.values==null)return!1;let e=!1,{min:t,max:r}=this;for(let[a,n]of i){let o=this._entries.get(a),s=L(k(n,this.precision),t,r);o!==s&&(e=!0,this._entries.set(a,s))}return e?(this._updatesValues(),!0):!1}_updatesValues(){let i=Array.from(this._entries.values()).sort((e,t)=>e-t);this._set("values",i)}};U=new WeakMap;D([$()],w.prototype,"_entries",2);D([$({readOnly:!0})],w.prototype,"entries",1);D([$()],w.prototype,"max",1);D([$()],w.prototype,"min",1);D([$({cast:i=>L(i,0,20)})],w.prototype,"precision",2);D([$({readOnly:!0})],w.prototype,"ready",2);D([$()],w.prototype,"values",1);w=D([Ie("esri.widgets.Slider.SliderData")],w);function L(i,e,t){return Math.min(Math.max(i,e),t)}function k(i,e){return Number.parseFloat(i.toFixed(e))}var G=class{constructor(e){this.steps=e,this.minIndex=0,this.maxIndex=this.steps.length-1}indexToValue(e){return this.steps[P(e,this.minIndex,this.maxIndex)]}valueToIndex(e){let t=this.steps.indexOf(e);return t!==-1?t:this.steps.reduce((r,a,n,o)=>Math.abs(a-e)<Math.abs(o[r]-e)?n:r,0)}getClosestStepDistances(e,t){if(t<=0)return[];let r=[];for(let a=this.minIndex;a<=this.maxIndex;a++){let n=this.indexToValue(a),o=Math.abs(n-e),s=!1;for(let l=0;l<r.length;l++)if(o<r[l].dist){r.splice(l,0,{idx:a,value:n,dist:o}),s=!0;break}!s&&r.length<t&&r.push({idx:a,value:n,dist:o}),r.length>t&&(r.length=t)}return r}},X=class{constructor(e,t,r){this.min=e,this.max=t,this.stepSize=r,this.minIndex=0,this.maxIndex=Math.round((this.max-this.min)/this.stepSize)}indexToValue(e){return this.min+P(e,this.minIndex,this.maxIndex)*this.stepSize}valueToIndex(e){return e=P(e,this.min,this.max),Math.round((e-this.min)/this.stepSize)}getClosestStepDistances(e,t){if(t<=0)return[];let r=[],a=this.minIndex,n=this.maxIndex,o=(P(e,this.min,this.max)-this.min)/this.stepSize,s=Math.floor(o),l=s+1;for(;r.length<t&&(s>=a||l<=n);){if(s<a){let m=this.indexToValue(l);r.push({idx:l,value:m,dist:Math.abs(m-e)}),l++;continue}if(l>n){let m=this.indexToValue(s);r.push({idx:s,value:m,dist:Math.abs(m-e)}),s--;continue}let c=this.indexToValue(s),h=this.indexToValue(l),u=Math.abs(c-e),d=Math.abs(h-e);u<=d?(r.push({idx:s,value:c,dist:u}),s--):(r.push({idx:l,value:h,dist:d}),l++)}return r}};function He(i){if(i.steps==null)return null;let e=i.steps;return Array.isArray(e)?e.length===0?null:new G(e):e<=0?null:new X(i.min,i.max,e)}function Ne(i,e,t){if(i==null){let s=new Map;for(let[l,c]of e.entries())s.set(l,c+t);return s}let r=e.size,a=Array.from(e.entries()).map(([s,l])=>{let c=l+t,h=i.getClosestStepDistances(c,r);return{uuid:s,stepDistances:h}}),n=new Set,o=new Map;a.sort((s,l)=>s.stepDistances[0].dist-l.stepDistances[0].dist);for(let s of a){let l=s.stepDistances.find(c=>!n.has(c.idx));l?(n.add(l.idx),o.set(s.uuid,l.value)):o.set(s.uuid,e.get(s.uuid))}return o}function H(i,e,t,r,a){let{allowValuesOverlap:n,precision:o,min:s,max:l}=a,c=e.get(t)??0,h=c+r,u=r>=0?-1:1,d,m,p;if(i){let v=new Set;if(!n)for(let[f,x]of e.entries())f!==t&&v.add(i.valueToIndex(x));let b=i.getClosestStepDistances(h,e.size+1);b.sort((f,x)=>S(f.dist,o)-S(x.dist,o)||u*(x.value-f.value));let g=0;d=b[g].value,p=f=>!n&&v.has(i.valueToIndex(f)),m=()=>(g++,b[g]?.value)}else{let v=new Set;for(let[g,f]of e.entries())g!==t&&v.add(S(f,o));let b=1/Math.pow(10,o);d=P(S(h,o),s,l),p=g=>!n&&v.has(g),m=()=>{let g=S(d+u*b,o);return g===d||g<s||g>l?void 0:g}}if(!p(d))return d;for(;;){let v=m();if(v===void 0)return c;if(d=v,!p(d))return d}}function S(i,e){return Number.parseFloat(i.toFixed(e))}function Ue(i,e,t,r=1){let a=ye(r),n=e,o=!1;for(let s=0;s<a;s++){let l=Ke(i,n,t);if(o||=l.changed,n=l.entries,!l.changed)break}return{changed:o,entries:n}}function je(i,e,t,r,a=1){let n=ye(a);if(n===1)return Z(i,e,t,r);let o=new Map(e),s=o.get(t);for(let l=0;l<n;l++){let c=Z(i,o,t,r);if(c===s)break;s=c,o.set(t,s)}return s}function ye(i){let e=Number.isFinite(i)?Math.floor(i):1;return Math.max(1,e)}function Ke(i,e,t){let r=new Map,a=t>0?Ye:ke,n=Array.from(e).sort((l,c)=>a(l[1],c[1])),o=!1,s=!0;for(let[l,c]of n)if(r.set(l,c),s){let h=Z(i,r,l,t);c===h&&(s=!1),o||=s,r.set(l,h)}return{changed:o,entries:r}}function Z(i,e,t,r){let{allowValuesOverlap:a,stepsProvider:n,resolution:o,min:s,max:l}=i,c=e.get(t);if(r=r>0?1:-1,!n){let g=P(c+r*o,s,l);if(a)return g;let f=new Set;for(let[x,C]of e)x!==t&&f.add(C);for(;f.has(g)&&g<=l&&g>=s;){let x=g;if(g=P(g+r*o,s,l),g===x)return c}return f.has(g)||g>l||g<s?c:g}let h=n.valueToIndex(c);if(h===-1)return c;if(a){let g=P(h+r,n.minIndex,n.maxIndex);return n.indexToValue(g)}let u=new Set;for(let[g,f]of e)g!==t&&u.add(n.valueToIndex(f));let d=h,m=!1,p=n.minIndex,v=n.maxIndex,b=0;for(;b<Math.abs(v-p)&&(d+=r,!(d<p||d>v));){if(!u.has(d)){m=!0;break}b++}return m?n.indexToValue(d):c}function qe(i,e,t,r){let{allowValuesOverlap:a,stepsProvider:n,resolution:o,min:s,max:l}=i,c=e.get(t);if(r=r>0?1:-1,!n){let m=new Set(Array.from(e).filter(([v])=>v!==t).map(([,v])=>v)),p=r>0?l:s;if(a)return p;for(;m.has(p);)if(p-=r*o,r>0&&p>l||r<0&&p<s){p=c;break}return p}if(a)return r>0?n.indexToValue(n.maxIndex):n.indexToValue(n.minIndex);let h=n.valueToIndex(c);if(h===-1)return c;let u=new Set(Array.from(e).filter(([m])=>m!==t).map(([,m])=>n.valueToIndex(m))),d=r>0?n.maxIndex:n.minIndex;for(;u.has(d);)if(d-=r,r>0&&d>l||r<0&&d<s){d=h;break}return n.indexToValue(d)}function We(i,e,t){let{stepsProvider:r,min:a,max:n}=i,o=new Map,s=Array.from(e).sort((c,h)=>ke(c[1],h[1]));if(r){let c=0;if(t>0){let h=s[s.length-1],u=r.valueToIndex(h[1]);c=r.maxIndex-u}else{let h=s[0],u=r.valueToIndex(h[1]);c=r.minIndex-u}if(c===0)for(let[h,u]of s)o.set(h,u);for(let[h,u]of s){let d=r.indexToValue(r.valueToIndex(u)+c);o.set(h,d)}return o}let l=0;if(t>0){let c=s[s.length-1];l=n-c[1]}else{let c=s[0];l=a-c[1]}for(let[c,h]of s)o.set(c,h+l);return o}function ke(i,e){return i-e}function Ye(i,e){return e-i}function P(i,e,t){return Math.max(e,Math.min(t,i))}var Ge=me(w),J=class extends ne{constructor(){super(...arguments),this._direction=le(),this._stepsProvider=null,this._popoverElement=K(),this._trackElement=K(),this.messages=ce({}),this._onPointerMoveDragUpdate=e=>{this._updateDrag(this._mapEventToRange(e))},this._onPointerUpDragEnd=e=>{F(e)&&this._endDrag()},this._onPointerCancelDragEnd=()=>{this._endDrag()},this._formatLabel=(e,t,r)=>{let a=he(this.messages._lang,t),n=this.labelFormatter;return n?n(r,e,s=>a.format(s))??a.format(r):a.format(r)},this._numberFormatOptions={},this._createFormatter=(e,t)=>this._formatLabel.bind(this,e,t),this._minFormatter=this._createFormatter("min",this._numberFormatOptions),this._maxFormatter=this._createFormatter("max",this._numberFormatOptions),this._valueFormatter=this._createFormatter("value",this._numberFormatOptions),this._resizeObserver=new ResizeObserver(()=>{this._layoutLabelInputs(),this._updatePopoverReferenceElement()}),this._labelInputsUpdateComplete=null,this._dragInfo=null,this._hasPopoverContent=!1,this._hasContentStart=!1,this._hasContentEnd=!1,this._measurablePopoverReferenceElement="",this._nextPopoverReferenceElement=null,this._activePart=null,this._sliderData=Ge(this),this.allowValuesOverlap=!1,this.autoDestroyDisabled=!1,this.disabled=!1,this.fillPlacement="start",this.layout="horizontal",this.max=this._sliderData.max,this.min=this._sliderData.min,this.mirrored=!1,this.popoverDisplay="auto",this.popoverLabel="",this.popoverPlacement="start",this.precision=this._sliderData.precision,this.valuesDraggingDisabled=!1,this.rangeLabelsEditingEnabled=!1,this.rangeLabelsPlacement="center",this.segmentsDraggingDisabled=!1,this.showRangeLabels=!1,this.valueLabelsDisplay="hidden",this.valueLabelsPlacement="start",this.valueLabelsEditingEnabled=!1,this.keyboardLargeStep=10,this.values=this._sliderData.values,this.arcgisActiveValueChange=M({cancelable:!1}),this.arcgisChange=M({cancelable:!1}),this.arcgisInput=M({cancelable:!1}),this.arcgisRangeChange=M({cancelable:!1})}static{this.properties={_dragInfo:16,_hasPopoverContent:16,_hasContentStart:16,_hasContentEnd:16,_measurablePopoverReferenceElement:16,_nextPopoverReferenceElement:16,_activePart:16,_sliderData:16,activeValue:32,allowValuesOverlap:5,autoDestroyDisabled:5,disabled:7,fullRangeMax:11,fullRangeMin:11,fillPlacement:1,labelFormatter:0,layout:3,max:11,min:11,mirrored:7,popoverDisplay:1,popoverLabel:1,popoverPlacement:3,precision:11,valuesDraggingDisabled:7,rangeLabelsEditingEnabled:5,rangeLabelsPlacement:3,segmentsDraggingDisabled:5,showRangeLabels:7,steps:[9,{converter:{fromAttribute(e){if(e.includes(","))return e.split(",").filter(r=>r.trim()!=="").map(parseFloat).filter(r=>Number.isFinite(r));let t=parseFloat(e);return Number.isFinite(t)?t:void 0}}}],valueLabelsDisplay:3,valueLabelsPlacement:3,valueLabelsEditingEnabled:5,keyboardLargeStep:9,values:[1,{converter:{fromAttribute(e){return e.includes(",")?e.split(",").filter(t=>t.trim()!=="").map(parseFloat).filter(t=>Number.isFinite(t)):[parseFloat(e)].filter(t=>Number.isFinite(t))}}}],messageOverrides:0}}static{this.styles=Se}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}get _fullMin(){return this.fullRangeMin??this.min}get _fullMax(){return this.fullRangeMax??this.max}get _fullRange(){return this._fullMax-this._fullMin}get isHorizontal(){return this.layout==="horizontal"}get _trackWidthOrHeight(){let e=this._trackElement.value?.getBoundingClientRect();return e?this.isHorizontal?e.width:e.height:0}get _disabledOrInvalid(){return this.disabled||this.values.length===0||this._invalid}get _invalid(){let e=this.fullRangeMin==null||this.fullRangeMax==null||this.fullRangeMin<this.fullRangeMax,t=this.fullRangeMin==null||this.fullRangeMin<=this.min,r=this.fullRangeMax==null||this.fullRangeMax>=this.max;return this.min>=this.max||!e||!t||!r}get resolution(){let e=(this._sliderData.max-this._sliderData.min)/this._trackWidthOrHeight;return Math.max(e,1/Math.pow(10,this.precision))}get activeValue(){if(this._activePart)return this._activePart==="range"?"all":this._sliderData.getValue(this._activePart)}async destroy(){await this.manager.destroy()}load(){this._sliderData.startup()}willUpdate(e){if((e.has("steps")||e.has("min")||e.has("max"))&&(this._stepsProvider=He(this)),(e.has("values")||e.has("steps")||e.has("min")||e.has("max")||e.has("precision")||e.has("allowValuesOverlap"))&&!this.allowValuesOverlap){let t=this._resolveOverlappingValues();t&&this._setValues(t)}if(e.has("messages")||e.has("min")||e.has("max")||e.has("precision")||e.has("labelFormatter")){let t=this.max!=null&&this.min!=null&&this.max-this.min>10?2:this.precision;this._numberFormatOptions={maximumFractionDigits:t},this._minFormatter=this._createFormatter("min",this._numberFormatOptions),this._maxFormatter=this._createFormatter("max",this._numberFormatOptions),this._valueFormatter=this._createFormatter("value",this._numberFormatOptions)}if(e.has("values")){let t=this._resolveFillPlacement(this.values.length>1);t!==this.fillPlacement&&(this.fillPlacement=t)}}updated(e){this._layoutLabelInputs();let t=this._popoverElement.value;t&&(e.has("values")||e.has("min")||e.has("max"))&&t.reposition()}loaded(){this._resizeObserver.observe(this.el),this._updatePopoverReferenceElement()}disconnectedCallback(){super.disconnectedCallback(),this._removeDragListeners()}_makeResizeRef(){let e=null;return t=>{t?(e=t,this._resizeObserver.observe(t)):e&&(this._resizeObserver.unobserve(e),e=null)}}async _layoutLabelInputs(){if(!this._trackElement.value||this.valueLabelsDisplay==="hidden")return;let e=this.renderRoot.querySelectorAll("arcgis-label-input"),t=this.componentOnReady().then(()=>Promise.all(Array.from(e,s=>s.updateComplete)));if(this._labelInputsUpdateComplete=t,await t,t!==this._labelInputsUpdateComplete)return;this._labelInputsUpdateComplete=null;let r=this._trackElement.value;if(!r)return;let a=r.getBoundingClientRect(),n=[],o=this.isHorizontal;for(let s of this._sliderData.entries.keys()){let l=this._activePart==="range"||this._activePart===s;if(this.valueLabelsDisplay==="always"||l){let c=Je(this,s),h=be(this,s);if(!c||!h)continue;let u=c.getBoundingClientRect(),d=o?u.left+u.width/2:u.top+u.height/2;if(o){let m=h.getBoundingClientRect(),p=h.getLabelBoundingClientRect(),v=u.width/2,b=Math.round(p.width/2),g=m.width/2,f=a.left-v,x=a.right+v,C=d-b,I=d+b;C<f?g+=C-f:I>x&&(g+=I-x),h.style.transform=`translateX(${-Math.round(g)}px)`}else h.style.removeProperty("transform");n.push({handleBounds:u,handleCenter:d,labelInput:h})}}this._layoutCollidingLabelInputs(n)}_layoutCollidingLabelInputs(e){let t=this.isHorizontal,r=Array.from(this.renderRoot.querySelectorAll(".label-separator")),a=e.slice().sort((s,l)=>s.handleCenter-l.handleCenter);if(a.length===0)return;let n=this._trackElement.value?.getBoundingClientRect(),o=a.map(s=>[s]);for(let s=0;s<a.length;s++){for(let c of r)c.hidden=!0,c.style.removeProperty("left");let l=0;for(let c of o){let h=(c[0].handleCenter+c[c.length-1].handleCenter)/2,u=c.reduce((m,p)=>m+(t?p.labelInput.getBoundingClientRect().width:p.labelInput.getBoundingClientRect().height),0),d=c.length===1?t?c[0].labelInput.getBoundingClientRect().left:c[0].labelInput.getBoundingClientRect().top:h-u/2;if(n&&c.length>1){let m=c[0],p=c[c.length-1];if(t){let v=m.labelInput.getLabelBoundingClientRect().left-m.labelInput.getBoundingClientRect().left,b=p.labelInput.getBoundingClientRect().right-p.labelInput.getLabelBoundingClientRect().right,g=n.left-m.handleBounds.width/2-v,f=n.right+p.handleBounds.width/2+b-u;d=T(d,g,f)}else{let v=m.labelInput.getBoundingClientRect().height/2,b=p.labelInput.getBoundingClientRect().height/2,g=n.top-v,f=n.bottom+b-u;d=T(d,g,f)}}for(let m=0;m<c.length;m++){let p=c[m],v=p.labelInput.getBoundingClientRect(),b=t?v.width:v.height,g=(t?v.left:v.top)+b/2,f=this._getLabelTranslate(p.labelInput,t),x=d+b/2,C=`${t?"translateX":"translateY"}(${Math.round(f+x-g)}px)`;if(p.labelInput.style.transform!==C&&(p.labelInput.style.transform=C),d+=b,t&&m<c.length-1){let I=r[l++];if(!I)continue;I.hidden=!1,I.style.left=`${d-(n?.left??0)}px`}}}if(!this._mergeCollidingLabelGroups(o))break}}_mergeCollidingLabelGroups(e){let t=this.isHorizontal;for(let r=0;r<e.length-1;){let a=e[r],n=e[r+1],o=a[a.length-1],s=n[0],l=o.labelInput.getBoundingClientRect(),c=s.labelInput.getBoundingClientRect(),h=t?l.right:l.bottom;if((t?c.left:c.top)>h)r++;else return a.push(...n),e.splice(r+1,1),!0}return!1}_getLabelTranslate(e,t){let r=t?/translateX\((-?\d+(?:\.\d+)?)px\)/u:/translateY\((-?\d+(?:\.\d+)?)px\)/u,a=e.style.transform.match(r);return a?Number.parseFloat(a[1]):0}_onTrackFocus(){this._setActivePart("range")}_onTrackBlur(){this._setActivePart(null)}_onTrackRangePointerDown(e){this._disabledOrInvalid||!F(e)||(e.preventDefault(),e.currentTarget.focus(),this._startDrag("range",this._mapEventToRange(e)))}async _onPointerDown(e){if(this._disabledOrInvalid||!F(e))return;let t=this.renderRoot.querySelector("arcgis-label-input[editing]");if(e.target===t)return;if(t){t.blur(),this._focusEntry(V(t));return}if(Xe(e.target)||this.values?.length>1)return;let r=this._mapEventToRange(e),[a,n]=this._sliderData.entries.entries().next().value,o=r*this._fullRange+this._fullMin-n,s=N(this._fullMin,this._fullMax,n)/100;this._startDrag(a,s);let l=H(this._stepsProvider,this._sliderData.entries,a,o,{allowValuesOverlap:this.allowValuesOverlap,precision:this.precision,min:this.min,max:this.max});this._setValue(a,l),this._focusEntry(a)}_onThumbPointerDown(e){let t=V(e.currentTarget);if(!F(e)||this._disabledOrInvalid||!t)return;let r=be(this,t);e.target===r&&r?.editing||(e.stopPropagation(),e.preventDefault(),this._focusEntry(t),this._startDrag(t,this._mapEventToRange(e)))}_onFixedThumbPointerDown(e){this._disabledOrInvalid||!F(e)||(e.preventDefault(),e.currentTarget.focus())}_endDrag(){if(this._disabledOrInvalid)return;this._removeDragListeners();let e=!1;if(this._dragInfo){let{entries:t}=this._dragInfo;for(let[r,a]of t)if(this._sliderData.getValue(r)!==a){e=!0;break}}this._dragInfo=null,e&&this.arcgisChange.emit()}_startDrag(e,t){if(this._disabledOrInvalid)return;let{min:r,max:a,values:n}=this,o=r,s=a;if(this._setActivePart(e),e==="range"){if(this.segmentsDraggingDisabled)return;o=r-n[0],s=a-n[n.length-1]}this._dragInfo={position:t,entries:new Map(this._sliderData.entries.entries()),minDiff:o,maxDiff:s},this._addDragListeners()}_updateDrag(e){if(!this._dragInfo||!this._activePart)return;let{_activePart:t,_dragInfo:{position:r,entries:a,minDiff:n,maxDiff:o}}=this;if(r===e)return;let s=(e-r)*this._fullRange;if(t==="range"){s=Math.min(o,Math.max(n,s));let l=Ne(this._stepsProvider,a,s);this._setValues(l)}else{let l=H(this._stepsProvider,a,t,s,{allowValuesOverlap:this.allowValuesOverlap,precision:this.precision,min:this.min,max:this.max});this._setValue(t,l)}}_focusEntry(e){e&&fe(this,e)?.focus()}_addDragListeners(){document.addEventListener("pointerup",this._onPointerUpDragEnd),document.addEventListener("pointermove",this._onPointerMoveDragUpdate),document.addEventListener("pointercancel",this._onPointerCancelDragEnd)}_removeDragListeners(){document.removeEventListener("pointerup",this._onPointerUpDragEnd),document.removeEventListener("pointermove",this._onPointerMoveDragUpdate),document.removeEventListener("pointercancel",this._onPointerCancelDragEnd)}_setValues(e){this._sliderData.setValues(e)&&(this._dragInfo||this.arcgisChange.emit(),this.arcgisInput.emit())}_setValue(e,t){this._sliderData.setValue(e,t)&&(this._dragInfo||this.arcgisChange.emit(),this.arcgisInput.emit())}_resolveOverlappingValues(){let e=new Map(this._sliderData.entries),t=Array.from(e.entries()).sort((a,n)=>a[1]-n[1]),r=!1;for(let[a,n]of t){let o=T(n,this.min,this.max);if(!Array.from(e).some(([l,c])=>l!==a&&T(c,this.min,this.max)===o))continue;let s=H(this._stepsProvider,e,a,o-n,{allowValuesOverlap:!1,precision:this.precision,min:this.min,max:this.max});s!==n&&(r=!0),e.set(a,s)}return r?e:null}_onThumbFocus(e){let t=V(e.currentTarget);this._setActivePart(t)}_onThumbBlur(){this._setActivePart(null)}_onRangeInputChange(e){let t=e.currentTarget,r=t.value,a=t.dataset.type,n=!1;switch(e.stopPropagation(),a){case"min":{r<this.max?(this.min=r,n=!0):t.value=this.min;break}case"max":{r>this.min?(this.max=r,n=!0):t.value=this.max;break}}n&&this.arcgisRangeChange.emit()}_onValueInputChange(e){let t=e.currentTarget,r=V(t),a=t.value;if(r){e.stopPropagation();let n=this._sliderData.getValue(r),o=H(this._stepsProvider,this._sliderData.entries,r,a-n,{allowValuesOverlap:this.allowValuesOverlap,precision:this.precision,min:this.min,max:this.max});this._setValue(r,o),t.value=this._sliderData.getValue(r)}}_mapEventToRange(e){let t=this._trackElement.value?.getBoundingClientRect();if(!t)return 0;let r=this.isHorizontal?(e.clientX-t.left)/t.width:1-(e.clientY-t.top)/t.height;return this.mirrored?1-r:r}_getPositionStyleForElement(e){let t=N(this._fullMin,this._fullMax,e);return{[this.isHorizontal?this.mirrored?"right":"left":this.mirrored?"top":"bottom"]:`${t}%`}}_popoverSlotChange(e){this._hasPopoverContent=A(e),this._updatePopoverReferenceElement()}_onPopoverBeforeOpen(e){e.target===this._popoverElement.value&&this._popoverElement.value.style.removeProperty("visibility")}_onPopoverBeforeClose(e){e.target===this._popoverElement.value&&(this._popoverElement.value.style.visibility="hidden")}async _onPopoverClose(){this._nextPopoverReferenceElement!=null&&(this._measurablePopoverReferenceElement=this._nextPopoverReferenceElement,await this.updateComplete,this._nextPopoverReferenceElement=null)}_onContentStartSlotChange(e){this._hasContentStart=A(e)}_onContentEndSlotChange(e){this._hasContentEnd=A(e)}_onThumbKeyDown(e){let t=V(e.currentTarget);if(!t)return;let r=e.currentTarget.querySelector("arcgis-label-input");if(!r||r.editing)return;if(e.key===_.confirmEdit){r.edit();return}let a=pe(e,this.keyboardLargeStep,this.mirrored);if(a){e.preventDefault();let n=je(this._getStepsConfiguration(),this._sliderData.entries,t,a.direction,a.count);this._setValue(t,n);return}if(ve(e.key)){e.preventDefault();let n=qe(this._getStepsConfiguration(),this._sliderData.entries,t,this._getDirectionForHomeEndKey(e.key));this._setValue(t,n)}}_onTrackRangeKeyDown(e){if(this._disabledOrInvalid)return;let t=pe(e,this.keyboardLargeStep,this.mirrored);if(t){e.preventDefault();let{entries:r}=Ue(this._getStepsConfiguration(),this._sliderData.entries,t.direction,t.count);this._setValues(r);return}if(ve(e.key)){e.preventDefault();let r=We(this._getStepsConfiguration(),this._sliderData.entries,this._getDirectionForHomeEndKey(e.key));this._setValues(r)}}_getStepsConfiguration(){return{allowValuesOverlap:this.allowValuesOverlap,stepsProvider:this._stepsProvider,resolution:this.resolution,min:this.min,max:this.max}}_getDirectionForHomeEndKey(e){return this.isHorizontal&&this.mirrored||this.layout==="vertical"?e===_.jumpToEnd?-1:1:e===_.jumpToStart?-1:1}_setActivePart(e){this._activePart!==e&&(this._activePart=e,this._updatePopoverReferenceElement(),this.arcgisActiveValueChange.emit())}_resolveFillPlacement(e){let{fillPlacement:t}=this;return e?t==="between"||t==="not-between"||t==="none"?t:"between":t==="start"||t==="end"||t==="none"?t:"start"}_updatePopoverReferenceElement(){let{_activePart:e,popoverDisplay:t}=this,r="";if(this._hasPopoverContent)if(t==="always"&&this.values.length>1){let c=Array.from(this._sliderData.entries),[h,u]=c[0];r=c.every(([,d])=>d===u)?h:"track-range"}else e&&Ze(e)?r=e:this.values.length>1?r="track-range":r=this._sliderData.entries.keys().next().value??"";let a=null;r&&(r==="track-range"?a=this.renderRoot.querySelector("#track-range"):a=fe(this,r));let n=a?.getBoundingClientRect(),o=n&&n.width>0&&n.height>0?r:"",s=!!this._popoverElement.value?.open,l=this._hasPopoverContent&&!!o&&(this.popoverDisplay==="always"||!!this._activePart);this._nextPopoverReferenceElement!=null?this._nextPopoverReferenceElement=o:o!==this._measurablePopoverReferenceElement&&(s||l)?(this._nextPopoverReferenceElement=o,s||this._onPopoverClose()):this._measurablePopoverReferenceElement=o}render(){return y`<div class=${R({content:!0,disabled:this._disabledOrInvalid})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`}_renderPopover(){let{_activePart:e,layout:t,popoverDisplay:r,popoverLabel:a,popoverPlacement:n,valueLabelsDisplay:o,valueLabelsPlacement:s}=this,l=this._measurablePopoverReferenceElement,c=this._hasPopoverContent&&!!l&&(r==="always"||!!e)&&this._nextPopoverReferenceElement==null,h=t==="horizontal"?n==="start"?"top":"bottom":n==="start"?"left":"right",u=14;return l&&l!=="track-range"&&(u-=1),o!=="hidden"&&n===s&&(u+=24),y`<calcite-popover class="popover" focus-trap-disabled .label=${a} .open=${c} .offsetDistance=${u} .placement=${h} .referenceElement=${l} scale=s trigger-disabled @calcitePopoverBeforeOpen=${this._onPopoverBeforeOpen} @calcitePopoverBeforeClose=${this._onPopoverBeforeClose} @calcitePopoverClose=${this._onPopoverClose} ${O(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`}_renderContentStart(){return y`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`}_renderContentEnd(){return y`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`}_renderTrackRange(){return y`<div class="track-container">${this._renderTrack()}<slot name=track-overlay></slot>${this._renderThumbs()}${this._renderLabelSeparators()}</div>`}_renderLabelSeparators(){let e=Math.max(0,this.values.length-1);return Array.from({length:e},(t,r)=>q(r,y`<div aria-hidden=true class="label-separator" hidden></div>`))}_renderTrack(){return y`<div class="track" ${O(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`}_renderTrackBackground(){let{max:e,min:t,fillPlacement:r,values:a}=this,n=a.length>1,o=this._fullMin,s=this._fullMax,l=[];return this._invalid?y`<div class="segment track-bounds" style=${z({left:"0%",right:"0%",top:"0%",bottom:"0%"})}></div>`:(o<t&&(l.push(this._renderSegment(o,t,[this.mirrored?"track-effective-end":"track-effective-start",!n&&r==="start"?"track-fill":null])),o=t),s>e&&(l.push(this._renderSegment(e,s,[this.mirrored?"track-effective-start":"track-effective-end",!n&&r==="end"?"track-fill":null])),s=e),l.push(this._renderSegment(o,s,["track-bounds"])),l)}_renderFillSegment(){let{values:e,min:t,max:r}=this;if(!e?.length||this._invalid)return;let a=[...e].sort((u,d)=>u-d),n=a[0],o=a[a.length-1],s=this._resolveFillPlacement(a.length>1),l;switch(s){case"start":t<n&&(l=this._renderSegment(t,n,["track-range"]));break;case"end":r>o&&(l=this._renderSegment(o,r,["track-range"]));break;case"between":a.length>1&&(l=this._renderSegment(n,o,["track-range"]));break;case"not-between":a.length>1&&(l=[this._renderSegment(t,n,["track-range"]),this._renderSegment(o,r,["track-range"])]);break}if(!(a.length>1))return l;let c=this.segmentsDraggingDisabled,h=this._renderSegment(n,o,["track-range-interactive",s==="between"?"filled":null,c?null:"interactive",this._activePart==="range"&&!this.segmentsDraggingDisabled?"active":null],{id:"track-range",onFocus:c?void 0:this._onTrackFocus,onBlur:c?void 0:this._onTrackBlur,onPointerDown:c?void 0:this._onTrackRangePointerDown,onKeyDown:c?void 0:this._onTrackRangeKeyDown});return[l,h]}_renderSegment(e,t,r,a){let{_fullMin:n,_fullMax:o,mirrored:s}=this,l=[N(n,o,T(e,n,o)),100-N(n,o,T(t,n,o))];s&&l.reverse();let c=this.isHorizontal?{left:`${l[0]}%`,right:`${l[1]}%`}:{top:`${l[1]}%`,bottom:`${l[0]}%`},h=ae("segment",...r);return y`<div id=${a?.id??E} class=${R(h)} style=${z(c)} .tabIndex=${a?.onPointerDown?0:-1} @focus=${a?.onFocus} @blur=${a?.onBlur} @pointerdown=${a?.onPointerDown} @keydown=${a?.onKeyDown}></div>`}_renderThumbs(){let{_sliderData:e}=this,t=Array.from(e.entries).filter(([,a])=>a>=this._fullMin&&a<=this._fullMax),r=t.map(([,a])=>a).sort((a,n)=>a-n);if(this.valuesDraggingDisabled&&r.length>1){let a=r[0],n=r.at(-1);if(a!=null&&n!=null){let o=(a+n)/2;return[this._renderFixedThumb(o),W(t,([s,l])=>this._renderThumb(s,l,!0))]}}return W(t,([a,n])=>this._renderThumb(a,n,!1))}_renderFixedThumb(e){let{_disabledOrInvalid:t,segmentsDraggingDisabled:r,isHorizontal:a}=this;return y`<div .ariaLabel=${this.messages.sliderValue} .ariaOrientation=${a?"horizontal":"vertical"} .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${e} class=${R({thumb:!0,"fixed-thumb":!0,active:this._activePart==="range"})} @blur=${this._onTrackBlur} @focus=${this._onTrackFocus} @keydown=${r?void 0:this._onTrackRangeKeyDown} @pointerdown=${r?this._onFixedThumbPointerDown:this._onTrackRangePointerDown} role=slider style=${z({...this._getPositionStyleForElement(e),"z-index":this._activePart==="range"?1:0})} .tabIndex=${t?-1:0}><div class="thumb-content"><span class="handle"></span></div></div>`}_renderThumb(e,t,r){let{valueLabelsDisplay:a}=this,n=this._disabledOrInvalid,o=!r&&(this._activePart===e||this._activePart==="range"),s=!r&&(this._activePart==="range"||this._activePart===e),l=a==="always"||a==="auto"&&(s||r&&this._activePart==="range"),c=this.isHorizontal,h=c?"horizontal":"vertical",u=`label-${e}`,d=c?"center":this.valueLabelsPlacement==="start"?"end":"start";return q(e,y`<div id=${e??E} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(a?u:void 0)??E} .ariaOrientation=${h} .ariaValueMin=${this.min} .ariaValueMax=${this.max} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${R({thumb:!0,active:o,"labels-only":r})} data-entry=${e??E} @pointerdown=${r?void 0:this._onThumbPointerDown} @focus=${r?void 0:this._onThumbFocus} @blur=${r?void 0:this._onThumbBlur} @keydown=${r?void 0:this._onThumbKeyDown} role=slider style=${z({...this._getPositionStyleForElement(t),"z-index":this._activePart===e?2:1})} .tabIndex=${r||n?-1:0}><div class="thumb-content"><span class="handle"></span><arcgis-label-input .alignment=${d} class="label" .hidden=${!l} id=${u??E} .labelFormatter=${this._valueFormatter} @focus=${n?void 0:this._onThumbFocus} @blur=${n?void 0:this._onThumbBlur} @arcgisChange=${this._onValueInputChange} .readOnly=${!this.valueLabelsEditingEnabled} tabindex=-1 .value=${t} ${O(this._makeResizeRef())}></arcgis-label-input></div></div>`)}_renderRangeLabel(e){let t="center";if(this.isHorizontal){t=e==="min"?"end":"start";let r=()=>{t=t==="end"?"start":"end"};this.rangeLabelsPlacement==="end"&&r(),this.mirrored&&r(),this._direction==="rtl"&&r()}return y`<arcgis-label-input .alignment=${t} class=${R(e)} data-type=${e??E} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`}};function Xe(i){return"dataset"in i&&i.tagName==="ARCGIS-LABEL-INPUT"&&(i.dataset.type==="min"||i.dataset.type==="max")}function V(i){let e=se(i,"[data-entry]");return e&&"dataset"in e?e.dataset.entry:null}function Ze(i){return typeof i!=null&&i!=="range"}function fe(i,e){return e?i.renderRoot.querySelector(`div[data-entry="${e}"]`):null}function Je(i,e){return e?i.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`):null}function be(i,e){return e?i.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`):null}function F(i){return i.isPrimary&&i.button===0}var Qe=5;function N(i,e,t){let r=e-i,a=(t-i)/r*100;return Number.parseFloat(a.toFixed(Qe))}function T(i,e,t){return Math.max(e,Math.min(t,i))}ie("arcgis-slider",J);return J},"core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor","core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as $}from"./GUL7EIJ4.js";import{a as y}from"./LLLQXE2U.js";import"./JYWWX277.js";import{d as k}from"./XMMFL5H3.js";import{a as n}from"./TE77L77R.js";import{J as w,K as l,L as v,N as f,P as p,S as E,h as g,j as i,k as h,n as m,t as s}from"./4IMLX5B4.js";function S(a,e,t){window.localStorage.setItem(a,JSON.stringify(e))}function I(a,e){let t=window.localStorage.getItem(a);return t&&e?JSON.parse(t):t}var R=g`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px;container-type:inline-size}.preview-swatch-no-color{overflow:hidden;block-size:inherit;inline-size:inherit;rect{transition-property:all;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1)}rect{fill:var(--calcite-theme-color-surface-2, var(--calcite-color-surface-2))}line{stroke:var(--calcite-color-status-danger)}}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}.swatch-group{line-height:16px}`,d=class extends v{constructor(){super(),this._messages=y(),this.actionEl=w(),this.open=!1,this.setRecentColorElement=e=>t=>{switch(e){case 1:this.recentColor1El=t;break;case 2:this.recentColor2El=t;break;default:this.recentColor3El=t}},this.recentColors=[],this.clearable=!1,this.compact=!1,this.disabled=!1,this.placement="auto",this.storageId="arcgis-color-input-storage-colors",this.hideRecentColors=!1,this.showTransparency=!1,this.arcgisChange=s(),this.arcgisColorInputChange=s(),this.arcgisColorInputPopoverClose=s(),this.arcgisColorInputPopoverOpen=s(),this.arcgisColorInputSwatchUpdate=s(),this.arcgisInternalStoredColor=s(),this.arcgisPickerClose=s(),this.arcgisPickerOpen=s(),this.arcgisSwatchUpdate=s(),this.listenOn(document,"arcgisInternalStoredColor",this.handleUpdateRecentColors),this.listenOn(document,"arcgisRecentColorsUpdate",this.handleStoreNewRecentColor)}static{this.properties={recentColors:16,clearable:5,color:1,compact:5,disabled:5,messageOverrides:0,placement:1,popoverProps:0,storageId:1,hideRecentColors:5,showTransparency:5}}static{this.styles=R}async close(){await this.inlineInputEl?.close({focus:!1})}async setFocus(){await this.inlineInputEl?.setFocus()}isOpen(){return this.open}load(){this.setRecentColorsFromStorage()}disconnectedCallback(){super.disconnectedCallback(),this.removeTooltip()}async handleOpen(){await this.colorPickerEl?.setFocus(),this.open=!0,this.arcgisPickerOpen.emit(),this.arcgisColorInputPopoverOpen.emit()}setInlineInputRef(e){this.inlineInputEl=e}setColorPickerRef(e){e&&(this.colorPickerEl=e)}getRecentColorElement(e){switch(e){case 1:return this.recentColor1El;case 2:return this.recentColor2El;default:return this.recentColor3El}}setRecentColorsFromStorage(){let e=I(this.storageId,!0);e&&(this.recentColors=[...e])}handleSwatchClickOrKeyUp(e){if("key"in e&&e.key!=="Enter"&&e.key!=="Space")return;let t=e.currentTarget.color||void 0;this.updateColor(t),this.arcgisSwatchUpdate.emit(t),this.arcgisColorInputSwatchUpdate.emit(t),setTimeout(()=>this.recentColor1El?.focus(),200)}handleRecentColorsKeyDown(e){if(this.recentColors.length===1)return;let t=e.key,o;this.activeColorSwatchEl===this.recentColor1El?o=1:this.activeColorSwatchEl===this.recentColor2El?o=2:this.activeColorSwatchEl===this.recentColor3El&&(o=3),t==="ArrowLeft"&&(!o||o===1?this.getRecentColorElement(this.recentColors.length)?.focus():this.getRecentColorElement(o-1)?.focus()),t==="ArrowRight"&&(!o||o===this.recentColors.length?this.recentColor1El?.focus():this.getRecentColorElement(o+1)?.focus())}handleUpdateActiveSwatch(e){this.activeColorSwatchEl=e.currentTarget}handleStoreNewRecentColor(e){this.storeRecentColorToStorage(e.detail)}handleUpdateRecentColors(e){e.composedPath().includes(this.el)||this.setRecentColorsFromStorage()}handleClearColor(){this.updateColor(void 0)}updateColor(e,t=!0){e!==this.color&&(this.color=e,this.arcgisChange.emit(),this.arcgisColorInputChange.emit(),t&&this.storeRecentColorToStorage(e))}storeRecentColorToStorage(e){if(!e)return;e.length>7&&(e=e.slice(0,7));let t=[e,...this.recentColors.filter(o=>o!==e)].slice(0,3);S(this.storageId,t),this.recentColors=t,this.arcgisInternalStoredColor.emit()}handleClose(e){e.stopPropagation(),this.storeRecentColorToStorage(this.colorPickerEl?.value),this.open=!1,this.arcgisPickerClose.emit(this.colorPickerEl?.value),this.arcgisColorInputPopoverClose.emit(this.colorPickerEl?.value)}addTooltip(e){this.removeTooltip(),this.tooltipContainerEl=document.createElement("div"),m(i`<calcite-tooltip .placement=${e.placement??"auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`,this.tooltipContainerEl),document.body.append(this.tooltipContainerEl)}removeTooltip(){this.tooltipContainerEl?.parentNode&&(this.tooltipContainerEl.remove(),this.tooltipContainerEl=void 0)}render(){let{compact:e,disabled:t,recentColors:o,_messages:r}=this,C=[o[0],o[1]],b=k(this.el)==="rtl";return e||C.push(o[2]),i`<arcgis-picker-input .disabled=${t} .intlDone=${r.commitColor} .heading=${r.selectColor} .label=${r.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${l(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e?"--compact":""}`,i`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${$(c=>{c.stopPropagation(),this.updateColor(this.colorPickerEl.value,!1)},500)} .scale=${e?"s":"m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${l(this.setColorPickerRef)}></calcite-color-picker>`)}</div>${this.color?i`<div slot=preview style=${f({backgroundColor:this.color})} class="preview-swatch" aria-label=${r.selectColor??""??p}></div>`:i`<div slot=preview class="preview-swatch" aria-label=${r.selectColor??""??p}><svg xmlns=http://www.w3.org/2000/svg class="preview-swatch-no-color">${h`<clipPath id=shape><rect height=100% width=100% rx=0 /></clipPath><rect clip-path="inset(0 round 0)" height=100% rx=0 stroke="rgba(0, 0, 0, 0.3)" stroke-width=2 width=100% /><line clip-path=url(#shape) stroke-width=3 x1=100% x2=0 y1=0 y2=100% />`}</svg></div>`}${!this.hideRecentColors&&i`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1><calcite-swatch-group selection-mode=single .label=${r.recentColors??""} scale=s class="swatch-group">${C.map((c,u)=>c?n(c,i`<calcite-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .selected=${c===this.color} .color=${c} .label=${r.selectColor??""} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${l(this.setRecentColorElement(u+1))}></calcite-swatch>`):this.renderEmptySwatch(`empty-swatch-${u}`))}</calcite-swatch-group></div>`||""}${this.clearable&&i`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${r.clearColor} .text=${r.clearColor??""} @click=${this.handleClearColor} @mouseover=${()=>this.addTooltip({referenceElement:this.actionEl.value,placement:b?"right-start":"left-start",innerHTML:r.noColor??""})} @mouseout=${()=>this.removeTooltip()} ${l(this.actionEl)}></calcite-action></div>`||""}</arcgis-picker-input>`}renderEmptySwatch(e){return n(e,i`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${h`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`)}};E("arcgis-color-input",d);export{d as ArcgisColorInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{a as C}from"./SRO2CZ77.js";import{a as S}from"./CFEMTMZX.js";import{a as T,b as E}from"./BDIGRQ2U.js";import{a as P}from"./LLLQXE2U.js";import"./JYWWX277.js";import"./XMMFL5H3.js";import{a as L}from"./TE77L77R.js";import{J as p,K as d,L as k,M as v,N as $,P as m,Q as y,S as B,h as x,j as o,o as F,p as I,t as h}from"./4IMLX5B4.js";var a=new Map;a.set("oid","key");a.set("guid","key");a.set("global-id","key");a.set("blob","binary");a.set("integer","integer");a.set("small-integer","integer");a.set("big-integer","integer");a.set("single","number");a.set("double","number");a.set("long","number");a.set("number","number");a.set("date","date-time");a.set("date-only","calendar");a.set("time-only","clock");a.set("timestamp-offset","time-zone");a.set("string","string");var N=({fieldType:n})=>o`<calcite-icon scale=s .icon=${a.get(n)}></calcite-icon>`;function _(n){return!!n.length&&"fields"in n[0]}function u(n){return!!n.length&&"subFieldInfos"in n[0]}function D(n){return n.filter(e=>u(e.fields))}function O(n){return n.flatMap(e=>e.fields)}function A(n){return n.flatMap(e=>u(e.fields)?[]:e.fields)}function f(n){return n.flatMap(e=>u(e.fields)?e.fields.flatMap(t=>t.subFieldInfos):e.fields)}function M(n,e){return n.flatMap(t=>u(t.fields)?t.fields.flatMap(i=>i.subFieldInfos.filter(s=>g(s,e,!0))):t.fields.filter(i=>w(i,e)))}function w(n,e){return e?"subFieldInfos"in n?g(n,e)||n.subFieldInfos.some(t=>g(t,e,!0)):g(n,e):!0}function g(n,e,t=!1){return[t?n.name.split("/").pop():n.name,n.alias,n.description].some(i=>i?.toLocaleLowerCase().includes(e.toLocaleLowerCase()))}var H=x`.panel{min-height:250px}.list-wrapper{max-height:50vh;overflow:auto}.list-controls{display:grid;grid-template-columns:1fr auto}.field-icons{display:flex;align-items:center;padding:0 var(--calcite-space-sm)}.selection-button-div{padding:var(--calcite-space-2xs) var(--calcite-space-sm-plus)}.no-match-text{padding:var(--calcite-space-md)}.footer{width:100%}.add-cancel-buttons{display:flex;align-content:space-between}`,b=class extends k{constructor(){super(...arguments),this._messages=P({blocking:!0}),this.popoverNode=p(),this.listWrapper=p(),this.listNode=p(),this.flowElement=p(),this.panelElement=p(),this.dropdownNode=p(),this.fieldInfoFlowItemEl=p(),this.allLists=[],this.filterText="",this.panelCutOffHeight=0,this.initialized=!1,this._propWatcherTask=new T(this,{task:async([e])=>{if(!this.listOnly&&!E(e?.refElement))throw F("error",this,I("popoverProps")),new Error;this._propWatcherTask.autoRun=!1},args:()=>[this.popoverProps]}),this.fields=[],this.selectedFields=[],this.listOnly=!1,this.showFieldInfo=!1,this.showFieldTypeIcon=!1,this.showFieldName=!1,this.showDescription=!1,this.showSelectionAll=!1,this.showCancel=!0,this.hideCancel=!1,this.showSort=!0,this.hideSort=!1,this.showFilterLength=10,this.multiple=!1,this.sortBy="default",this.groupFieldsAndExpressions=!1,this.arcgisChange=h(),this.arcgisClose=h(),this.arcgisDeleteField=h(),this.arcgisEditField=h(),this.arcgisFieldPickListChange=h(),this.arcgisFieldPickListDismissed=h(),this.arcgisFieldPickListSortByChange=h(),this.arcgisSortByChange=h()}static{this.properties={lastSortBy:16,filterFields:16,mapView:0,view:0,layer:0,fields:0,selectedFields:0,listOnly:5,popoverProps:0,showFieldInfo:5,showFieldTypeIcon:5,showFieldName:5,showDescription:5,showSelectionAll:5,showCancel:5,hideCancel:5,showSort:5,hideSort:5,showFilterLength:9,multiple:5,heading:1,okBtnText:1,filterPlaceholderText:1,filterNoResultsText:1,sortBy:1,groupFieldsAndExpressions:5,fieldsGroupHeading:1,expressionsGroupHeading:1,customExpressionCheck:0}}static{this.styles=H}async reposition(){await this.popoverNode.value?.reposition()}async setDisabled(e){this.panelElement.value&&(this.panelElement.value.disabled=e)}async setFocus(){setTimeout(()=>requestAnimationFrame(()=>{this.listOnly?this.listNode.value?.setFocus():this.panelElement.value?.setFocus()}),1)}load(){!this.view&&this.mapView&&(this.view=this.mapView),!this.showCancel&&!this.hideCancel&&(this.hideCancel=!0),!this.showSort&&!this.hideSort&&(this.hideSort=!0),this.listOnly&&this.showFieldInfo&&(this.showFieldInfo=!1,F("info",this,"showFieldInfo is not supported if listOnly is true.")),!this.multiple&&this.selectedFields.length>1&&(this.selectedFields=[this.selectedFields[0]]),this.lastSortBy=this.sortBy??this.lastSortBy,this.updateGroupedLists(),this.initialized=!0}willUpdate(e){this.initialized&&(e.has("fields")||e.has("sortBy")||e.has("lastSortBy")||e.has("customExpressionCheck"))&&(e.has("sortBy")&&(this.lastSortBy=this.sortBy??this.lastSortBy),this.updateGroupedLists())}loaded(){this.setUpObserver(),this.listOnly?this.listNode.value?.setFocus():(this.flowElement.value?.setFocus(),this.checkMaxHeight())}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}setUpObserver(){this.observer=new MutationObserver(e=>{for(let t of e)t.attributeName==="style"&&this.popoverNode.value&&this.dropdownNode.value&&this.popoverNode.value.style.visibility==="hidden"&&(this.dropdownNode.value.open=!1)})}checkMaxHeight(){setTimeout(()=>this.checkPanelMaxHeight(),200),setTimeout(()=>this.checkPanelMaxHeight(),500),setTimeout(()=>this.checkPanelMaxHeight(),1e3),setTimeout(()=>this.checkPanelMaxHeight(),1500)}checkPanelMaxHeight(){if(this.panelCutOffHeight===0){let e=this.panelElement.value?.getBoundingClientRect();if(e&&e.bottom>window.innerHeight){this.panelCutOffHeight=e.height-(e.bottom-window.innerHeight)-5;let t=this.listWrapper.value?.getBoundingClientRect();t&&(this.listWrapper.value.style.maxHeight=`${t.height-(e.bottom-window.innerHeight)-5}px`)}}}getSortedList(e){let t=[...e],i=t.filter(s=>s.type==="none");return t=t.filter(s=>s.type!=="none"),this.lastSortBy==="display"?t.sort((s,l)=>s.alias.localeCompare(l.alias)):this.lastSortBy==="field"?t.sort((s,l)=>s.name.localeCompare(l.name)):this.lastSortBy==="type"&&t.sort((s,l)=>s.type.localeCompare(l.type)),t=t.concat(i),t}isExpression(e){return this.customExpressionCheck?this.customExpressionCheck(e):e.name.includes(S.expression)}canDeselectAll(){let e=f(this.allLists);return this.filterFields?.length?this.filterContainsAll():this.selectedFields.length===e.length}filterContainsAll(){return!!this.filterFields?.every(e=>this.selectedFields.some(t=>t===e))}showFieldInfoCheck(e){let{layer:t}=this;return this.showFieldInfo?!(!t||this.isExpression(e)||e.name.includes(S.relationship)||e.type==="none"):!1}updateGroupedLists(){if(this.fields)if(this.allLists=[],_(this.fields))for(let e of this.fields){if(this.listOnly&&u(e.fields)){F("error",this,"subFieldInfos are not supported if listOnly is true.");continue}this.allLists.push({title:e.title,fields:this.getSortedGroupFields(e.fields)})}else this.allLists=this.groupFieldsAndExpressions?[{title:this.expressionsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>this.isExpression(e))},{title:this.fieldsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>!this.isExpression(e))}]:[{title:void 0,fields:this.getSortedList(this.fields)}]}getSortedGroupFields(e){return u(e)?this.getSortedList(e).map(t=>({...t,subFieldInfos:this.getSortedList(t.subFieldInfos).map(i=>({...i,name:`${t.name}/${i.name}`}))})):this.getSortedList(e)}addFieldInfoFlowItem(e,t){let i=this.flowElement.value,s=y(o`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.name} class="panel" style=${$(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${l=>{l.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang??m} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);i.appendChild(s),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl?.value.setFocus()},1)}addSubFieldInfoFlowItem(e,t){let i=this.flowElement.value,s=e.subFieldInfos.filter(r=>g(r,this.filterText,!0)),l=y(o`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.description??void 0} class="panel" style=${$(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${r=>{r.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias??e.name} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${r=>{this.updateSelectedFieldsForList(r.currentTarget,e.subFieldInfos),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||(this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields}))}}>${s.map(r=>this.renderCalciteListItem(r,!1))}</calcite-list>${this.filterText&&!s.length&&this.filterNoResultsText?.length!==0?o`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}</calcite-flow-item>`);i.appendChild(l),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl.value?.setFocus()},1)}shouldRenderSelectionButton(e){return this.multiple&&this.showSelectionAll&&(!e||!this.filterText||!!this.filterFields?.length)}handleListSelectionChange(e){this.updateSelectedFieldsForList(this.listNode.value,e),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||(this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields}))}updateSelectedFieldsForList(e,t){let i=new Set(t.map(c=>c.name)),s=e.selectedItems.map(c=>c.value),l=this.selectedFields.filter(c=>!i.has(c)||s.includes(c)),r=s.filter(c=>!this.selectedFields.includes(c));this.selectedFields=this.multiple?[...new Set([...l,...r])]:s,this.reorderSelectedFieldsByCurrentListOrder()}setSortBy(e){this.lastSortBy=e,this.updateGroupedLists(),this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy),this.reorderSelectedFieldsByCurrentListOrder()&&(this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}))}reorderSelectedFieldsByCurrentListOrder(){if(!this.selectedFields.length)return!1;let e=f(this.allLists).map(l=>l.name),t=new Set(this.selectedFields),i=e.filter(l=>t.has(l)),s=i.length!==this.selectedFields.length||i.some((l,r)=>l!==this.selectedFields[r]);return s&&(this.selectedFields=[...i]),s}render(){return this._propWatcherTask.render({complete:()=>{if(this.listOnly)return this.renderList();let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=this.popoverProps;return this.el.classList.add("js-app-flyout"),L(`${t.autoClose}`,o`<calcite-popover .placement=${t.placement??"leading-start"} open pointer-disabled .referenceElement=${t.refElement} .offsetDistance=${t.offsetDistance??-Math.round(t.refElement.getBoundingClientRect().width)} .offsetSkidding=${t.offsetSkidding??0} .overlayPositioning=${t.overlayPositioning} trigger-disabled .autoClose=${t.autoClose} .label=${this.heading??(this.multiple?this._messages.headerSelect:this._messages.header)??""} @calcitePopoverClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${d(this.popoverNode)}><calcite-flow style=${$({width:`${t.popoverWidth??t.refElement.getBoundingClientRect().width}px`,...t.maxHeight&&{maxHeight:t.maxHeight}})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${d(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple||!this.hideCancel)&&o`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple&&!this.hideCancel?o`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>`:o`${this.renderAddButton()}${this.renderCancelButton()}`}</div>`||""}</calcite-flow-item></calcite-flow></calcite-popover>`)},error:()=>""})}renderList(){let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=A(this.allLists),i=D(this.allLists),s=f(this.allLists).length>=this.showFilterLength;return t.length||i.length?i.length?this.renderSplitLists(t,i,s):this.renderTopLevelOnlyFieldList(e,t,s):o`<slot name=no-fields></slot>`}renderSplitLists(e,t,i){let s=f(this.allLists),l=O(this.allLists).some(r=>w(r,this.filterText));return o`${i?o`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name","alias","description"]} .placeholder=${this.filterPlaceholderText??this._messages.filter} @calciteFilterChange=${r=>{this.filterText=r.currentTarget.value,this.filterFields=this.filterText?M(this.allLists,this.filterText).map(c=>c.name):void 0}}></calcite-filter>${this.renderSortButton()}</div>`:null}<div class=${v(this.listOnly?"":"list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i)?this.renderSelectionButton():null}${this.renderSplitSubFieldLists(t)}${e.length?this.renderSplitTopLevelFieldList(e,!0):null}</div>${this.filterText&&!l&&this.filterNoResultsText?.length!==0?o`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}`}renderSplitSubFieldLists(e){let t=e.map(i=>({...i,fields:i.fields.filter(s=>w(s,this.filterText))})).filter(i=>!!i.fields.length);return C(t,i=>i.title,i=>o`<calcite-list selection-mode=none .label=${i.title??this.heading??""}><calcite-list-item-group .heading=${i.title}>${C(i.fields,s=>s.name,s=>o`<calcite-list-item .label=${s.alias||s.name} .description=${this.multiple?this._messages.subFieldsSelected.replace("${count}",`${s.subFieldInfos.filter(l=>this.selectedFields.includes(l.name)).length}`):void 0} .value=${s.name} @click=${l=>this.addSubFieldInfoFlowItem(s,l.currentTarget)} @keydown=${l=>{l.key==="Enter"&&this.addSubFieldInfoFlowItem(s,l.currentTarget)}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`)}renderSplitTopLevelFieldList(e,t){return o`<calcite-list .label=${this.heading||(this.multiple?this._messages.headerSelect:this._messages.header)} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${()=>this.handleListSelectionChange(e)} ${d(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`}renderTopLevelOnlyFieldList(e,t,i){return o`<div class=${v(this.listOnly?"":"list-wrapper")} ${d(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple?"multiple":"single"} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText??this._messages.filter} @calciteListChange=${()=>this.handleListSelectionChange(t)} @calciteListFilter=${s=>{s.stopPropagation(),this.filterFields=this.listNode.value.filteredItems?.map(l=>l.value),this.filterText=this.listNode.value.filterText}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(i)?this.renderSelectionButton():null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`}renderSortButton(e){let t=f(this.allLists);if(!(t.length>=this.showFilterLength&&!this.hideSort))return"";let i=t.every(s=>!!s.type);return o`<calcite-dropdown slot=${e??m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${()=>{this.observer?.disconnect(),this.popoverNode.value&&this.observer?.observe(this.popoverNode.value,{attributes:!0})}} @calciteDropdownClose=${()=>this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort??""} title=${this._messages.sort??m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy==="default"} @calciteDropdownItemSelect=${()=>this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy==="display"} @calciteDropdownItemSelect=${()=>this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${i&&o`<calcite-dropdown-item .selected=${this.lastSortBy==="type"} @calciteDropdownItemSelect=${()=>this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>`||""}<calcite-dropdown-item .selected=${this.lastSortBy==="field"} @calciteDropdownItemSelect=${()=>this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderSelectionButton(){return o`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${()=>{if(this.canDeselectAll())this.selectedFields=this.filterFields?.length?this.selectedFields.filter(e=>!this.filterFields?.includes(e)):[];else if(this.filterFields?.length)this.selectedFields=[...new Set([...this.selectedFields,...this.filterFields])];else{let e=f(this.allLists);this.selectedFields=e.map(t=>t.name)}this.reorderSelectedFieldsByCurrentListOrder(),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields})}}>${this.canDeselectAll()?this._messages.deselectAll:this._messages.selectAll}</calcite-button></div>`}renderGroupedListItems(e){let t=this.allLists.filter(i=>!!i.fields.length&&!u(i.fields)).map(i=>({...i,fields:e?i.fields.filter(s=>w(s,this.filterText)):i.fields})).filter(i=>!!i.fields.length);return t.length===1&&!t[0].title?this.renderListItems(t[0].fields):t.map(i=>o`<calcite-list-item-group .heading=${i.title}>${this.renderListItems(i.fields)}</calcite-list-item-group>`)}renderListItems(e){return e.map(t=>this.renderCalciteListItem(t))}renderCalciteListItem(e,t=!0){let i=t&&this.showFieldInfoCheck(e),s=this.showFieldTypeIcon&&!!e.type;return L(e.name,o`<calcite-list-item .label=${e.alias||e.name} .description=${(()=>{if(this.showFieldName&&e.hideFieldName!==!0)return`{${e.name}}`;if(this.showDescription&&e.hideDescription!==!0&&e.description)return e.description})()} .value=${e.name} .selected=${!this.multiple&&e.name===this.selectedFields[0]||this.multiple&&this.selectedFields.includes(e.name)} .metadata=${{label:e.alias,fieldName:e.name}}>${s&&o`<div slot=actions-end class="field-icons">${N({fieldType:e.type})}</div>`||""}${this.renderInfoAction(e,i)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`)}renderInfoAction(e,t){let{_messages:i}=this;return t?o`<calcite-action slot=actions-end .text=${i.info} title=${i.info??m} scale=s icon=information @click=${s=>{s.stopPropagation();let l=s.currentTarget;this.addFieldInfoFlowItem(e,l)}}></calcite-action>`:""}renderEditAction(e){let{_messages:t}=this;return e.showEditAction?o`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit??m} scale=s icon=pencil @click=${i=>{i.stopPropagation(),this.arcgisEditField.emit({fieldName:e.name})}}></calcite-action>`:""}renderDeleteAction(e){let{_messages:t}=this;return e.showDeleteAction?o`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete??m} scale=s icon=trash @click=${i=>{i.stopPropagation(),this.arcgisDeleteField.emit({fieldName:e.name})}}></calcite-action>`:""}renderAddButton(){return this.multiple?o`<calcite-button .appearance=${this.hideCancel?"outline-fill":"solid"} .width=${this.hideCancel?"full":"half"} @click=${()=>{this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields})}}>${this.okBtnText||(this.multiple?this._messages.done:this._messages.ok)}</calcite-button>`:""}renderCancelButton(){return this.hideCancel?"":o`<calcite-button appearance=outline-fill .width=${this.multiple?"half":"full"} @click=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}}>${this._messages.cancel}</calcite-button>`}};B("arcgis-field-pick-list",b);export{b as ArcgisFieldPickList};
2
+ import{a as C}from"./SRO2CZ77.js";import{a as S}from"./CFEMTMZX.js";import{a as T,b as E}from"./BDIGRQ2U.js";import{a as P}from"./LLLQXE2U.js";import"./JYWWX277.js";import"./XMMFL5H3.js";import{a as L}from"./TE77L77R.js";import{J as p,K as d,L as k,M as v,N as $,P as m,Q as y,S as B,h as x,j as o,o as F,p as I,t as h}from"./4IMLX5B4.js";var a=new Map;a.set("oid","key");a.set("guid","key");a.set("global-id","key");a.set("blob","binary");a.set("integer","integer");a.set("small-integer","integer");a.set("big-integer","integer");a.set("single","number");a.set("double","number");a.set("long","number");a.set("number","number");a.set("date","date-time");a.set("date-only","calendar");a.set("time-only","clock");a.set("timestamp-offset","time-zone");a.set("string","string");var N=({fieldType:n})=>o`<calcite-icon scale=s .icon=${a.get(n)}></calcite-icon>`;function _(n){return!!n.length&&"fields"in n[0]}function u(n){return!!n.length&&"subFieldInfos"in n[0]}function O(n){return n.filter(e=>u(e.fields))}function D(n){return n.flatMap(e=>e.fields)}function A(n){return n.flatMap(e=>u(e.fields)?[]:e.fields)}function f(n){return n.flatMap(e=>u(e.fields)?e.fields.flatMap(t=>t.subFieldInfos):e.fields)}function M(n,e){return n.flatMap(t=>u(t.fields)?t.fields.flatMap(i=>i.subFieldInfos.filter(s=>g(s,e,!0))):t.fields.filter(i=>w(i,e)))}function w(n,e){return e?"subFieldInfos"in n?g(n,e)||n.subFieldInfos.some(t=>g(t,e,!0)):g(n,e):!0}function g(n,e,t=!1){return[t?n.name.split("/").pop():n.name,n.alias,n.description].some(i=>i?.toLocaleLowerCase().includes(e.toLocaleLowerCase()))}var H=x`.panel{min-height:250px}.list-wrapper{max-height:50vh;overflow:auto}.list-controls{display:grid;grid-template-columns:1fr auto}.field-icons{display:flex;align-items:center;padding:0 var(--calcite-space-sm)}.selection-button-div{padding:var(--calcite-space-2xs) var(--calcite-space-sm-plus)}.no-match-text{padding:var(--calcite-space-md)}.footer{width:100%}.add-cancel-buttons{display:flex;align-content:space-between}`,b=class extends k{constructor(){super(...arguments),this._messages=P({blocking:!0}),this.popoverNode=p(),this.listWrapper=p(),this.listNode=p(),this.flowElement=p(),this.panelElement=p(),this.dropdownNode=p(),this.fieldInfoFlowItemEl=p(),this.allLists=[],this.filterText="",this.panelCutOffHeight=0,this.initialized=!1,this._propWatcherTask=new T(this,{task:async([e])=>{if(!this.listOnly&&!E(e?.refElement))throw F("error",this,I("popoverProps")),new Error;this._propWatcherTask.autoRun=!1},args:()=>[this.popoverProps]}),this.fields=[],this.selectedFields=[],this.listOnly=!1,this.showFieldInfo=!1,this.showFieldTypeIcon=!1,this.showFieldName=!1,this.showDescription=!1,this.showSelectionAll=!1,this.showCancel=!0,this.hideCancel=!1,this.showSort=!0,this.hideSort=!1,this.showFilterLength=10,this.multiple=!1,this.sortBy="default",this.groupFieldsAndExpressions=!1,this.arcgisChange=h(),this.arcgisClose=h(),this.arcgisDeleteField=h(),this.arcgisEditField=h(),this.arcgisFieldPickListChange=h(),this.arcgisFieldPickListDismissed=h(),this.arcgisFieldPickListSortByChange=h(),this.arcgisSortByChange=h()}static{this.properties={lastSortBy:16,filterFields:16,mapView:0,view:0,layer:0,fields:0,selectedFields:0,listOnly:5,popoverProps:0,showFieldInfo:5,showFieldTypeIcon:5,showFieldName:5,showDescription:5,showSelectionAll:5,showCancel:5,hideCancel:5,showSort:5,hideSort:5,showFilterLength:9,multiple:5,heading:1,okBtnText:1,filterPlaceholderText:1,filterNoResultsText:1,sortBy:1,groupFieldsAndExpressions:5,fieldsGroupHeading:1,expressionsGroupHeading:1,customExpressionCheck:0}}static{this.styles=H}async reposition(){await this.popoverNode.value?.reposition()}async setDisabled(e){this.panelElement.value&&(this.panelElement.value.disabled=e)}async setFocus(){setTimeout(()=>requestAnimationFrame(()=>{this.listOnly?this.listNode.value?.setFocus():this.panelElement.value?.setFocus()}),1)}load(){!this.view&&this.mapView&&(this.view=this.mapView),!this.showCancel&&!this.hideCancel&&(this.hideCancel=!0),!this.showSort&&!this.hideSort&&(this.hideSort=!0),this.listOnly&&this.showFieldInfo&&(this.showFieldInfo=!1,F("info",this,"showFieldInfo is not supported if listOnly is true.")),!this.multiple&&this.selectedFields.length>1&&(this.selectedFields=[this.selectedFields[0]]),this.lastSortBy=this.sortBy??this.lastSortBy,this.updateGroupedLists(),this.initialized=!0}willUpdate(e){this.initialized&&(e.has("fields")||e.has("sortBy")||e.has("lastSortBy")||e.has("customExpressionCheck"))&&(e.has("sortBy")&&(this.lastSortBy=this.sortBy??this.lastSortBy),this.updateGroupedLists())}loaded(){this.setUpObserver(),this.listOnly?this.listNode.value?.setFocus():(this.flowElement.value?.setFocus(),this.checkMaxHeight())}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}setUpObserver(){this.observer=new MutationObserver(e=>{for(let t of e)t.attributeName==="style"&&this.popoverNode.value&&this.dropdownNode.value&&this.popoverNode.value.style.visibility==="hidden"&&(this.dropdownNode.value.open=!1)})}checkMaxHeight(){setTimeout(()=>this.checkPanelMaxHeight(),200),setTimeout(()=>this.checkPanelMaxHeight(),500),setTimeout(()=>this.checkPanelMaxHeight(),1e3),setTimeout(()=>this.checkPanelMaxHeight(),1500)}checkPanelMaxHeight(){if(this.panelCutOffHeight===0){let e=this.panelElement.value?.getBoundingClientRect();if(e&&e.bottom>window.innerHeight){this.panelCutOffHeight=e.height-(e.bottom-window.innerHeight)-5;let t=this.listWrapper.value?.getBoundingClientRect();t&&(this.listWrapper.value.style.maxHeight=`${t.height-(e.bottom-window.innerHeight)-5}px`)}}}getSortedList(e){let t=[...e],i=t.filter(s=>s.type==="none");return t=t.filter(s=>s.type!=="none"),this.lastSortBy==="display"?t.sort((s,l)=>s.alias.localeCompare(l.alias)):this.lastSortBy==="field"?t.sort((s,l)=>s.name.localeCompare(l.name)):this.lastSortBy==="type"&&t.sort((s,l)=>s.type.localeCompare(l.type)),t=t.concat(i),t}isExpression(e){return this.customExpressionCheck?this.customExpressionCheck(e):e.name.includes(S.expression)}canDeselectAll(){let e=f(this.allLists);return this.filterFields?.length?this.filterContainsAll():this.selectedFields.length===e.length}filterContainsAll(){return!!this.filterFields?.every(e=>this.selectedFields.some(t=>t===e))}showFieldInfoCheck(e){let{layer:t}=this;return this.showFieldInfo?!(!t||this.isExpression(e)||e.name.includes(S.relationship)||e.type==="none"):!1}updateGroupedLists(){if(this.fields)if(this.allLists=[],_(this.fields))for(let e of this.fields){if(this.listOnly&&u(e.fields)){F("error",this,"subFieldInfos are not supported if listOnly is true.");continue}this.allLists.push({title:e.title,fields:this.getSortedGroupFields(e.fields)})}else this.allLists=this.groupFieldsAndExpressions?[{title:this.expressionsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>this.isExpression(e))},{title:this.fieldsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>!this.isExpression(e))}]:[{title:void 0,fields:this.getSortedList(this.fields)}]}getSortedGroupFields(e){return u(e)?this.getSortedList(e).map(t=>({...t,subFieldInfos:this.getSortedList(t.subFieldInfos).map(i=>({...i,name:`${t.name}/${i.name}`}))})):this.getSortedList(e)}addFieldInfoFlowItem(e,t){let i=this.flowElement.value,s=y(o`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.name} class="panel" style=${$(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${l=>{l.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${d(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang??m} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);i.appendChild(s),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl?.value.setFocus()},1)}addSubFieldInfoFlowItem(e,t){let i=this.flowElement.value,s=e.subFieldInfos.filter(r=>g(r,this.filterText,!0)),l=y(o`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.description??void 0} class="panel" style=${$(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${r=>{r.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${d(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias??e.name} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${r=>{this.updateSelectedFieldsForList(r.currentTarget,e.subFieldInfos),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||(this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields}))}}>${s.map(r=>this.renderCalciteListItem(r,!1))}</calcite-list>${this.filterText&&!s.length&&this.filterNoResultsText?.length!==0?o`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}</calcite-flow-item>`);i.appendChild(l),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl.value?.setFocus()},1)}shouldRenderSelectionButton(e){return this.multiple&&this.showSelectionAll&&(!e||!this.filterText||!!this.filterFields?.length)}handleListSelectionChange(e){this.updateSelectedFieldsForList(this.listNode.value,e),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||(this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields}))}updateSelectedFieldsForList(e,t){let i=new Set(t.map(c=>c.name)),s=e.selectedItems.map(c=>c.value),l=this.selectedFields.filter(c=>!i.has(c)||s.includes(c)),r=s.filter(c=>!this.selectedFields.includes(c));this.selectedFields=this.multiple?[...new Set([...l,...r])]:s,this.reorderSelectedFieldsByCurrentListOrder()}setSortBy(e){this.lastSortBy=e,this.updateGroupedLists(),this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy),this.reorderSelectedFieldsByCurrentListOrder()&&(this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}))}reorderSelectedFieldsByCurrentListOrder(){if(!this.selectedFields.length)return!1;let e=f(this.allLists).map(l=>l.name),t=new Set(this.selectedFields),i=e.filter(l=>t.has(l)),s=i.length!==this.selectedFields.length||i.some((l,r)=>l!==this.selectedFields[r]);return s&&(this.selectedFields=[...i]),s}render(){return this._propWatcherTask.render({complete:()=>{if(this.listOnly)return this.renderList();let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=this.popoverProps;return this.el.classList.add("js-app-flyout"),L(`${t.autoClose}`,o`<calcite-popover .placement=${t.placement??"leading-start"} open pointer-disabled .referenceElement=${t.refElement} .offsetDistance=${t.offsetDistance??-Math.round(t.refElement.getBoundingClientRect().width)} .offsetSkidding=${t.offsetSkidding??0} .overlayPositioning=${t.overlayPositioning} trigger-disabled .autoClose=${t.autoClose} .label=${this.heading??(this.multiple?this._messages.headerSelect:this._messages.header)??""} @calcitePopoverClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${d(this.popoverNode)}><calcite-flow style=${$({width:`${t.popoverWidth??t.refElement.getBoundingClientRect().width}px`,...t.maxHeight&&{maxHeight:t.maxHeight}})} ${d(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${d(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple||!this.hideCancel)&&o`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple&&!this.hideCancel?o`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>`:o`${this.renderAddButton()}${this.renderCancelButton()}`}</div>`||""}</calcite-flow-item></calcite-flow></calcite-popover>`)},error:()=>""})}renderList(){let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=A(this.allLists),i=O(this.allLists),s=f(this.allLists).length>=this.showFilterLength;return t.length||i.length?i.length?this.renderSplitLists(t,i,s):this.renderTopLevelOnlyFieldList(e,t,s):o`<slot name=no-fields></slot>`}renderSplitLists(e,t,i){let s=f(this.allLists),l=D(this.allLists).some(r=>w(r,this.filterText));return o`${i?o`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name","alias","description"]} .placeholder=${this.filterPlaceholderText??this._messages.filter} @calciteFilterChange=${r=>{this.filterText=r.currentTarget.value,this.filterFields=this.filterText?M(this.allLists,this.filterText).map(c=>c.name):void 0}}></calcite-filter>${this.renderSortButton()}</div>`:null}<div class=${v(this.listOnly?"":"list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i)?this.renderSelectionButton():null}${this.renderSplitSubFieldLists(t)}${e.length?this.renderSplitTopLevelFieldList(e,!0):null}</div>${this.filterText&&!l&&this.filterNoResultsText?.length!==0?o`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}`}renderSplitSubFieldLists(e){let t=e.map(i=>({...i,fields:i.fields.filter(s=>w(s,this.filterText))})).filter(i=>!!i.fields.length);return C(t,i=>i.title,i=>o`<calcite-list selection-mode=none .label=${i.title??this.heading??""}><calcite-list-item-group .heading=${i.title}>${C(i.fields,s=>s.name,s=>o`<calcite-list-item .label=${s.alias||s.name} .description=${this.multiple?this._messages.subFieldsSelected.replace("${count}",`${s.subFieldInfos.filter(l=>this.selectedFields.includes(l.name)).length}`):void 0} .value=${s.name} @click=${l=>this.addSubFieldInfoFlowItem(s,l.currentTarget)} @keydown=${l=>{l.key==="Enter"&&this.addSubFieldInfoFlowItem(s,l.currentTarget)}}><calcite-icon slot=actions-end icon=chevron-right flip-rtl scale=s></calcite-icon></calcite-list-item>`)}</calcite-list-item-group></calcite-list>`)}renderSplitTopLevelFieldList(e,t){return o`<calcite-list .label=${this.heading||(this.multiple?this._messages.headerSelect:this._messages.header)} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${()=>this.handleListSelectionChange(e)} ${d(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`}renderTopLevelOnlyFieldList(e,t,i){return o`<div class=${v(this.listOnly?"":"list-wrapper")} ${d(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple?"multiple":"single"} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText??this._messages.filter} @calciteListChange=${()=>this.handleListSelectionChange(t)} @calciteListFilter=${s=>{s.stopPropagation(),this.filterFields=this.listNode.value.filteredItems?.map(l=>l.value),this.filterText=this.listNode.value.filterText}} ${d(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(i)?this.renderSelectionButton():null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`}renderSortButton(e){let t=f(this.allLists);if(!(t.length>=this.showFilterLength&&!this.hideSort))return"";let i=t.every(s=>!!s.type);return o`<calcite-action id=sort-action slot=${e??m} .text=${this._messages.sort??""} title=${this._messages.sort??m}><calcite-icon scale=s icon=sort-descending flip-rtl></calcite-icon></calcite-action><calcite-dropdown placement=bottom-end overlay-positioning=fixed reference-element=sort-action @calciteDropdownOpen=${()=>{this.observer?.disconnect(),this.popoverNode.value&&this.observer?.observe(this.popoverNode.value,{attributes:!0})}} @calciteDropdownClose=${()=>this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy==="default"} @calciteDropdownItemSelect=${()=>this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy==="display"} @calciteDropdownItemSelect=${()=>this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${i&&o`<calcite-dropdown-item .selected=${this.lastSortBy==="type"} @calciteDropdownItemSelect=${()=>this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>`||""}<calcite-dropdown-item .selected=${this.lastSortBy==="field"} @calciteDropdownItemSelect=${()=>this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderSelectionButton(){return o`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${()=>{if(this.canDeselectAll())this.selectedFields=this.filterFields?.length?this.selectedFields.filter(e=>!this.filterFields?.includes(e)):[];else if(this.filterFields?.length)this.selectedFields=[...new Set([...this.selectedFields,...this.filterFields])];else{let e=f(this.allLists);this.selectedFields=e.map(t=>t.name)}this.reorderSelectedFieldsByCurrentListOrder(),this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields})}}>${this.canDeselectAll()?this._messages.deselectAll:this._messages.selectAll}</calcite-button></div>`}renderGroupedListItems(e){let t=this.allLists.filter(i=>!!i.fields.length&&!u(i.fields)).map(i=>({...i,fields:e?i.fields.filter(s=>w(s,this.filterText)):i.fields})).filter(i=>!!i.fields.length);return t.length===1&&!t[0].title?this.renderListItems(t[0].fields):t.map(i=>o`<calcite-list-item-group .heading=${i.title}>${this.renderListItems(i.fields)}</calcite-list-item-group>`)}renderListItems(e){return e.map(t=>this.renderCalciteListItem(t))}renderCalciteListItem(e,t=!0){let i=t&&this.showFieldInfoCheck(e),s=this.showFieldTypeIcon&&!!e.type;return L(e.name,o`<calcite-list-item .label=${e.alias||e.name} .description=${(()=>{if(this.showFieldName&&e.hideFieldName!==!0)return`{${e.name}}`;if(this.showDescription&&e.hideDescription!==!0&&e.description)return e.description})()} .value=${e.name} .selected=${!this.multiple&&e.name===this.selectedFields[0]||this.multiple&&this.selectedFields.includes(e.name)} .metadata=${{label:e.alias,fieldName:e.name}}>${s&&o`<div slot=actions-end class="field-icons">${N({fieldType:e.type})}</div>`||""}${this.renderInfoAction(e,i)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`)}renderInfoAction(e,t){let{_messages:i}=this;return t?o`<calcite-action slot=actions-end .text=${i.info} title=${i.info??m} scale=s icon=information @click=${s=>{s.stopPropagation();let l=s.currentTarget;this.addFieldInfoFlowItem(e,l)}}></calcite-action>`:""}renderEditAction(e){let{_messages:t}=this;return e.showEditAction?o`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit??m} scale=s icon=pencil @click=${i=>{i.stopPropagation(),this.arcgisEditField.emit({fieldName:e.name})}}></calcite-action>`:""}renderDeleteAction(e){let{_messages:t}=this;return e.showDeleteAction?o`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete??m} scale=s icon=trash @click=${i=>{i.stopPropagation(),this.arcgisDeleteField.emit({fieldName:e.name})}}></calcite-action>`:""}renderAddButton(){return this.multiple?o`<calcite-button .appearance=${this.hideCancel?"outline-fill":"solid"} .width=${this.hideCancel?"full":"half"} @click=${()=>{this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields})}}>${this.okBtnText||(this.multiple?this._messages.done:this._messages.ok)}</calcite-button>`:""}renderCancelButton(){return this.hideCancel?"":o`<calcite-button appearance=outline-fill .width=${this.multiple?"half":"full"} @click=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}}>${this._messages.cancel}</calcite-button>`}};B("arcgis-field-pick-list",b);export{b as ArcgisFieldPickList};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{e as n}from"./JYWWX277.js";import"./XMMFL5H3.js";import{L as r,S as c,h as s,j as a}from"./4IMLX5B4.js";var o=s`:host{display:flex;flex:auto;inline-size:300px;min-inline-size:0;padding:var(--calcite-space-sm)}:host([disabled]){opacity:var(--calcite-opacity-disabled);pointer-events:none}.container{align-items:center;border:solid var(--calcite-border-width-sm) var(--calcite-color-border-3);display:flex;flex:auto;padding-inline:var(--calcite-space-sm)}.text{color:var(--calcite-color-text-1);flex:auto;font-family:inherit;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-regular);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:var(--calcite-space-none)}`,i=class extends r{constructor(){super(...arguments),this.autoDestroyDisabled=!1,this.disabled=!1,this.canNext=!1,this.canPlay=!1,this.canPrevious=!1,this.arcgisPropertyChange=n()("canNext","canPlay","canPrevious","currentValue")}static{this.properties={autoDestroyDisabled:5,disabled:7,items:0,currentValue:0,canNext:5,canPlay:5,canPrevious:5}}static{this.styles=o}async destroy(){await this.manager.destroy()}reset(){this.currentValue=this.items?.[0]}step(e){if(!this.items||!this.currentValue)return;let t=this.items.findIndex(({value:l})=>l===this.currentValue?.value)+(e==="next"?1:-1);t>=this.items.length||t<0||(this.currentValue=this.items[t],this._checkState())}connectedCallback(){super.connectedCallback(),this.el.hidden=!0}willUpdate(e){(e.has("currentValue")||e.has("items"))&&this.items?.length&&!this.currentValue&&(this.currentValue=this.items[0]),this.el.hidden=!this.items?.length,this._checkState()}_checkState(){if(!this.items?.length){this.canPlay=!1,this.canNext=!1,this.canPrevious=!1;return}this.canPlay=!0;let e=this.items.findIndex(({value:t})=>t===this.currentValue?.value);this.canNext=e<this.items.length-1,this.canPrevious=e>0}render(){return a`<div class="container"><div class="text">${this.currentValue?.label}</div></div>`}};c("arcgis-value-picker-label",i);export{i as ArcgisValuePickerLabel};
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{R as a,y as e}from"./4IMLX5B4.js";var i=e(a,{"arcgis-ckeditor5":[()=>import("./RQGPWDYU.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./3UAY23XT.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./4H4SDFQK.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus;isOpen"],"arcgis-coordinate-system-picker":[()=>import("./PJGWH4LW.js"),"_messages:,autoFilterToDefault,defaultWkid,filterEnabled,hideCategories:,value:;getSRDescription"],"arcgis-coordinate-system-picker-tree":[()=>import("./IOAVVVNO.js"),"data:,value"],"arcgis-field-info":[()=>import("./VNC7X43V.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./SIB7LGF5.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./IZD4AM2W.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,labelFormatter:,layout,max,messageOverrides:,min,mirrored,standardDeviation,standardDeviationCount"],"arcgis-html-content":[()=>import("./W7CWMG2O.js"),"content,sanitizerOptions:"],"arcgis-label-input":[()=>import("./V5FMQXMU.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-layer-replace":[()=>import("./TWPYXZ2O.js"),"additionalSourceFields:,allowDuplicateReplacementFields,fieldMatcher:,getFieldDisplayInfo:,getLayerDisplayInfo:,mapping:,messageOverrides:,messages:,mode,replacement:,replacementCandidates:,replacementFieldFilter:,showFieldAliases,source:,sourceFieldFilter:;matchFields"],"arcgis-picker-input":[()=>import("./PIXY2HTI.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./3ZTHRAIZ.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./ZMYTELNC.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./FESNPMRM.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./YXN6CFSE.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverDisplay,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values,valuesDraggingDisabled;destroy"],"arcgis-slider-field":[()=>import("./T57JKNGO.js"),"activeValue:,disabled,fieldType,fillPlacement,label,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,value,valueAsDateOnly:,valueAsFieldType:,valueAsNumbers:,valueAsTimeOnly:,valueAsTimestampOffset:,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values"],"arcgis-slider-histogram-range":[()=>import("./74TVQE6W.js"),"activeValue:,average,bins:,dataLines:,excludedBarColor:,fieldType,fillPlacement,includedBarColor:,label,labelFormatter:,layout,max,min,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,standardDeviation,standardDeviationCount,value,valueLabelsDisplay,valueLabelsEditingEnabled,values;destroy,generateWhereClause,updateFromHistogramResult"],"arcgis-slider-input":[()=>import("./U6OGOB7D.js"),"disabled,flipLabels,label,max,min,scale,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./ZLVMV6TP.js"),"_messages:,autoDestroyDisabled,interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values;destroy"],"arcgis-toolbar":[()=>import("./BMR5AH6W.js"),"barElement:,layout,relativePosition,scale,toolbarKind,tooltipAppearance;;allocate,measure,proxiedRender"],"arcgis-toolbar-action":[()=>import("./BAALW3SQ.js"),"actionElement:,active,appearance,disabled,icon,iconFlipRtl,indicator,kind,labelText,loading,textEnabled,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-group":[()=>import("./W2W34T5K.js"),"preferEndSlot,priority;;measure,proxiedRender"],"arcgis-toolbar-item":[()=>import("./XQ65BGER.js"),"actionElement:,active,disabled,icon,iconFlipRtl,labelText,lastActivated:,loading,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-more-button":[()=>import("./FVFYAK24.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-split-button":[()=>import("./4D35RDOE.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-stack":[()=>import("./OUPGMHLD.js"),"layout,relativePosition,scale,toolbarKind,tooltipAppearance"],"arcgis-unique-values-list":[()=>import("./OZIHA5AQ.js"),"_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:,visualizationSource;getUniqueValues,setFocus"],"arcgis-value-picker":[()=>import("./XAWHSQBN.js"),"autoDestroyDisabled,disabled,floating,hideNextButton,hidePlayButton,hidePreviousButton,icon,label,layout,loop,messages:,playRate,state:;destroy;next,pause,play,previous"],"arcgis-value-picker-collection":[()=>import("./J4AV4EAC.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,items:;destroy;reset,step"],"arcgis-value-picker-combobox":[()=>import("./ANK7TFWV.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:,messages:;destroy;reset,step"],"arcgis-value-picker-label":[()=>import("./DMEXDZ2R.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:;destroy;reset,step"],"arcgis-value-picker-slider":[()=>import("./6LZNNXUL.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue,disabled,labelFormatter:,labels:,layout,majorTicks:,max,min,minorTicks:,mirrored,steps:;destroy;reset,step"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-coordinate-system-picker,arcgis-coordinate-system-picker-tree,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-html-content,arcgis-label-input,arcgis-layer-replace,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-field,arcgis-slider-histogram-range,arcgis-slider-input,arcgis-ticks,arcgis-toolbar,arcgis-toolbar-action,arcgis-toolbar-group,arcgis-toolbar-item,arcgis-toolbar-more-button,arcgis-toolbar-split-button,arcgis-toolbar-stack,arcgis-unique-values-list,arcgis-value-picker,arcgis-value-picker-collection,arcgis-value-picker-combobox,arcgis-value-picker-label,arcgis-value-picker-slider){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
2
+ import{R as a,y as e}from"./4IMLX5B4.js";var i=e(a,{"arcgis-ckeditor5":[()=>import("./RQGPWDYU.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./3UAY23XT.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./GZVXOCN5.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus;isOpen"],"arcgis-coordinate-system-picker":[()=>import("./PJGWH4LW.js"),"_messages:,autoFilterToDefault,defaultWkid,filterEnabled,hideCategories:,value:;getSRDescription"],"arcgis-coordinate-system-picker-tree":[()=>import("./IOAVVVNO.js"),"data:,value"],"arcgis-field-info":[()=>import("./VNC7X43V.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./KEQPWVA6.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./IZD4AM2W.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,labelFormatter:,layout,max,messageOverrides:,min,mirrored,standardDeviation,standardDeviationCount"],"arcgis-html-content":[()=>import("./W7CWMG2O.js"),"content,sanitizerOptions:"],"arcgis-label-input":[()=>import("./V5FMQXMU.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-layer-replace":[()=>import("./TWPYXZ2O.js"),"additionalSourceFields:,allowDuplicateReplacementFields,fieldMatcher:,getFieldDisplayInfo:,getLayerDisplayInfo:,mapping:,messageOverrides:,messages:,mode,replacement:,replacementCandidates:,replacementFieldFilter:,showFieldAliases,source:,sourceFieldFilter:;matchFields"],"arcgis-picker-input":[()=>import("./PIXY2HTI.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./3ZTHRAIZ.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./ZMYTELNC.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./FESNPMRM.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./FGG3L42U.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverDisplay,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values,valuesDraggingDisabled;destroy"],"arcgis-slider-field":[()=>import("./T57JKNGO.js"),"activeValue:,disabled,fieldType,fillPlacement,label,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,value,valueAsDateOnly:,valueAsFieldType:,valueAsNumbers:,valueAsTimeOnly:,valueAsTimestampOffset:,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values"],"arcgis-slider-histogram-range":[()=>import("./74TVQE6W.js"),"activeValue:,average,bins:,dataLines:,excludedBarColor:,fieldType,fillPlacement,includedBarColor:,label,labelFormatter:,layout,max,min,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,standardDeviation,standardDeviationCount,value,valueLabelsDisplay,valueLabelsEditingEnabled,values;destroy,generateWhereClause,updateFromHistogramResult"],"arcgis-slider-input":[()=>import("./U6OGOB7D.js"),"disabled,flipLabels,label,max,min,scale,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./ZLVMV6TP.js"),"_messages:,autoDestroyDisabled,interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values;destroy"],"arcgis-toolbar":[()=>import("./BMR5AH6W.js"),"barElement:,layout,relativePosition,scale,toolbarKind,tooltipAppearance;;allocate,measure,proxiedRender"],"arcgis-toolbar-action":[()=>import("./BAALW3SQ.js"),"actionElement:,active,appearance,disabled,icon,iconFlipRtl,indicator,kind,labelText,loading,textEnabled,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-group":[()=>import("./W2W34T5K.js"),"preferEndSlot,priority;;measure,proxiedRender"],"arcgis-toolbar-item":[()=>import("./XQ65BGER.js"),"actionElement:,active,disabled,icon,iconFlipRtl,labelText,lastActivated:,loading,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-more-button":[()=>import("./FVFYAK24.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-split-button":[()=>import("./4D35RDOE.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-stack":[()=>import("./OUPGMHLD.js"),"layout,relativePosition,scale,toolbarKind,tooltipAppearance"],"arcgis-unique-values-list":[()=>import("./EOGA62GK.js"),"_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:,visualizationSource;getUniqueValues,setFocus"],"arcgis-value-picker":[()=>import("./5GVJKVEV.js"),"autoDestroyDisabled,disabled,floating,hideNextButton,hidePlayButton,hidePreviousButton,icon,label,layout,loop,messages:,playRate,state:;destroy;next,pause,play,previous"],"arcgis-value-picker-collection":[()=>import("./J4AV4EAC.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,items:;destroy;reset,step"],"arcgis-value-picker-combobox":[()=>import("./ANK7TFWV.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:,messages:;destroy;reset,step"],"arcgis-value-picker-label":[()=>import("./NZDJ3HVF.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:;destroy;reset,step"],"arcgis-value-picker-slider":[()=>import("./6LZNNXUL.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue,disabled,labelFormatter:,labels:,layout,majorTicks:,max,min,minorTicks:,mirrored,steps:;destroy;reset,step"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-coordinate-system-picker,arcgis-coordinate-system-picker-tree,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-html-content,arcgis-label-input,arcgis-layer-replace,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-field,arcgis-slider-histogram-range,arcgis-slider-input,arcgis-ticks,arcgis-toolbar,arcgis-toolbar-action,arcgis-toolbar-group,arcgis-toolbar-item,arcgis-toolbar-more-button,arcgis-toolbar-split-button,arcgis-toolbar-stack,arcgis-unique-values-list,arcgis-value-picker,arcgis-value-picker-collection,arcgis-value-picker-combobox,arcgis-value-picker-label,arcgis-value-picker-slider){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
@@ -1,23 +1,23 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import { c as C } from "../../chunks/runtime.js";
2
+ import { c as g } from "../../chunks/runtime.js";
3
3
  import { keyed as n } from "lit/directives/keyed.js";
4
- import { LitElement as u, createEvent as i } from "@arcgis/lumina";
5
- import { css as m, render as g, html as s, svg as f } from "lit";
6
- import { createRef as w, ref as a } from "lit/directives/ref.js";
7
- import { unsafeGetElementDirection as v } from "@arcgis/toolkit/dom";
8
- import { debounce as E } from "@arcgis/toolkit/function";
9
- import { u as k } from "../../chunks/useT9n.js";
10
- function $(l, e, o) {
11
- window.localStorage.setItem(l, JSON.stringify(e));
4
+ import { LitElement as m, createEvent as r, nothing as d, safeStyleMap as w } from "@arcgis/lumina";
5
+ import { css as f, render as v, html as s, svg as u } from "lit";
6
+ import { createRef as E, ref as a } from "lit/directives/ref.js";
7
+ import { unsafeGetElementDirection as k } from "@arcgis/toolkit/dom";
8
+ import { debounce as $ } from "@arcgis/toolkit/function";
9
+ import { u as y } from "../../chunks/useT9n.js";
10
+ function b(c, e, o) {
11
+ window.localStorage.setItem(c, JSON.stringify(e));
12
12
  }
13
- function y(l, e) {
14
- const o = window.localStorage.getItem(l);
13
+ function S(c, e) {
14
+ const o = window.localStorage.getItem(c);
15
15
  return o && e ? JSON.parse(o) : o;
16
16
  }
17
- const S = m`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}`;
18
- class I extends u {
17
+ const I = f`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px;container-type:inline-size}.preview-swatch-no-color{overflow:hidden;block-size:inherit;inline-size:inherit;rect{transition-property:all;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1)}rect{fill:var(--calcite-theme-color-surface-2, var(--calcite-color-surface-2))}line{stroke:var(--calcite-color-status-danger)}}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}.swatch-group{line-height:16px}`;
18
+ class R extends m {
19
19
  constructor() {
20
- super(), this._messages = k(), this.actionEl = w(), this.open = !1, this.setRecentColorElement = (e) => (o) => {
20
+ super(), this._messages = y(), this.actionEl = E(), this.open = !1, this.setRecentColorElement = (e) => (o) => {
21
21
  switch (e) {
22
22
  case 1:
23
23
  this.recentColor1El = o;
@@ -28,13 +28,13 @@ class I extends u {
28
28
  default:
29
29
  this.recentColor3El = o;
30
30
  }
31
- }, this.recentColors = [], this.clearable = !1, this.compact = !1, this.disabled = !1, this.placement = "auto", this.storageId = "arcgis-color-input-storage-colors", this.hideRecentColors = !1, this.showTransparency = !1, this.arcgisChange = i(), this.arcgisColorInputChange = i(), this.arcgisColorInputPopoverClose = i(), this.arcgisColorInputPopoverOpen = i(), this.arcgisColorInputSwatchUpdate = i(), this.arcgisInternalStoredColor = i(), this.arcgisPickerClose = i(), this.arcgisPickerOpen = i(), this.arcgisSwatchUpdate = i(), this.listenOn(document, "arcgisInternalStoredColor", this.handleUpdateRecentColors), this.listenOn(document, "arcgisRecentColorsUpdate", this.handleStoreNewRecentColor);
31
+ }, this.recentColors = [], this.clearable = !1, this.compact = !1, this.disabled = !1, this.placement = "auto", this.storageId = "arcgis-color-input-storage-colors", this.hideRecentColors = !1, this.showTransparency = !1, this.arcgisChange = r(), this.arcgisColorInputChange = r(), this.arcgisColorInputPopoverClose = r(), this.arcgisColorInputPopoverOpen = r(), this.arcgisColorInputSwatchUpdate = r(), this.arcgisInternalStoredColor = r(), this.arcgisPickerClose = r(), this.arcgisPickerOpen = r(), this.arcgisSwatchUpdate = r(), this.listenOn(document, "arcgisInternalStoredColor", this.handleUpdateRecentColors), this.listenOn(document, "arcgisRecentColorsUpdate", this.handleStoreNewRecentColor);
32
32
  }
33
33
  static {
34
34
  this.properties = { recentColors: 16, clearable: 5, color: 1, compact: 5, disabled: 5, messageOverrides: 0, placement: 1, popoverProps: 0, storageId: 1, hideRecentColors: 5, showTransparency: 5 };
35
35
  }
36
36
  static {
37
- this.styles = S;
37
+ this.styles = I;
38
38
  }
39
39
  async close() {
40
40
  await this.inlineInputEl?.close({ focus: !1 });
@@ -71,7 +71,7 @@ class I extends u {
71
71
  }
72
72
  }
73
73
  setRecentColorsFromStorage() {
74
- const e = y(this.storageId, !0);
74
+ const e = S(this.storageId, !0);
75
75
  e && (this.recentColors = [...e]);
76
76
  }
77
77
  handleSwatchClickOrKeyUp(e) {
@@ -106,33 +106,33 @@ class I extends u {
106
106
  if (!e)
107
107
  return;
108
108
  e.length > 7 && (e = e.slice(0, 7));
109
- const t = [e, ...this.recentColors.filter((r) => r !== e)].slice(0, 3);
110
- $(this.storageId, t), this.recentColors = t, this.arcgisInternalStoredColor.emit();
109
+ const t = [e, ...this.recentColors.filter((i) => i !== e)].slice(0, 3);
110
+ b(this.storageId, t), this.recentColors = t, this.arcgisInternalStoredColor.emit();
111
111
  }
112
112
  handleClose(e) {
113
113
  e.stopPropagation(), this.storeRecentColorToStorage(this.colorPickerEl?.value), this.open = !1, this.arcgisPickerClose.emit(this.colorPickerEl?.value), this.arcgisColorInputPopoverClose.emit(this.colorPickerEl?.value);
114
114
  }
115
115
  addTooltip(e) {
116
- this.removeTooltip(), this.tooltipContainerEl = document.createElement("div"), g(s`<calcite-tooltip .placement=${e.placement ?? "auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`, this.tooltipContainerEl), document.body.append(this.tooltipContainerEl);
116
+ this.removeTooltip(), this.tooltipContainerEl = document.createElement("div"), v(s`<calcite-tooltip .placement=${e.placement ?? "auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`, this.tooltipContainerEl), document.body.append(this.tooltipContainerEl);
117
117
  }
118
118
  removeTooltip() {
119
119
  this.tooltipContainerEl?.parentNode && (this.tooltipContainerEl.remove(), this.tooltipContainerEl = void 0);
120
120
  }
121
121
  render() {
122
- const { compact: e, disabled: o, recentColors: t, _messages: r } = this, h = [t[0], t[1]], d = v(this.el) === "rtl";
123
- return e || h.push(t[2]), s`<arcgis-picker-input .disabled=${o} .intlDone=${r.commitColor} .heading=${r.selectColor} .label=${r.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${a(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e ? "--compact" : ""}`, s`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${E((c) => {
124
- c.stopPropagation(), this.updateColor(this.colorPickerEl.value, !1);
125
- }, 500)} .scale=${e ? "s" : "m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${a(this.setColorPickerRef)}></calcite-color-picker>`)}</div><div slot=preview><calcite-color-picker-swatch class="preview-swatch" .color=${this.color} scale=s></calcite-color-picker-swatch></div>${!this.hideRecentColors && s`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1>${h.map((c, p) => c ? n(c, s`<calcite-color-picker-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .active=${c === this.color} .color=${c} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${a(this.setRecentColorElement(p + 1))}></calcite-color-picker-swatch>`) : this.renderEmptySwatch(`empty-swatch-${p}`))}</div>` || ""}${this.clearable && s`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${r.clearColor} .text=${r.clearColor ?? ""} @click=${this.handleClearColor} @mouseover=${() => this.addTooltip({
122
+ const { compact: e, disabled: o, recentColors: t, _messages: i } = this, h = [t[0], t[1]], C = k(this.el) === "rtl";
123
+ return e || h.push(t[2]), s`<arcgis-picker-input .disabled=${o} .intlDone=${i.commitColor} .heading=${i.selectColor} .label=${i.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${a(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e ? "--compact" : ""}`, s`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${$((l) => {
124
+ l.stopPropagation(), this.updateColor(this.colorPickerEl.value, !1);
125
+ }, 500)} .scale=${e ? "s" : "m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${a(this.setColorPickerRef)}></calcite-color-picker>`)}</div>${this.color ? s`<div slot=preview style=${w({ backgroundColor: this.color })} class="preview-swatch" aria-label=${i.selectColor ?? "" ?? d}></div>` : s`<div slot=preview class="preview-swatch" aria-label=${i.selectColor ?? "" ?? d}><svg xmlns=http://www.w3.org/2000/svg class="preview-swatch-no-color">${u`<clipPath id=shape><rect height=100% width=100% rx=0 /></clipPath><rect clip-path="inset(0 round 0)" height=100% rx=0 stroke="rgba(0, 0, 0, 0.3)" stroke-width=2 width=100% /><line clip-path=url(#shape) stroke-width=3 x1=100% x2=0 y1=0 y2=100% />`}</svg></div>`}${!this.hideRecentColors && s`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1><calcite-swatch-group selection-mode=single .label=${i.recentColors ?? ""} scale=s class="swatch-group">${h.map((l, p) => l ? n(l, s`<calcite-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .selected=${l === this.color} .color=${l} .label=${i.selectColor ?? ""} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${a(this.setRecentColorElement(p + 1))}></calcite-swatch>`) : this.renderEmptySwatch(`empty-swatch-${p}`))}</calcite-swatch-group></div>` || ""}${this.clearable && s`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${i.clearColor} .text=${i.clearColor ?? ""} @click=${this.handleClearColor} @mouseover=${() => this.addTooltip({
126
126
  referenceElement: this.actionEl.value,
127
- placement: d ? "right-start" : "left-start",
128
- innerHTML: r.noColor ?? ""
127
+ placement: C ? "right-start" : "left-start",
128
+ innerHTML: i.noColor ?? ""
129
129
  })} @mouseout=${() => this.removeTooltip()} ${a(this.actionEl)}></calcite-action></div>` || ""}</arcgis-picker-input>`;
130
130
  }
131
131
  renderEmptySwatch(e) {
132
- return n(e, s`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${f`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`);
132
+ return n(e, s`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${u`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`);
133
133
  }
134
134
  }
135
- C("arcgis-color-input", I);
135
+ g("arcgis-color-input", R);
136
136
  export {
137
- I as ArcgisColorInput
137
+ R as ArcgisColorInput
138
138
  };
@@ -1,6 +1,7 @@
1
1
  import "@esri/calcite-components/components/calcite-tooltip";
2
2
  import "../arcgis-picker-input/index.js";
3
3
  import "@esri/calcite-components/components/calcite-color-picker";
4
- import "@esri/calcite-components/components/calcite-color-picker-swatch";
4
+ import "@esri/calcite-components/components/calcite-swatch-group";
5
+ import "@esri/calcite-components/components/calcite-swatch";
5
6
  import "@esri/calcite-components/components/calcite-action";
6
7
  export * from "./customElement.js";
@@ -37,10 +37,10 @@ function u(o) {
37
37
  function _(o) {
38
38
  return o.filter((e) => u(e.fields));
39
39
  }
40
- function D(o) {
40
+ function O(o) {
41
41
  return o.flatMap((e) => e.fields);
42
42
  }
43
- function O(o) {
43
+ function A(o) {
44
44
  return o.flatMap((e) => u(e.fields) ? [] : e.fields);
45
45
  }
46
46
  function f(o) {
@@ -48,7 +48,7 @@ function f(o) {
48
48
  (e) => u(e.fields) ? e.fields.flatMap((t) => t.subFieldInfos) : e.fields
49
49
  );
50
50
  }
51
- function A(o, e) {
51
+ function D(o, e) {
52
52
  return o.flatMap((t) => u(t.fields) ? t.fields.flatMap(
53
53
  (i) => i.subFieldInfos.filter((s) => g(s, e, !0))
54
54
  ) : t.fields.filter((i) => F(i, e)));
@@ -244,13 +244,13 @@ class H extends I {
244
244
  });
245
245
  }
246
246
  renderList() {
247
- const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = O(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
247
+ const e = this.heading || (this.multiple ? this._messages.headerSelect : this._messages.header), t = A(this.allLists), i = _(this.allLists), s = f(this.allLists).length >= this.showFilterLength;
248
248
  return t.length || i.length ? i.length ? this.renderSplitLists(t, i, s) : this.renderTopLevelOnlyFieldList(e, t, s) : n`<slot name=no-fields></slot>`;
249
249
  }
250
250
  renderSplitLists(e, t, i) {
251
- const s = f(this.allLists), l = D(this.allLists).some((a) => F(a, this.filterText));
251
+ const s = f(this.allLists), l = O(this.allLists).some((a) => F(a, this.filterText));
252
252
  return n`${i ? n`<div class="list-controls"><calcite-filter .items=${s} .filterProps=${["name", "alias", "description"]} .placeholder=${this.filterPlaceholderText ?? this._messages.filter} @calciteFilterChange=${(a) => {
253
- this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? A(this.allLists, this.filterText).map((c) => c.name) : void 0;
253
+ this.filterText = a.currentTarget.value, this.filterFields = this.filterText ? D(this.allLists, this.filterText).map((c) => c.name) : void 0;
254
254
  }}></calcite-filter>${this.renderSortButton()}</div>` : null}<div class=${L(this.listOnly ? "" : "list-wrapper")} ${d(this.listWrapper)}>${this.shouldRenderSelectionButton(i) ? this.renderSelectionButton() : null}${this.renderSplitSubFieldLists(t)}${e.length ? this.renderSplitTopLevelFieldList(e, !0) : null}</div>${this.filterText && !l && this.filterNoResultsText?.length !== 0 ? n`<div class="no-match-text">${this.filterNoResultsText ?? this._messages.noMatches}</div>` : null}`;
255
255
  }
256
256
  renderSplitSubFieldLists(e) {
@@ -275,9 +275,9 @@ class H extends I {
275
275
  if (!(t.length >= this.showFilterLength && !this.hideSort))
276
276
  return "";
277
277
  const s = t.every((l) => !!l.type);
278
- return n`<calcite-dropdown slot=${e ?? m} placement=bottom-end overlay-positioning=fixed @calciteDropdownOpen=${() => {
278
+ return n`<calcite-action id=sort-action slot=${e ?? m} .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sort-descending flip-rtl></calcite-icon></calcite-action><calcite-dropdown placement=bottom-end overlay-positioning=fixed reference-element=sort-action @calciteDropdownOpen=${() => {
279
279
  this.observer?.disconnect(), this.popoverNode.value && this.observer?.observe(this.popoverNode.value, { attributes: !0 });
280
- }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort ?? ""} title=${this._messages.sort ?? m}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
280
+ }} @calciteDropdownClose=${() => this.observer?.disconnect()} ${d(this.dropdownNode)}><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy === "default"} @calciteDropdownItemSelect=${() => this.setSortBy("default")}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy === "display"} @calciteDropdownItemSelect=${() => this.setSortBy("display")}>${this._messages.displayName}</calcite-dropdown-item>${s && n`<calcite-dropdown-item .selected=${this.lastSortBy === "type"} @calciteDropdownItemSelect=${() => this.setSortBy("type")}>${this._messages.type}</calcite-dropdown-item>` || ""}<calcite-dropdown-item .selected=${this.lastSortBy === "field"} @calciteDropdownItemSelect=${() => this.setSortBy("field")}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
281
281
  }
282
282
  renderSelectionButton() {
283
283
  return n`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${() => {