@arcgis/common-components 5.2.4 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{DZUTJ747.js → 32A6BZEM.js} +1 -1
- package/dist/cdn/{RZWLH7SD.js → 3YCZR6IT.js} +1 -1
- package/dist/cdn/{RHEPCTDX.js → 3YKIBI26.js} +1 -1
- package/dist/cdn/{2GBIDGIK.js → 4WPVYHCO.js} +1 -1
- package/dist/cdn/{I6LJN2SJ.js → 6QQ5CCJW.js} +1 -1
- package/dist/cdn/{S5YQPDLN.js → BEZG7UQH.js} +1 -1
- package/dist/cdn/{E6LVFD3S.js → EZTIP33A.js} +1 -1
- package/dist/cdn/{AVAVKE2C.js → GKSUYUND.js} +1 -1
- package/dist/cdn/{E3VHT6BQ.js → GPMQUN4D.js} +1 -1
- package/dist/cdn/{HX2ZECWM.js → GZPRMTRT.js} +1 -1
- package/dist/cdn/{RWGWZAMM.js → HBK2GNTH.js} +1 -1
- package/dist/cdn/{3X2MVQTG.js → HTASM5P7.js} +1 -1
- package/dist/cdn/{UE3LF2VY.js → I4Z5O7U6.js} +1 -1
- package/dist/cdn/{YY2GCBWQ.js → IHPVMSRX.js} +1 -1
- package/dist/cdn/{PJX34XKX.js → IKRQXTQG.js} +1 -1
- package/dist/cdn/{P7F647MW.js → KSNDHRGZ.js} +1 -1
- package/dist/cdn/{XDBI7TX7.js → KXKXEDDD.js} +1 -1
- package/dist/cdn/{5WROHG4L.js → MBOIOT3H.js} +1 -1
- package/dist/cdn/{IS5NWPTN.js → MVFU56IP.js} +1 -1
- package/dist/cdn/{KK62TWI2.js → ONNE6YGE.js} +1 -1
- package/dist/cdn/{GZXN456V.js → ONVTTBLX.js} +1 -1
- package/dist/cdn/{TQL7NKXO.js → Q6ROJY6U.js} +1 -1
- package/dist/cdn/{XQJALRRE.js → RR3VSMSP.js} +1 -1
- package/dist/cdn/{V4L3PXBZ.js → RTRLHQBN.js} +1 -1
- package/dist/cdn/{H5QWBJTH.js → RVFZLZA5.js} +1 -1
- package/dist/cdn/{I23I3NHX.js → SH5OZRZL.js} +1 -1
- package/dist/cdn/{B4MSRQLW.js → SSVHIHJO.js} +1 -1
- package/dist/cdn/{PHW4TZXW.js → ST63ZEDP.js} +1 -1
- package/dist/cdn/{777NEAW4.js → TXRZTH6M.js} +1 -1
- package/dist/cdn/{P3MNNMBR.js → V64NIK6N.js} +1 -1
- package/dist/cdn/{WLX2SENR.js → VLHIEGIR.js} +1 -1
- package/dist/cdn/{BEAJKSDR.js → W27QERSB.js} +1 -1
- package/dist/cdn/{JGHUIE7K.js → WGULIZSG.js} +1 -1
- package/dist/cdn/{SL5UWHYF.js → WHVIX33G.js} +1 -1
- package/dist/cdn/{YPUQA6VS.js → WK22ELF4.js} +1 -1
- package/dist/cdn/{RESQTFUG.js → YHA6FUS7.js} +1 -1
- package/dist/cdn/{S26IP5GE.js → YIFMG7TM.js} +1 -1
- package/dist/cdn/{4BQVTE3X.js → ZQVLPLOZ.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{L as p,R as m,h as l,j as e}from"./
|
|
2
|
+
import{L as p,R as m,h as l,j as e}from"./HTASM5P7.js";export default $arcgis.t(([t])=>{var h=l`:host{display:block;block-size:30px;inline-size:100%}:host([layout="vertical"]){writing-mode:vertical-lr}arcgis-ramp-color{block-size:inherit;inline-size:inherit}`,c=new t([0,121,193]),o=class extends p{constructor(){super(...arguments),this._rampStops=[],this.fillColor=c.clone(),this.layout="horizontal",this.min=0,this.max=1,this.stops=[]}static{this.properties={fillColor:1,layout:1,min:9,max:9,stops:0}}static{this.styles=h}willUpdate(s){if(super.willUpdate(s),s.has("fillColor")||s.has("stops")){let{stops:n,fillColor:i}=this,r=(i instanceof t?i:t.fromString(i)??c).toRgb();this._rampStops=n.map(a=>({color:new t(r&&[...r,a.opacity]),value:a.value}))}}render(){return e`<arcgis-ramp-color .layout=${this.layout} .stops=${this._rampStops} .min=${this.min} .max=${this.max}></arcgis-ramp-color>`}};m("arcgis-ramp-opacity",o);return o},"Color")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{i as o}from"./
|
|
2
|
+
import{i as o}from"./HTASM5P7.js";var n=Symbol(),h=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,i)=>{this.o=t,this.h=i})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,i,e){this.p=0,this.i=0,(this._=t).addController(this);let r=typeof i=="object"?i:{task:i,args:e};this.v=r.task,this.j=r.args,this.m=r.argsEqual??u,this.k=r.onComplete,this.A=r.onError,this.autoRun=r.autoRun??!0,"initialValue"in r&&(this.u=r.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),i=this.O;this.O=t,t===i||t===void 0||i!==void 0&&this.m(i,t)||await this.run(t)}async run(t){let i,e;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let r=++this.p;this.q=new AbortController;let a=!1;try{i=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,e=l}if(this.p===r){if(i===n)this.i=0;else{if(a===!1){try{this.k?.(i)}catch{}this.i=2,this.o?.(i)}else{try{this.A?.(e)}catch{}this.i=3,this.h?.(e)}this.u=i,this.l=e}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(s,t)=>s===t||s.length===t.length&&s.every(((i,e)=>!o(i,t[e])));function m(s){return s!=null}function y(s,t){return t==="feature-reduction"&&"featureReduction"in s?s.featureReduction:s}export{h as a,m as b,y as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{L as x,M as C,O as d,R as v,h as f,j as z,k as m}from"./
|
|
2
|
+
import{L as x,M as C,O as d,R as v,h as f,j as z,k as m}from"./HTASM5P7.js";export default $arcgis.t(([w])=>{var M=f`:host{display:block;block-size:30px;inline-size:100%}:host([layout="vertical"]){writing-mode:vertical-lr}.hidden{display:none!important}svg{stroke-width:var(--calcite-border-width-sm);stroke:var(--calcite-color-border-input);margin:0;display:block;block-size:100%;inline-size:100%;padding:0}svg .background{fill:#e0e0e0}`,u=class{constructor(i,s,e,a){this.color=i,this.ratio=s,this.opacity=e,this.sizeRatio=a}},D=new w([0,0,0,.5]),I=class extends x{constructor(){super(...arguments),this._minSizeRatio=.2,this._rampStops=[],this._containerDimensions=[0,0],this.layout="horizontal",this.min=0,this.max=1,this.stops=[]}static{this.properties={_containerDimensions:16,layout:3,min:9,max:9,stops:0}}static{this.styles=M}willUpdate(i){if(super.willUpdate(i),i.has("min")||i.has("max")||i.has("stops")){let{stops:s,min:e,max:a}=this,r=a-e,o=s.map(n=>n.size??0),c=Math.min(...o),l=Math.max(...o)-c,t=s.map(n=>{let{color:h,value:g,size:$}=n,y=h instanceof w?h:w.fromString(h)??D,b=(g-e)/r;return new u(y.toCss(),b,y.a,$?($-c)/l:void 0)});if(t[0].ratio!==0){let{color:n,opacity:h,sizeRatio:g}=t[0];t.unshift(new u(n,0,h,g))}if(t[t.length-1].ratio!==0){let{color:n,opacity:h,sizeRatio:g}=t[t.length-1];t.push(new u(n,1,h,g))}this._rampStops=t}}loaded(){let i=new ResizeObserver(a=>{for(let r of a){let{width:o,height:c}=r.contentRect;this._containerDimensions=[o,c]}}),{width:s,height:e}=this.el.getBoundingClientRect();this._containerDimensions=[s,e],i.observe(this.el)}render(){let i=this._rampStops,[s,e]=this._containerDimensions,a=this.layout==="horizontal",r="rampFillId",o="rampBackgroundFillId",c=R(i),l=[];if(s>0&&e>0)if(c){let t=S(this.layout,s,e,i,this._minSizeRatio);l.push(m`<path fill=${`url(#${o})`} d=${t??d} />`,m`<path fill=${`url(#${r})`} d=${t??d} />`)}else l.push(m`<rect fill=${`url(#${o})`} height=100% width=100% x=0 y=0 />`,m`<rect fill=${`url(#${r})`} height=100% width=100% x=0 y=0 />`);return z`<svg xmlns=http://www.w3.org/2000/svg>${m`<defs><linearGradient id=${r} x1=0 x2=${a?1:0} y1=${a?0:1} y2=0>${i.map(({ratio:t,color:n,opacity:h})=>m`<stop offset=${`${(t*100).toFixed(2)}%`} stop-color=${n??d} stop-opacity=${h??d} />`)}</linearGradient><pattern height=15 id=${o} patternUnits=userSpaceOnUse width=15 x=0 y=0><image height=15 href=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxNiIgd2lkdGg9IjE2Ij48cGF0aCBkPSJNMCAwIEw4IDAgTDggOCBMMCA4IFoiIGZpbGw9IiNjY2MiIC8+PHBhdGggZD0iTTAgMCBMOCAwIEw4IDggTDAgOCBaIiBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLDgpIiAvPjxwYXRoIGQ9Ik0wIDAgTDggMCBMOCA4IEwwIDggWiIgZmlsbD0iI2NjYyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCw4KSIgLz48cGF0aCBkPSJNMCAwIEw4IDAgTDggOCBMMCA4IFoiIGZpbGw9IiNmZmYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDgsMCkiIC8+PC9zdmc+ width=15 x=0 y=0 /></pattern></defs><rect class=${C({background:!0})} height=100% width=100% x=0 y=0 />${l}`}</svg>`}};function R(p){return p.every(i=>i.sizeRatio!==void 0)}function S(p,i,s,e,a){let r=o=>(1-a)*o+a;if(p==="horizontal"){let o=e.map(({ratio:c,sizeRatio:l})=>{let t=c*i,n=s-r(l)*s;return`L ${t} ${n}`});return`M 0 ${s} ${o.join(" ")} L ${i} ${s} Z`}else{let o=e.map(({ratio:c,sizeRatio:l})=>{let t=s-c*s;return`L ${r(l)*i} ${t}`});return`M 0 ${s} ${o.join(" ")} L 0 0 Z`}}v("arcgis-ramp-color",I);return I},"Color")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as R}from"./5IM4X2GT.js";import{a as w}from"./
|
|
2
|
+
import{a as R}from"./5IM4X2GT.js";import{a as w}from"./3YCZR6IT.js";import{a as h,c as v,e as A}from"./OBMF3G26.js";import{a as y,b as x}from"./PL2HCI3R.js";import"./ONVTTBLX.js";import"./H4Q2JVNO.js";import{K as u,L as g,M as C,O as b,R as _,j as p}from"./HTASM5P7.js";var $=class extends g{constructor(){super(...arguments),this._elementReferenceController=new w(this),this._childrenObserver=new MutationObserver(()=>{this._syncChildren()}),this.priority=h.Medium,this.menuAppearance="action-menu",this.overflowActionLabel="More actions"}static{this.properties={_children:16,priority:9,menuAppearance:1,overflowActionLabel:1}}measure(e){let t=this._children?.length??0;if(!t)return[0];let o=v(e),l=t*o;if(!(this.priority<h.NeverCollapse&&t>2))return[l];let n=Math.min(t,2)*o,r=[n];if(t<=2||this.priority<=h.ForceCollapse)return r;for(let i=1;i<t-1;i++)r.push(n+o*i);return x(r)}proxiedRender(e,t){let o=this._children;if(!o)return;let{visible:l,hidden:n}=this._resolveActionsFromBudget(o,e,t),r="hamburger",i=this.overflowActionLabel,c=e.tooltipAppearance,s=c!=="native",a=this._elementReferenceController.element,m=c==="calcite-dark"?"calcite-mode-dark":void 0,f=y(e),k=this.menuAppearance==="action-menu"?p`<calcite-action-menu .label=${i} overlay-positioning=fixed .placement=${f}><calcite-action .icon=${r} .scale=${e.scale} slot=trigger .text=${i} title=${(c==="native"?i:"")??b} ${u(this._elementReferenceController.ref)}></calcite-action>${n.map(d=>d.proxiedRender(e,"expanded-action"))}</calcite-action-menu>`:p`<calcite-action .icon=${r} .scale=${e.scale} .text=${i} title=${(c==="native"?i:"")??b} ${u(this._elementReferenceController.ref)}></calcite-action><calcite-dropdown overlay-positioning=fixed .placement=${f} .referenceElement=${a}><calcite-dropdown-group selection-mode=none>${n.map(d=>d.proxiedRender(e,"dropdown-item"))}</calcite-dropdown-group></calcite-dropdown>`;return p`${l.map(d=>d.proxiedRender(e,"collapsed-action"))}${n.length?k:void 0}${n.length&&s?p`<calcite-tooltip class=${C(m)} close-on-click overlay-positioning=fixed .placement=${f} .referenceElement=${a}><span>${i}</span></calcite-tooltip>`:void 0}`}connectedCallback(){super.connectedCallback(),this._childrenObserver.observe(this.el,{childList:!0}),this._syncChildren()}disconnectedCallback(){this._childrenObserver.disconnect(),super.disconnectedCallback()}_syncChildren(){this._componentWaitAbortController?.abort();let e=Array.from(this.el.querySelectorAll("arcgis-toolbar-item")),t=new AbortController;this._componentWaitAbortController=t,Promise.all(e.map(o=>o.componentOnReady())).then(()=>{!this.isConnected||t.signal.aborted||(this._children=e)})}_resolveActionsFromBudget(e,t,o){let l=e.find(a=>a.active)??e?.toSorted(R)?.at(0),n=v(t),r=Math.floor(o/n);if(A((r+1)*n,o)&&r++,r>=e.length)return{visible:[...e],hidden:[]};let i=r-1,c=e.slice(0,i),s=e.slice(i);if(l&&s.includes(l)){let[a]=s.splice(s.indexOf(l),1),m=c.pop();c.push(a),m&&s.unshift(m)}return{visible:c,hidden:s}}};_("arcgis-toolbar-more-button",$);export{$ as ArcgisToolbarMoreButton};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as he}from"./PMV2N3L3.js";import{a as ce}from"./2GBIDGIK.js";import{a as oe,c as le}from"./GZXN456V.js";import{a as A,c as ae,e as se}from"./H4Q2JVNO.js";import{a as q}from"./KK62TWI2.js";import{J as K,K as O,L as ne,M as R,N as z,O as E,R as ie,h as Q,j as y,q as ee,r as te,t as M,v as re,w as j}from"./3X2MVQTG.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;if(this._entries.size===1&&i?.length===1){let r=this._entries.keys().next().value;if(r!==void 0){this._entries.set(r,i[0]),this._set("values",i);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")
|
|
2
|
+
import{a as he}from"./PMV2N3L3.js";import{a as ce}from"./4WPVYHCO.js";import{a as oe,c as le}from"./ONVTTBLX.js";import{a as A,c as ae,e as se}from"./H4Q2JVNO.js";import{a as q}from"./ONNE6YGE.js";import{J as K,K as O,L as ne,M as R,N as z,O as E,R as ie,h as Q,j as y,q as ee,r as te,t as M,v as re,w as j}from"./HTASM5P7.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;if(this._entries.size===1&&i?.length===1){let r=this._entries.keys().next().value;if(r!==void 0){this._entries.set(r,i[0]),this._set("values",i);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")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as N}from"./Y5Y7IXOV.js";import{a as K,b as Q}from"./B4MSRQLW.js";import{a as X}from"./2GBIDGIK.js";import"./GZXN456V.js";import"./H4Q2JVNO.js";import{a as _}from"./KK62TWI2.js";import{A as V,B as z,C as S,D as $,E as U,F as j,G as I,J as w,K as u,L as q,M as E,N as k,O as v,P,R as J,h as H,j as a,l as R,o as b,p as G,t as F,z as W}from"./3X2MVQTG.js";var Y=(l,e,t)=>{let s=new Map;for(let i=e;i<=t;i++)s.set(l[i],i);return s},D=V(class extends z{constructor(l){if(super(l),l.type!==W.CHILD)throw Error("repeat() can only be used in text expressions")}dt(l,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let i=[],o=[],n=0;for(let r of l)i[n]=s?s(r,n):n,o[n]=t(r,n),n++;return{values:o,keys:i}}render(l,e,t){return this.dt(l,e,t).values}update(l,[e,t,s]){let i=j(l),{values:o,keys:n}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=n,o;let r=this.ut??=[],f=[],x,A,d=0,p=i.length-1,c=0,m=o.length-1;for(;d<=p&&c<=m;)if(i[d]===null)d++;else if(i[p]===null)p--;else if(r[d]===n[c])f[c]=$(i[d],o[c]),d++,c++;else if(r[p]===n[m])f[m]=$(i[p],o[m]),p--,m--;else if(r[d]===n[m])f[m]=$(i[d],o[m]),S(l,f[m+1],i[d]),d++,m--;else if(r[p]===n[c])f[c]=$(i[p],o[c]),S(l,i[d],i[p]),p--,c++;else if(x===void 0&&(x=Y(n,c,m),A=Y(r,d,p)),x.has(r[d]))if(x.has(r[p])){let g=A.get(n[c]),T=g!==void 0?i[g]:null;if(T===null){let M=S(l,i[d]);$(M,o[c]),f[c]=M}else f[c]=$(T,o[c]),S(l,i[d],T),i[g]=null;c++}else I(i[p]),p--;else I(i[d]),d++;for(;c<=m;){let g=S(l,f[m+1]);$(g,o[c]),f[c++]=g}for(;d<=p;){let g=i[d++];g!==null&&I(g)}return this.ut=n,U(l,f),R}});var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Z=({fieldType:l})=>a`<calcite-icon scale=s .icon=${h.get(l)}></calcite-icon>`;function ee(l){return!!l.length&&"fields"in l[0]}function y(l){return!!l.length&&"subFieldInfos"in l[0]}function te(l){return l.filter(e=>y(e.fields))}function ie(l){return l.flatMap(e=>e.fields)}function se(l){return l.flatMap(e=>y(e.fields)?[]:e.fields)}function C(l){return l.flatMap(e=>y(e.fields)?e.fields.flatMap(t=>t.subFieldInfos):e.fields)}function le(l,e){return l.flatMap(t=>y(t.fields)?t.fields.flatMap(s=>s.subFieldInfos.filter(i=>L(i,e,!0))):t.fields.filter(s=>B(s,e)))}function B(l,e){return e?"subFieldInfos"in l?L(l,e)||l.subFieldInfos.some(t=>L(t,e,!0)):L(l,e):!0}function L(l,e,t=!1){return[t?l.name.split("/").pop():l.name,l.alias,l.description].some(s=>s?.toLocaleLowerCase().includes(e.toLocaleLowerCase()))}var oe=H`.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}`,O=class extends q{constructor(){super(...arguments),this._messages=X({blocking:!0}),this.popoverNode=w(),this.listWrapper=w(),this.listNode=w(),this.flowElement=w(),this.panelElement=w(),this.dropdownNode=w(),this.fieldInfoFlowItemEl=w(),this.allLists=[],this.filterText="",this.panelCutOffHeight=0,this.initialized=!1,this._propWatcherTask=new K(this,{task:async([e])=>{if(!this.listOnly&&!Q(e?.refElement))throw b("error",this,G("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=F(),this.arcgisClose=F(),this.arcgisDeleteField=F(),this.arcgisEditField=F(),this.arcgisFieldPickListChange=F(),this.arcgisFieldPickListDismissed=F(),this.arcgisFieldPickListSortByChange=F(),this.arcgisSortByChange=F()}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=oe}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,b("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],s=t.filter(i=>i.type==="none");return t=t.filter(i=>i.type!=="none"),this.lastSortBy==="display"?t.sort((i,o)=>i.alias.localeCompare(o.alias)):this.lastSortBy==="field"?t.sort((i,o)=>i.name.localeCompare(o.name)):this.lastSortBy==="type"&&t.sort((i,o)=>i.type.localeCompare(o.type)),t=t.concat(s),t}isExpression(e){return this.customExpressionCheck?this.customExpressionCheck(e):e.name.includes(N.expression)}canDeselectAll(){let e=C(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(N.relationship)||e.type==="none"):!1}updateGroupedLists(){if(this.fields)if(this.allLists=[],ee(this.fields))for(let e of this.fields){if(this.listOnly&&y(e.fields)){b("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 y(e)?this.getSortedList(e).map(t=>({...t,subFieldInfos:this.getSortedList(t.subFieldInfos).map(s=>({...s,name:`${t.name}/${s.name}`}))})):this.getSortedList(e)}addFieldInfoFlowItem(e,t){let s=this.flowElement.value,i=P(a`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.name} class="panel" style=${k(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${o=>{o.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${u(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang??v} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);s.appendChild(i),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl?.value.setFocus()},1)}addSubFieldInfoFlowItem(e,t){let s=this.flowElement.value,i=e.subFieldInfos.filter(n=>L(n,this.filterText,!0)),o=P(a`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.description??void 0} class="panel" style=${k(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${n=>{n.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${u(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias??e.name} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${n=>{this.updateSelectedFieldsForList(n.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}))}}>${i.map(n=>this.renderCalciteListItem(n,!1))}</calcite-list>${this.filterText&&!i.length&&this.filterNoResultsText?.length!==0?a`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}</calcite-flow-item>`);s.appendChild(o),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 s=new Set(t.map(r=>r.name)),i=e.selectedItems.map(r=>r.value),o=this.selectedFields.filter(r=>!s.has(r)||i.includes(r)),n=i.filter(r=>!this.selectedFields.includes(r));this.selectedFields=this.multiple?[...new Set([...o,...n])]:i,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=C(this.allLists).map(o=>o.name),t=new Set(this.selectedFields),s=e.filter(o=>t.has(o)),i=s.length!==this.selectedFields.length||s.some((o,n)=>o!==this.selectedFields[n]);return i&&(this.selectedFields=[...s]),i}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"),_(`${t.autoClose}`,a`<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()}} ${u(this.popoverNode)}><calcite-flow style=${k({width:`${t.popoverWidth??t.refElement.getBoundingClientRect().width}px`,...t.maxHeight&&{maxHeight:t.maxHeight}})} ${u(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${u(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple||!this.hideCancel)&&a`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple&&!this.hideCancel?a`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>`:a`${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=se(this.allLists),s=te(this.allLists),i=C(this.allLists).length>=this.showFilterLength;return t.length||s.length?s.length?this.renderSplitLists(t,s,i):this.renderTopLevelOnlyFieldList(e,t,i):a`<slot name=no-fields></slot>`}renderSplitLists(e,t,s){let i=C(this.allLists),o=ie(this.allLists).some(n=>B(n,this.filterText));return a`${s?a`<div class="list-controls"><calcite-filter .items=${i} .filterProps=${["name","alias","description"]} .placeholder=${this.filterPlaceholderText??this._messages.filter} @calciteFilterChange=${n=>{this.filterText=n.currentTarget.value,this.filterFields=this.filterText?le(this.allLists,this.filterText).map(r=>r.name):void 0}}></calcite-filter>${this.renderSortButton()}</div>`:null}<div class=${E(this.listOnly?"":"list-wrapper")} ${u(this.listWrapper)}>${this.shouldRenderSelectionButton(s)?this.renderSelectionButton():null}${this.renderSplitSubFieldLists(t)}${e.length?this.renderSplitTopLevelFieldList(e,!0):null}</div>${this.filterText&&!o&&this.filterNoResultsText?.length!==0?a`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}`}renderSplitSubFieldLists(e){let t=e.map(s=>({...s,fields:s.fields.filter(i=>B(i,this.filterText))})).filter(s=>!!s.fields.length);return D(t,s=>s.title,s=>a`<calcite-list selection-mode=none .label=${s.title??this.heading??""}><calcite-list-item-group .heading=${s.title}>${D(s.fields,i=>i.name,i=>a`<calcite-list-item .label=${i.alias||i.name} .description=${this.multiple?this._messages.subFieldsSelected.replace("${count}",`${i.subFieldInfos.filter(o=>this.selectedFields.includes(o.name)).length}`):void 0} .value=${i.name} @click=${o=>this.addSubFieldInfoFlowItem(i,o.currentTarget)} @keydown=${o=>{o.key==="Enter"&&this.addSubFieldInfoFlowItem(i,o.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 a`<calcite-list .label=${this.heading||(this.multiple?this._messages.headerSelect:this._messages.header)} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${()=>this.handleListSelectionChange(e)} ${u(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`}renderTopLevelOnlyFieldList(e,t,s){return a`<div class=${E(this.listOnly?"":"list-wrapper")} ${u(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple?"multiple":"single"} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholderText??this._messages.filter} @calciteListChange=${()=>this.handleListSelectionChange(t)} @calciteListFilter=${i=>{i.stopPropagation(),this.filterFields=this.listNode.value.filteredItems?.map(o=>o.value),this.filterText=this.listNode.value.filterText}} ${u(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(s)?this.renderSelectionButton():null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`}renderSortButton(e){let t=C(this.allLists);if(!(t.length>=this.showFilterLength&&!this.hideSort))return"";let s=t.every(i=>!!i.type);return a`<calcite-dropdown slot=${e??v} 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()} ${u(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort??""} title=${this._messages.sort??v}><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&&a`<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 a`<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=C(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(s=>!!s.fields.length&&!y(s.fields)).map(s=>({...s,fields:e?s.fields.filter(i=>B(i,this.filterText)):s.fields})).filter(s=>!!s.fields.length);return t.length===1&&!t[0].title?this.renderListItems(t[0].fields):t.map(s=>a`<calcite-list-item-group .heading=${s.title}>${this.renderListItems(s.fields)}</calcite-list-item-group>`)}renderListItems(e){return e.map(t=>this.renderCalciteListItem(t))}renderCalciteListItem(e,t=!0){let s=t&&this.showFieldInfoCheck(e),i=this.showFieldTypeIcon&&!!e.type;return _(e.name,a`<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}}>${i&&a`<div slot=actions-end class="field-icons">${Z({fieldType:e.type})}</div>`||""}${this.renderInfoAction(e,s)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`)}renderInfoAction(e,t){let{_messages:s}=this;return t?a`<calcite-action slot=actions-end .text=${s.info} title=${s.info??v} scale=s icon=information @click=${i=>{i.stopPropagation();let o=i.currentTarget;this.addFieldInfoFlowItem(e,o)}}></calcite-action>`:""}renderEditAction(e){let{_messages:t}=this;return e.showEditAction?a`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit??v} scale=s icon=pencil @click=${s=>{s.stopPropagation(),this.arcgisEditField.emit({fieldName:e.name})}}></calcite-action>`:""}renderDeleteAction(e){let{_messages:t}=this;return e.showDeleteAction?a`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete??v} scale=s icon=trash @click=${s=>{s.stopPropagation(),this.arcgisDeleteField.emit({fieldName:e.name})}}></calcite-action>`:""}renderAddButton(){return this.multiple?a`<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?"":a`<calcite-button appearance=outline-fill .width=${this.multiple?"half":"full"} @click=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}}>${this._messages.cancel}</calcite-button>`}};J("arcgis-field-pick-list",O);export{O as ArcgisFieldPickList};
|
|
2
|
+
import{a as N}from"./Y5Y7IXOV.js";import{a as K,b as Q}from"./SSVHIHJO.js";import{a as X}from"./4WPVYHCO.js";import"./ONVTTBLX.js";import"./H4Q2JVNO.js";import{a as _}from"./ONNE6YGE.js";import{A as V,B as z,C as S,D as $,E as U,F as j,G as I,J as w,K as u,L as q,M as E,N as k,O as v,P,R as J,h as H,j as a,l as R,o as b,p as G,t as F,z as W}from"./HTASM5P7.js";var Y=(l,e,t)=>{let s=new Map;for(let i=e;i<=t;i++)s.set(l[i],i);return s},D=V(class extends z{constructor(l){if(super(l),l.type!==W.CHILD)throw Error("repeat() can only be used in text expressions")}dt(l,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let i=[],o=[],n=0;for(let r of l)i[n]=s?s(r,n):n,o[n]=t(r,n),n++;return{values:o,keys:i}}render(l,e,t){return this.dt(l,e,t).values}update(l,[e,t,s]){let i=j(l),{values:o,keys:n}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=n,o;let r=this.ut??=[],f=[],x,A,d=0,p=i.length-1,c=0,m=o.length-1;for(;d<=p&&c<=m;)if(i[d]===null)d++;else if(i[p]===null)p--;else if(r[d]===n[c])f[c]=$(i[d],o[c]),d++,c++;else if(r[p]===n[m])f[m]=$(i[p],o[m]),p--,m--;else if(r[d]===n[m])f[m]=$(i[d],o[m]),S(l,f[m+1],i[d]),d++,m--;else if(r[p]===n[c])f[c]=$(i[p],o[c]),S(l,i[d],i[p]),p--,c++;else if(x===void 0&&(x=Y(n,c,m),A=Y(r,d,p)),x.has(r[d]))if(x.has(r[p])){let g=A.get(n[c]),T=g!==void 0?i[g]:null;if(T===null){let M=S(l,i[d]);$(M,o[c]),f[c]=M}else f[c]=$(T,o[c]),S(l,i[d],T),i[g]=null;c++}else I(i[p]),p--;else I(i[d]),d++;for(;c<=m;){let g=S(l,f[m+1]);$(g,o[c]),f[c++]=g}for(;d<=p;){let g=i[d++];g!==null&&I(g)}return this.ut=n,U(l,f),R}});var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Z=({fieldType:l})=>a`<calcite-icon scale=s .icon=${h.get(l)}></calcite-icon>`;function ee(l){return!!l.length&&"fields"in l[0]}function y(l){return!!l.length&&"subFieldInfos"in l[0]}function te(l){return l.filter(e=>y(e.fields))}function ie(l){return l.flatMap(e=>e.fields)}function se(l){return l.flatMap(e=>y(e.fields)?[]:e.fields)}function C(l){return l.flatMap(e=>y(e.fields)?e.fields.flatMap(t=>t.subFieldInfos):e.fields)}function le(l,e){return l.flatMap(t=>y(t.fields)?t.fields.flatMap(s=>s.subFieldInfos.filter(i=>L(i,e,!0))):t.fields.filter(s=>B(s,e)))}function B(l,e){return e?"subFieldInfos"in l?L(l,e)||l.subFieldInfos.some(t=>L(t,e,!0)):L(l,e):!0}function L(l,e,t=!1){return[t?l.name.split("/").pop():l.name,l.alias,l.description].some(s=>s?.toLocaleLowerCase().includes(e.toLocaleLowerCase()))}var oe=H`.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}`,O=class extends q{constructor(){super(...arguments),this._messages=X({blocking:!0}),this.popoverNode=w(),this.listWrapper=w(),this.listNode=w(),this.flowElement=w(),this.panelElement=w(),this.dropdownNode=w(),this.fieldInfoFlowItemEl=w(),this.allLists=[],this.filterText="",this.panelCutOffHeight=0,this.initialized=!1,this._propWatcherTask=new K(this,{task:async([e])=>{if(!this.listOnly&&!Q(e?.refElement))throw b("error",this,G("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=F(),this.arcgisClose=F(),this.arcgisDeleteField=F(),this.arcgisEditField=F(),this.arcgisFieldPickListChange=F(),this.arcgisFieldPickListDismissed=F(),this.arcgisFieldPickListSortByChange=F(),this.arcgisSortByChange=F()}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=oe}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,b("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],s=t.filter(i=>i.type==="none");return t=t.filter(i=>i.type!=="none"),this.lastSortBy==="display"?t.sort((i,o)=>i.alias.localeCompare(o.alias)):this.lastSortBy==="field"?t.sort((i,o)=>i.name.localeCompare(o.name)):this.lastSortBy==="type"&&t.sort((i,o)=>i.type.localeCompare(o.type)),t=t.concat(s),t}isExpression(e){return this.customExpressionCheck?this.customExpressionCheck(e):e.name.includes(N.expression)}canDeselectAll(){let e=C(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(N.relationship)||e.type==="none"):!1}updateGroupedLists(){if(this.fields)if(this.allLists=[],ee(this.fields))for(let e of this.fields){if(this.listOnly&&y(e.fields)){b("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 y(e)?this.getSortedList(e).map(t=>({...t,subFieldInfos:this.getSortedList(t.subFieldInfos).map(s=>({...s,name:`${t.name}/${s.name}`}))})):this.getSortedList(e)}addFieldInfoFlowItem(e,t){let s=this.flowElement.value,i=P(a`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.name} class="panel" style=${k(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${o=>{o.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${u(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang??v} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);s.appendChild(i),this.panelElement.value.selected=!1,setTimeout(()=>{this.fieldInfoFlowItemEl?.value.setFocus()},1)}addSubFieldInfoFlowItem(e,t){let s=this.flowElement.value,i=e.subFieldInfos.filter(n=>L(n,this.filterText,!0)),o=P(a`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.description??void 0} class="panel" style=${k(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${n=>{n.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${u(this.fieldInfoFlowItemEl)}><calcite-list .label=${e.alias??e.name} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${n=>{this.updateSelectedFieldsForList(n.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}))}}>${i.map(n=>this.renderCalciteListItem(n,!1))}</calcite-list>${this.filterText&&!i.length&&this.filterNoResultsText?.length!==0?a`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}</calcite-flow-item>`);s.appendChild(o),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 s=new Set(t.map(r=>r.name)),i=e.selectedItems.map(r=>r.value),o=this.selectedFields.filter(r=>!s.has(r)||i.includes(r)),n=i.filter(r=>!this.selectedFields.includes(r));this.selectedFields=this.multiple?[...new Set([...o,...n])]:i,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=C(this.allLists).map(o=>o.name),t=new Set(this.selectedFields),s=e.filter(o=>t.has(o)),i=s.length!==this.selectedFields.length||s.some((o,n)=>o!==this.selectedFields[n]);return i&&(this.selectedFields=[...s]),i}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"),_(`${t.autoClose}`,a`<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()}} ${u(this.popoverNode)}><calcite-flow style=${k({width:`${t.popoverWidth??t.refElement.getBoundingClientRect().width}px`,...t.maxHeight&&{maxHeight:t.maxHeight}})} ${u(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${u(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple||!this.hideCancel)&&a`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple&&!this.hideCancel?a`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>`:a`${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=se(this.allLists),s=te(this.allLists),i=C(this.allLists).length>=this.showFilterLength;return t.length||s.length?s.length?this.renderSplitLists(t,s,i):this.renderTopLevelOnlyFieldList(e,t,i):a`<slot name=no-fields></slot>`}renderSplitLists(e,t,s){let i=C(this.allLists),o=ie(this.allLists).some(n=>B(n,this.filterText));return a`${s?a`<div class="list-controls"><calcite-filter .items=${i} .filterProps=${["name","alias","description"]} .placeholder=${this.filterPlaceholderText??this._messages.filter} @calciteFilterChange=${n=>{this.filterText=n.currentTarget.value,this.filterFields=this.filterText?le(this.allLists,this.filterText).map(r=>r.name):void 0}}></calcite-filter>${this.renderSortButton()}</div>`:null}<div class=${E(this.listOnly?"":"list-wrapper")} ${u(this.listWrapper)}>${this.shouldRenderSelectionButton(s)?this.renderSelectionButton():null}${this.renderSplitSubFieldLists(t)}${e.length?this.renderSplitTopLevelFieldList(e,!0):null}</div>${this.filterText&&!o&&this.filterNoResultsText?.length!==0?a`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}`}renderSplitSubFieldLists(e){let t=e.map(s=>({...s,fields:s.fields.filter(i=>B(i,this.filterText))})).filter(s=>!!s.fields.length);return D(t,s=>s.title,s=>a`<calcite-list selection-mode=none .label=${s.title??this.heading??""}><calcite-list-item-group .heading=${s.title}>${D(s.fields,i=>i.name,i=>a`<calcite-list-item .label=${i.alias||i.name} .description=${this.multiple?this._messages.subFieldsSelected.replace("${count}",`${i.subFieldInfos.filter(o=>this.selectedFields.includes(o.name)).length}`):void 0} .value=${i.name} @click=${o=>this.addSubFieldInfoFlowItem(i,o.currentTarget)} @keydown=${o=>{o.key==="Enter"&&this.addSubFieldInfoFlowItem(i,o.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 a`<calcite-list .label=${this.heading||(this.multiple?this._messages.headerSelect:this._messages.header)} .selectionMode=${this.multiple?"multiple":"single"} @calciteListChange=${()=>this.handleListSelectionChange(e)} ${u(this.listNode)}><slot name=content-center></slot>${this.renderGroupedListItems(t)}</calcite-list>`}renderTopLevelOnlyFieldList(e,t,s){return a`<div class=${E(this.listOnly?"":"list-wrapper")} ${u(this.listWrapper)}><calcite-list .label=${e} .selectionMode=${this.multiple?"multiple":"single"} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholderText??this._messages.filter} @calciteListChange=${()=>this.handleListSelectionChange(t)} @calciteListFilter=${i=>{i.stopPropagation(),this.filterFields=this.listNode.value.filteredItems?.map(o=>o.value),this.filterText=this.listNode.value.filterText}} ${u(this.listNode)}>${this.renderSortButton("filter-actions-end")}${this.shouldRenderSelectionButton(s)?this.renderSelectionButton():null}<slot name=content-center></slot>${this.renderGroupedListItems(!1)}</calcite-list></div>`}renderSortButton(e){let t=C(this.allLists);if(!(t.length>=this.showFilterLength&&!this.hideSort))return"";let s=t.every(i=>!!i.type);return a`<calcite-dropdown slot=${e??v} 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()} ${u(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort??""} title=${this._messages.sort??v}><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&&a`<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 a`<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=C(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(s=>!!s.fields.length&&!y(s.fields)).map(s=>({...s,fields:e?s.fields.filter(i=>B(i,this.filterText)):s.fields})).filter(s=>!!s.fields.length);return t.length===1&&!t[0].title?this.renderListItems(t[0].fields):t.map(s=>a`<calcite-list-item-group .heading=${s.title}>${this.renderListItems(s.fields)}</calcite-list-item-group>`)}renderListItems(e){return e.map(t=>this.renderCalciteListItem(t))}renderCalciteListItem(e,t=!0){let s=t&&this.showFieldInfoCheck(e),i=this.showFieldTypeIcon&&!!e.type;return _(e.name,a`<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}}>${i&&a`<div slot=actions-end class="field-icons">${Z({fieldType:e.type})}</div>`||""}${this.renderInfoAction(e,s)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`)}renderInfoAction(e,t){let{_messages:s}=this;return t?a`<calcite-action slot=actions-end .text=${s.info} title=${s.info??v} scale=s icon=information @click=${i=>{i.stopPropagation();let o=i.currentTarget;this.addFieldInfoFlowItem(e,o)}}></calcite-action>`:""}renderEditAction(e){let{_messages:t}=this;return e.showEditAction?a`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit??v} scale=s icon=pencil @click=${s=>{s.stopPropagation(),this.arcgisEditField.emit({fieldName:e.name})}}></calcite-action>`:""}renderDeleteAction(e){let{_messages:t}=this;return e.showDeleteAction?a`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete??v} scale=s icon=trash @click=${s=>{s.stopPropagation(),this.arcgisDeleteField.emit({fieldName:e.name})}}></calcite-action>`:""}renderAddButton(){return this.multiple?a`<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?"":a`<calcite-button appearance=outline-fill .width=${this.multiple?"half":"full"} @click=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}}>${this._messages.cancel}</calcite-button>`}};J("arcgis-field-pick-list",O);export{O as ArcgisFieldPickList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as k,b as j,c as R,d as E,e as y,f as z,g as _,h as F,i as B,j as K,k as q,l as P,m as S,n as X,o as Y,p as L,q as V,r as T,s as Z}from"./Z5QBBHLD.js";import{a as J,b as p}from"./B4MSRQLW.js";import{a as Q}from"./2GBIDGIK.js";import"./GZXN456V.js";import"./H4Q2JVNO.js";import{a as $}from"./KK62TWI2.js";import{K as b,L as U,M as I,R as G,h as H,j as u,o as N,p as D,t as x}from"./3X2MVQTG.js";export default $arcgis.t(([se,C,h,W,O,ae,re,ee,ne])=>{function oe(a){return a.associatedLayer?.url}var le={dateStyle:"short",timeStyle:"short"},de={timeStyle:"medium"};function ue(a){let{layer:e,fieldName:t}=a,i,r=W.supportsFieldConfiguration(e),s;"popupTemplate"in e&&(s=e.popupTemplate);let o=s?s.fieldInfos:[];return ie(a)?.filter(d=>d.name===t).forEach(d=>{let n=!r&&o?o.filter(c=>c.fieldName===d.name):void 0,m=r?e.getFieldAlias(t):n?.length?n[0].label:d.alias;/^raster.(item|service)pixelvalue/iu.test(t)&&(d.type="double");let l={layerField:d,label:m||d.name};l.codedValues=fe(t,a),pe(l),l.simpleFieldType&&(i=l)}),i}function ie(a){let{layer:e}=a;return F(e)||T(e)||_(e)&&e.rasterFields.length?e.rasterFields:e.fields}async function te(a){a.statisticsStatus="in-progress";let{layer:e,view:t}=a;if(F(e)||T(e)||S(e)||V(e))throw new Error("could not get feature count");try{return await ge(e,t)}catch{return}}async function ce(a){let{layer:e,view:t,fieldName:i,fieldInfo:r}=a;if(F(e)||T(e)||V(e))throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");if(!r||r.layerField.type==="oid"||r.layerField.type==="guid"||r.layerField.type==="global-id")return{totalCount:await te(a),nullcount:0};try{let s=await ae({layer:e,view:t,field:i,outStatisticTypes:{exclude:["median"]}});if(!p(s.count))throw new Error("could not get statistics");let o="sourceJSON"in e&&e.sourceJSON.maxRecordCount===s.count;if(p(s.nullcount)&&!o)return{...s,totalCount:s.count+s.nullcount};{let d=await te(a);return{...s,totalCount:d}}}catch{throw new Error("could not get statistics")}}async function me(a){let{layer:e,view:t,fieldName:i}=a;if(F(e)||T(e)||V(e))throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");E(e)&&(e.outFields=["*"]);try{return await re({layer:e,view:t,field:i})}catch{throw new Error("could not get unique values")}}function pe(a){switch(a.layerField.type){case"string":a.simpleFieldType="string";break;case"date":a.simpleFieldType="date";break;case"timestamp-offset":a.simpleFieldType="timestamp-offset";break;case"date-only":a.simpleFieldType="date-only";break;case"time-only":a.simpleFieldType="time-only";break;case"oid":a.simpleFieldType="oid";break;case"guid":case"global-id":a.simpleFieldType="guid";break;case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":a.simpleFieldType="number";break;default:a.simpleFieldType="string"}}function fe(a,e){let{layer:t}=e;if(L(t)&&t.subtypeField===a){let n=t.parent?.subtypes?.find(m=>m.code===t.subtypeCode);if(n)return[new ee({code:n.code,name:n.name})]}if(!y(t)&&!_(t))return;let i=y(t)?t.typeIdField:void 0,r=y(t)?t.types:void 0,s,o=ie(e)?.find(n=>n.name===a),d=o?.domain;return y(t)&&i&&r?(i===a?s=r.map(n=>new ee({code:n.id,name:n.name})):(s=[],r.forEach(n=>{if(!n.domains[a]||n.domains[a].type==="inherited"){let m=d;m?.codedValues&&m.codedValues.forEach(l=>{let c=!1;s.forEach(g=>{g.code===l.code&&(c=!0,`, ${g.name},`.includes(`, ${l.name},`)||(g.name+=`, ${l.name}`))}),c||s.push(O.clone(l))})}else n.domains[a].codedValues&&n.domains[a].codedValues.forEach(m=>{let l=!1;s.forEach(c=>{c.code===m.code&&(l=!0,`, ${c.name},`.includes(`, ${m.name},`)||(c.name+=`, ${m.name}`))}),l||s.push(O.clone(m))})})),!s.length&&d?.codedValues&&(s=O.clone(d.codedValues))):d?.codedValues&&(s=o?.domain?.codedValues),s?.length?s:void 0}async function he(a){let{view:e,layer:t}=a;if(_(t)||F(t)||T(t))throw new Error("could not get feature");if(y(t)&&!t.url||Z(t)){let i=t.createQuery();i.start=0,i.num=5,i.outFields=["*"];let r=await t.queryFeatures(i);if(r.features.length)return r;throw new Error("could not get feature")}else{if(!e)return await A(a);let i;if(L(t)||X(t)){let s=t.parent;for(;Y(s)||K(s);)s=s.parent;B(s)&&(i=await e.whenLayerView(s))}else i=await e.whenLayerView(t);let r=i.availableFields.length===t.fields.length;if(i&&(r||(S(t)||q(t))&&i.availableFields.length>0)){let s=i.createQuery();s.start=0,s.num=5,s.outFields=["*"];let o=await i.queryFeatures(s);return o.features?.length?o:await A(a)}else return await A(a)}}async function A(a){let{layer:e}=a;if(_(e)||F(e)||S(e)||q(e))throw new Error("cannot get feature from service");let t=new ne({where:"1=1",outFields:["*"],returnGeometry:!1});return"sourceJSON"in e&&e.sourceJSON?.advancedQueryCapabilities?.supportsPagination&&(t.num=1),await e.queryFeatures(t)}async function ge(a,e){if(E(a))return await ve(a);if(y(a)||j(a)||P(a)||Z(a)||z(a))return await a.queryFeatureCount();if(e&&(S(a)||q(a)))return await ye(a,e)}async function ve(a){let e=a.createQuery();e.outFields=["*"];let t=await a.queryFeatures(e);if(t.features.length)return t.features.length;throw new Error("could not get feature count")}async function ye(a,e){return await(await e.whenLayerView(a)).queryFeatureCount()}var Fe=H`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-surface-2)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`,M=class extends U{constructor(){super(...arguments),this._messages=Q({blocking:!0}),this.initialized=!1,this._propWatcherTask=new J(this,{task:async([e,t])=>{let i=p(e)&&p(t);if(p(e)||N("error",this,D("layer")),p(t)||N("error",this,D("fieldName")),!i)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName]}),this.oneFeatureResponseStatus="missing",this.statisticsStatus="missing",this.uniqueValuesStatus="missing",this.hideAlias=!1,this.hideNumericFormat=!1,this.hideStatistics=!1,this.arcgisComplete=x(),this.arcgisFieldInfoComplete=x()}static{this.properties={oneFeatureResponseStatus:16,oneFeatureResponse:16,statisticsStatus:16,statistics:16,uniqueValuesStatus:16,uniqueValues:16,view:0,layer:0,fieldName:1,hideAlias:5,hideNumericFormat:5,hideStatistics:5}}static{this.styles=Fe}async refresh(){await this.processProps(),this.requestUpdate()}willUpdate(e){this.initialized&&(e.has("fieldName")||e.has("layer"))&&this.processProps()}disconnectedCallback(){super.disconnectedCallback(),this.timeZoneHandle?.remove()}async processProps(){let{view:e,layer:t,fieldName:i,hideStatistics:r}=this;if(!t||!i)return;let s;if(t.declaredClass==="esri.layers.support.Sublayer"){let o=t;e&&await C.whenOnce(()=>!e.updating),s=await o.createFeatureLayer(),await s?.load()}if(this.oneFeatureResponseStatus="missing",this.oneFeatureResponse=void 0,this.statisticsStatus="missing",this.statistics=void 0,this.uniqueValuesStatus="missing",this.uniqueValues=void 0,this.props={view:e,layer:s??t,fieldName:i,hideStatistics:r},this.props.fieldInfo=ue(this.props),!this.props.fieldInfo){N("error",this,`Field ${i} does not exist in layer.`);return}P(t)&&se.request.interceptors?.push({urls:`${oe(t)}/${t.layerId}`,before(o){o.requestOptions.authMode="no-prompt"}}),this.processPropsPart2()}async processPropsPart2(){let{layer:e,hideStatistics:t}=this;if(await this.requestOneFeature(),S(e)||k(e)||R(e)){this.uniqueValuesStatus="failed",this.statisticsStatus="failed";return}t?this.uniqueValuesStatus="failed":await this.requestUniqueValues(),t?this.statisticsStatus="failed":await this.requestStatistics(),this.setUpTimeZoneHandle(),this.initialized=!0}async requestOneFeature(){this.oneFeatureResponseStatus="in-progress";try{let e=await he(this.props);this.oneFeatureResponse=e,this.oneFeatureResponseStatus="success"}catch{this.oneFeatureResponseStatus="failed"}}async requestUniqueValues(){this.uniqueValuesStatus="in-progress";try{let e=await me(this.props);this.uniqueValues=e,e?.uniqueValueInfos?.length?this.uniqueValuesStatus="success":this.uniqueValuesStatus="failed"}catch{this.uniqueValuesStatus="failed"}}async requestStatistics(){try{let e=await ce(this.props);if(!p(e.totalCount)&&p(e.count)&&this.uniqueValuesStatus==="success"){let t=this.uniqueValues?.uniqueValueInfos??[];for(let i=0;i<t.length;i++){let r=t[i];if(r.value===null){e.totalCount=r.count+e.count;break}}e.totalCount??=e.count}this.statistics=e,this.statisticsStatus="success"}catch{this.statisticsStatus="failed"}}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{props:e}=this,{view:t,fieldInfo:i}=e;["date","timestamp-offset"].includes(this._getStatisticsType(i))&&(this.timeZoneHandle=C.watch(()=>t?.timeZone,()=>this.requestUpdate()))}_getFieldTypeLabel(e){let{_messages:t}=this,i=t.fieldTypes;switch(e){case"big-integer":return i.bigInteger;case"date":return i.date;case"date-only":return i.dateOnly;case"double":return i.double;case"global-id":return i.globalId;case"guid":return i.guid;case"integer":return i.integer;case"long":return i.long;case"oid":return i.oid;case"single":return i.single;case"small-integer":return i.smallInteger;case"string":return i.string;case"time-only":return i.timeOnly;case"timestamp-offset":return i.timestampOffset;default:return i.string}}_getStatisticsType(e){switch(e.layerField.type){case"big-integer":case"double":case"integer":case"single":case"small-integer":{if(e.codedValues)return"string";switch(e.layerField.valueType){case"url":case"binary":case"description":case"location-or-place-name":case"name-or-title":case"ordered-or-ranked":case"type-or-category":return"string";default:return"number"}}case"date":return"date";case"date-only":return"date-only";case"string":return"string";case"time-only":return"time-only";case"timestamp-offset":return"timestamp-offset";default:return"string"}}_getFieldValueTypeCamelCase(e){switch(e.layerField.valueType){case"count-or-amount":return"countOrAmount";case"date-and-time":return"dateAndTime";case"location-or-place-name":return"locationOrPlaceName";case"margin-of-error":return"marginOfError";case"name-or-title":return"nameOrTitle";case"ordered-or-ranked":return"orderedOrRanked";case"percentage-or-ratio":return"percentageOrRatio";case"type-or-category":return"typeOrCategory";case"unique-identifier":return"uniqueIdentifier";case"phone-number":return"phoneNumber";case"email-address":return"emailAddress";default:return e.layerField.valueType??void 0}}_getDisplayString(e,t){let{props:i}=this,{fieldInfo:r}=i;switch(r.simpleFieldType){case"date":return this._getDateString(e,t);case"date-only":return this._getDateOnlyString(e,t);case"guid":return this._getGuidString(e);case"number":return this._getNumberString(e,t);case"time-only":return this._getTimeOnlyString(e,t);case"timestamp-offset":return this._getTimestampOffsetString(e,t);default:return`${e}`}}_getDateString(e,t){let{view:i}=this.props;return i&&i.timeZone==="unknown"?h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"})}_getTimestampOffsetString(e,t){let{view:i}=this.props;return typeof e=="string"?i&&i.timeZone==="unknown"?h.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):h.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"}):this._getDateString(e,t)}_getDateOnlyString(e,t){return h.formatDateOnly(e,this.getIntlDateTimeFormattingOptions("short-date",t))}_getTimeOnlyString(e,t){return typeof e=="string"?h.formatTimeOnly(e,this.getIntlDateTimeFormattingOptions("short-date-long-time",t)):h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("long-time",{...t,isTimeOnly:!0}),timeZone:"utc"})}_getGuidString(e){return e.startsWith("{")?e:`{${e}}`}_getNumberString(e,t){let i=t?.useFieldFormatting?e:Math.round(e*100)/100;return h.formatNumber(i,this.getIntlNumberFormattingOptions(t))}_printNumValue(e,t){return p(e)?this._getNumberString(e,t):"--"}_setCompleteRef(e){if(this.completeRefHandler&&clearInterval(this.completeRefHandler),e){let t=0;this.completeRefHandler=setInterval(()=>{(t>130||this.isFinished(this.uniqueValuesStatus)&&this.isFinished(this.statisticsStatus))&&(clearInterval(this.completeRefHandler),this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit()),t++},1e3)}}getCurrentFieldFormat(){let{props:e}=this,{layer:t,fieldName:i}=e;return(this.originalLayerSupportsFieldConfigs()?t.getFieldConfiguration(i):void 0)?.fieldFormat??void 0}getIntlNumberFormattingOptions(e){let t=this.getCurrentFieldFormat();if(!e?.useFieldFormatting)return t?{useGrouping:["always","auto"].includes(t.useGrouping)}:h.convertNumberFormatToIntlOptions({digitSeparator:this.getPopupTemplateFieldInfo()?.format?.digitSeparator??!0});let i=t?{minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,useGrouping:["always","auto"].includes(t.useGrouping)}:void 0;if(i)return i;let r=this.getPopupTemplateFieldInfo();return h.convertNumberFormatToIntlOptions({digitSeparator:r?.format?.digitSeparator??!0,places:r?.format?.places??2})}getIntlDateTimeFormattingOptions(e,t){let i=this.getCurrentFieldFormat();if(!t?.useFieldFormatting)return i?t?.isTimeOnly?de:le:h.convertDateFormatToIntlOptions(e);let r=i?{dateStyle:t?.isTimeOnly?void 0:i.dateStyle??void 0,year:i.dateStyle?void 0:i.year??void 0,month:i.dateStyle?void 0:i.month??void 0,timeStyle:i.timeStyle??void 0,hourCycle:i.hour12==="never"?"h23":"h11"}:void 0;if(r)return r;let s=this.getPopupTemplateFieldInfo();return h.convertDateFormatToIntlOptions(s?.format?.dateFormat??e)}originalLayerSupportsFieldConfigs(){let{layer:e}=this;return W.supportsFieldConfiguration(e)}getPopupTemplateFieldInfo(){let{props:e}=this,{layer:t,fieldName:i}=e;return("popupTemplate"in t?t.popupTemplate:void 0)?.fieldInfos?.find(r=>r.fieldName===i)}isFinished(e){return["success","failed"].includes(e)}render(){return this._propWatcherTask.render({pending:()=>u`<calcite-scrim loading></calcite-scrim>`,complete:()=>{let{props:e}=this,{fieldInfo:t}=e;return t?u`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>`:""},error:()=>""})}renderFieldType(){let{_messages:e,props:t}=this,{fieldInfo:i}=t,r=this._getFieldTypeLabel(i.layerField.type);return u`<div class="section"><div class="title">${e.fieldType}</div><div>${r}</div></div>`}renderFieldAlias(){let{_messages:e,props:t,hideAlias:i}=this,{fieldInfo:r}=t;return i?"":u`<div class="section"><div class="title">${e.fieldAlias}</div><div>${r.label}</div></div>`}renderFieldDescription(){let{_messages:e,props:t}=this,{layer:i}=t;if(!y(i))return"";let{fieldInfo:r}=t,s=r.layerField.description;return u`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${I({missing:!s})}>${s||e.fieldDescriptionNotSet}</div></div>`}renderFieldValueType(){let{_messages:e,props:t}=this,{layer:i}=t;if(!y(i))return"";let{fieldInfo:r}=t,s=this._getFieldValueTypeCamelCase(r);return u`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${I(s?"":"missing")}>${s?e.fieldValueTypes[s]:e.fieldValueTypeNotSet}</div></div>`}renderFieldSampleValue(){let{oneFeatureResponse:e,oneFeatureResponseStatus:t,statisticsStatus:i,statistics:r,uniqueValuesStatus:s,uniqueValues:o,_messages:d,props:n}=this,{layer:m,fieldName:l,fieldInfo:c}=n,{statistics:g}=d,f;if(F(m)||V(m)||!S(m)&&["string","oid","guid"].includes(this._getStatisticsType(c))&&s!=="failed")return"";t==="success"?e.features.forEach(v=>{(f===void 0||f===null&&v.attributes[l]!==null)&&(f=v.attributes[l])}):i==="success"?f=r?.min??void 0:s==="success"&&(f=o?.uniqueValueInfos?.[0]?.value??o?.uniqueValueInfos?.[1]?.value??void 0);let w=c.codedValues;return p(f)&&(w?f=w.find(v=>f===v.code)?.name||f:f=this._getDisplayString(f,{useFieldFormatting:!0})),u`<div class="section"><div class="title">${d.fieldSampleValue}</div><div class=${I(t==="failed"&&i==="failed"&&s==="failed"||!p(f)?"missing":"")}>${t==="success"||i==="success"||s==="success"?f?.toString()??g.allNulls:t==="failed"&&i==="failed"&&s==="failed"?d.fieldSampleNotAvailable:d.fieldSampleRetrieving}</div></div>`}renderFieldNumericFormat(){let{_messages:e,props:t,hideNumericFormat:i}=this,{fieldName:r,fieldInfo:s,layer:o}=t;if(i||!["double","long","single"].includes(s.layerField.type))return"";let d=this.originalLayerSupportsFieldConfigs()?o.getFieldConfiguration(r):void 0;if(d?.fieldFormat){let{minimumFractionDigits:m,maximumFractionDigits:l}=d.fieldFormat;return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}",m.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}",l.toString())}</div></div>`}let n="popupTemplate"in o?o.popupTemplate:void 0;if(n?.fieldInfos){let m=n.fieldInfos?.filter(l=>l.fieldName===r);if(m?.length){let l=m[0];if(p(l?.format?.places)){let c=l.format.places;return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}",c.toString())}</div></div>`}}}return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`}renderFieldStatistics(){let{statisticsStatus:e,uniqueValuesStatus:t,hideStatistics:i,_messages:r,props:s}=this,{layer:o,fieldInfo:d}=s;return i?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):k(o)||R(o)||S(o)||F(o)||V(o)||["long"].includes(d.layerField.type)?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):u`<div class="section"><div class="title">${r.fieldStatistics}</div>${!this.isFinished(t)&&!this.isFinished(e)?this.renderWaitingForStatistics():e==="failed"&&t==="failed"?this.renderNoStatistics():this.renderStatistics()}</div>`}renderWaitingForStatistics(){let{_messages:e}=this;return $("field-info-statistics-content",u`<div class="missing">${e.fieldStatisticsRetrieving}</div>`)}renderNoStatistics(){let{_messages:e}=this;return $("field-info-statistics-content",u`<div class="missing" ${b(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`)}renderStatistics(){let{props:e}=this,{fieldInfo:t}=e;switch(this._getStatisticsType(t)){case"number":return this.renderNumberStatistics();case"guid":case"oid":case"string":return this.renderStringStatistics();case"date":case"date-only":case"time-only":case"timestamp-offset":return this.renderDateStatistics();default:return""}}renderNumberStatistics(){let{statistics:e,uniqueValuesStatus:t,statisticsStatus:i,_messages:r}=this;if(!e)return this.isFinished(t)&&this.isFinished(i)?this.renderNoStatistics():this.renderWaitingForStatistics();let{statistics:s}=r;return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${s.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${p(e.sum)?u`<div class="statistics-row"><div>${s.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>`:null}${p(e.min)?u`<div class="statistics-row"><div>${s.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>`:null}${p(e.max)?u`<div class="statistics-row"><div>${s.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>`:null}${p(e.avg)?u`<div class="statistics-row"><div>${s.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>`:null}${p(e.stddev)?u`<div class="statistics-row"><div>${s.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>`:null}${this.renderNullValues()}</div>`)}renderStringStatistics(){let{statistics:e,uniqueValuesStatus:t,_messages:i}=this,{statistics:r}=i;return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${r.numberOfValues}</div>${t!=="success"?u`<div class="missing">--</div>`:u`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`)}renderDateStatistics(){let{statistics:e,view:t,props:i,uniqueValuesStatus:r,statisticsStatus:s,_messages:o}=this,{fieldInfo:d}=i;if(!e||!p(e.max)||!p(e.min))return this.isFinished(r)&&this.isFinished(s)?this.renderNoStatistics():this.renderWaitingForStatistics();let{statistics:n}=o,m=e.max-e.min,l=Math.floor(m/31536e6),c=Math.floor((m-l*31536e6)/2628e6),g=Math.ceil((m-c*2628e6)/864e5);g>=30&&(c+=1,g=0);let f=l===1?n.timeSpanOptions.year:l>1?n.timeSpanOptions.years.replace("${years}",l.toString()):"";f+=l>0&&(c>0||g>0)?", ":"",f+=c===1?n.timeSpanOptions.month:c>1?n.timeSpanOptions.months.replace("${months}",c.toString()):"",f+=c>0&&g>0?", ":"",f+=g===1?n.timeSpanOptions.day:g>1?n.timeSpanOptions.days.replace("${days}",g.toString()):"";let w=d.simpleFieldType!=="timestamp-offset"||!t||t.timeZone!=="unknown",v=d.simpleFieldType==="time-only";return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${n.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${w&&p(e.min)?u`<div class="statistics-row"><div>${v?n.minimumTime:n.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>`:null}${w&&p(e.max)?u`<div class="statistics-row"><div>${v?n.maximumTime:n.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>`:null}${w&&p(e.avg)?u`<div class="statistics-row"><div>${v?n.averageTime:n.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>`:null}${w&&!v&&p(e.min)&&p(e.max)&&m>0?u`<div class="statistics-row"><div>${n.timespan}</div><div class="data">${f}</div></div>`:null}${this.renderNullValues()}</div>`)}renderTopValues(){let{uniqueValues:e,uniqueValuesStatus:t,_messages:i,props:r}=this,{fieldInfo:s}=r,{statistics:o}=i;if(e?.uniqueValueInfos?.length){let d=e.uniqueValueInfos;d.sort((l,c)=>l.count<c.count?1:l.count>c.count?-1:0);let n=s.codedValues,m=d.filter(l=>l.value!==null).filter((l,c)=>l&&c<10).map(l=>{let c=l.value;return n?n.forEach(g=>{c===g.code&&(c=g.name)}):c=this._getDisplayString(c),u`<div class="statistics-row"><div class="data">${`${c}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`});return m.length?u`<div><div class="statistics-row-top-values"><div>${d.length>10?o.topTenValues:o.topValues}</div><div>${o.count}</div></div>${m}</div>`:""}else return u`<div><div class="statistics-row-top-values"><div>${o.topValues}</div><div>${o.count}</div></div><div class="statistics-row"><div class="missing">${t==="failed"?i.fieldUniqueValuesNotAvailable:i.fieldSampleRetrieving}</div></div></div>`}renderNullValues(){let{statistics:e,uniqueValues:t,_messages:i}=this,{statistics:r}=i,s=e?.nullcount;if(!p(s)&&t){let o=t.uniqueValueInfos;for(let d=0;d<o.length;d++){let n=o[d];if(n.value===null){s=n.count;break}}}return u`<div class="statistics-row"><div>${r.numberOfNulls}</div>${p(s)?u`<div class="data">${this._printNumValue(s)}</div>`:u`<div class="missing">--</div>`}</div>`}};G("arcgis-field-info",M);return M},"config","core/reactiveUtils","intl","applications/PortalApp/layerUtils","core/lang","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","layers/support/CodedValue","rest/support/Query")
|
|
2
|
+
import{a as k,b as j,c as R,d as E,e as y,f as z,g as _,h as F,i as B,j as K,k as q,l as P,m as S,n as X,o as Y,p as L,q as V,r as T,s as Z}from"./Z5QBBHLD.js";import{a as J,b as p}from"./SSVHIHJO.js";import{a as Q}from"./4WPVYHCO.js";import"./ONVTTBLX.js";import"./H4Q2JVNO.js";import{a as $}from"./ONNE6YGE.js";import{K as b,L as U,M as I,R as G,h as H,j as u,o as N,p as D,t as x}from"./HTASM5P7.js";export default $arcgis.t(([se,C,h,W,O,ae,re,ee,ne])=>{function oe(a){return a.associatedLayer?.url}var le={dateStyle:"short",timeStyle:"short"},de={timeStyle:"medium"};function ue(a){let{layer:e,fieldName:t}=a,i,r=W.supportsFieldConfiguration(e),s;"popupTemplate"in e&&(s=e.popupTemplate);let o=s?s.fieldInfos:[];return ie(a)?.filter(d=>d.name===t).forEach(d=>{let n=!r&&o?o.filter(c=>c.fieldName===d.name):void 0,m=r?e.getFieldAlias(t):n?.length?n[0].label:d.alias;/^raster.(item|service)pixelvalue/iu.test(t)&&(d.type="double");let l={layerField:d,label:m||d.name};l.codedValues=fe(t,a),pe(l),l.simpleFieldType&&(i=l)}),i}function ie(a){let{layer:e}=a;return F(e)||T(e)||_(e)&&e.rasterFields.length?e.rasterFields:e.fields}async function te(a){a.statisticsStatus="in-progress";let{layer:e,view:t}=a;if(F(e)||T(e)||S(e)||V(e))throw new Error("could not get feature count");try{return await ge(e,t)}catch{return}}async function ce(a){let{layer:e,view:t,fieldName:i,fieldInfo:r}=a;if(F(e)||T(e)||V(e))throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");if(!r||r.layerField.type==="oid"||r.layerField.type==="guid"||r.layerField.type==="global-id")return{totalCount:await te(a),nullcount:0};try{let s=await ae({layer:e,view:t,field:i,outStatisticTypes:{exclude:["median"]}});if(!p(s.count))throw new Error("could not get statistics");let o="sourceJSON"in e&&e.sourceJSON.maxRecordCount===s.count;if(p(s.nullcount)&&!o)return{...s,totalCount:s.count+s.nullcount};{let d=await te(a);return{...s,totalCount:d}}}catch{throw new Error("could not get statistics")}}async function me(a){let{layer:e,view:t,fieldName:i}=a;if(F(e)||T(e)||V(e))throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");E(e)&&(e.outFields=["*"]);try{return await re({layer:e,view:t,field:i})}catch{throw new Error("could not get unique values")}}function pe(a){switch(a.layerField.type){case"string":a.simpleFieldType="string";break;case"date":a.simpleFieldType="date";break;case"timestamp-offset":a.simpleFieldType="timestamp-offset";break;case"date-only":a.simpleFieldType="date-only";break;case"time-only":a.simpleFieldType="time-only";break;case"oid":a.simpleFieldType="oid";break;case"guid":case"global-id":a.simpleFieldType="guid";break;case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":a.simpleFieldType="number";break;default:a.simpleFieldType="string"}}function fe(a,e){let{layer:t}=e;if(L(t)&&t.subtypeField===a){let n=t.parent?.subtypes?.find(m=>m.code===t.subtypeCode);if(n)return[new ee({code:n.code,name:n.name})]}if(!y(t)&&!_(t))return;let i=y(t)?t.typeIdField:void 0,r=y(t)?t.types:void 0,s,o=ie(e)?.find(n=>n.name===a),d=o?.domain;return y(t)&&i&&r?(i===a?s=r.map(n=>new ee({code:n.id,name:n.name})):(s=[],r.forEach(n=>{if(!n.domains[a]||n.domains[a].type==="inherited"){let m=d;m?.codedValues&&m.codedValues.forEach(l=>{let c=!1;s.forEach(g=>{g.code===l.code&&(c=!0,`, ${g.name},`.includes(`, ${l.name},`)||(g.name+=`, ${l.name}`))}),c||s.push(O.clone(l))})}else n.domains[a].codedValues&&n.domains[a].codedValues.forEach(m=>{let l=!1;s.forEach(c=>{c.code===m.code&&(l=!0,`, ${c.name},`.includes(`, ${m.name},`)||(c.name+=`, ${m.name}`))}),l||s.push(O.clone(m))})})),!s.length&&d?.codedValues&&(s=O.clone(d.codedValues))):d?.codedValues&&(s=o?.domain?.codedValues),s?.length?s:void 0}async function he(a){let{view:e,layer:t}=a;if(_(t)||F(t)||T(t))throw new Error("could not get feature");if(y(t)&&!t.url||Z(t)){let i=t.createQuery();i.start=0,i.num=5,i.outFields=["*"];let r=await t.queryFeatures(i);if(r.features.length)return r;throw new Error("could not get feature")}else{if(!e)return await A(a);let i;if(L(t)||X(t)){let s=t.parent;for(;Y(s)||K(s);)s=s.parent;B(s)&&(i=await e.whenLayerView(s))}else i=await e.whenLayerView(t);let r=i.availableFields.length===t.fields.length;if(i&&(r||(S(t)||q(t))&&i.availableFields.length>0)){let s=i.createQuery();s.start=0,s.num=5,s.outFields=["*"];let o=await i.queryFeatures(s);return o.features?.length?o:await A(a)}else return await A(a)}}async function A(a){let{layer:e}=a;if(_(e)||F(e)||S(e)||q(e))throw new Error("cannot get feature from service");let t=new ne({where:"1=1",outFields:["*"],returnGeometry:!1});return"sourceJSON"in e&&e.sourceJSON?.advancedQueryCapabilities?.supportsPagination&&(t.num=1),await e.queryFeatures(t)}async function ge(a,e){if(E(a))return await ve(a);if(y(a)||j(a)||P(a)||Z(a)||z(a))return await a.queryFeatureCount();if(e&&(S(a)||q(a)))return await ye(a,e)}async function ve(a){let e=a.createQuery();e.outFields=["*"];let t=await a.queryFeatures(e);if(t.features.length)return t.features.length;throw new Error("could not get feature count")}async function ye(a,e){return await(await e.whenLayerView(a)).queryFeatureCount()}var Fe=H`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-surface-2)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`,M=class extends U{constructor(){super(...arguments),this._messages=Q({blocking:!0}),this.initialized=!1,this._propWatcherTask=new J(this,{task:async([e,t])=>{let i=p(e)&&p(t);if(p(e)||N("error",this,D("layer")),p(t)||N("error",this,D("fieldName")),!i)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName]}),this.oneFeatureResponseStatus="missing",this.statisticsStatus="missing",this.uniqueValuesStatus="missing",this.hideAlias=!1,this.hideNumericFormat=!1,this.hideStatistics=!1,this.arcgisComplete=x(),this.arcgisFieldInfoComplete=x()}static{this.properties={oneFeatureResponseStatus:16,oneFeatureResponse:16,statisticsStatus:16,statistics:16,uniqueValuesStatus:16,uniqueValues:16,view:0,layer:0,fieldName:1,hideAlias:5,hideNumericFormat:5,hideStatistics:5}}static{this.styles=Fe}async refresh(){await this.processProps(),this.requestUpdate()}willUpdate(e){this.initialized&&(e.has("fieldName")||e.has("layer"))&&this.processProps()}disconnectedCallback(){super.disconnectedCallback(),this.timeZoneHandle?.remove()}async processProps(){let{view:e,layer:t,fieldName:i,hideStatistics:r}=this;if(!t||!i)return;let s;if(t.declaredClass==="esri.layers.support.Sublayer"){let o=t;e&&await C.whenOnce(()=>!e.updating),s=await o.createFeatureLayer(),await s?.load()}if(this.oneFeatureResponseStatus="missing",this.oneFeatureResponse=void 0,this.statisticsStatus="missing",this.statistics=void 0,this.uniqueValuesStatus="missing",this.uniqueValues=void 0,this.props={view:e,layer:s??t,fieldName:i,hideStatistics:r},this.props.fieldInfo=ue(this.props),!this.props.fieldInfo){N("error",this,`Field ${i} does not exist in layer.`);return}P(t)&&se.request.interceptors?.push({urls:`${oe(t)}/${t.layerId}`,before(o){o.requestOptions.authMode="no-prompt"}}),this.processPropsPart2()}async processPropsPart2(){let{layer:e,hideStatistics:t}=this;if(await this.requestOneFeature(),S(e)||k(e)||R(e)){this.uniqueValuesStatus="failed",this.statisticsStatus="failed";return}t?this.uniqueValuesStatus="failed":await this.requestUniqueValues(),t?this.statisticsStatus="failed":await this.requestStatistics(),this.setUpTimeZoneHandle(),this.initialized=!0}async requestOneFeature(){this.oneFeatureResponseStatus="in-progress";try{let e=await he(this.props);this.oneFeatureResponse=e,this.oneFeatureResponseStatus="success"}catch{this.oneFeatureResponseStatus="failed"}}async requestUniqueValues(){this.uniqueValuesStatus="in-progress";try{let e=await me(this.props);this.uniqueValues=e,e?.uniqueValueInfos?.length?this.uniqueValuesStatus="success":this.uniqueValuesStatus="failed"}catch{this.uniqueValuesStatus="failed"}}async requestStatistics(){try{let e=await ce(this.props);if(!p(e.totalCount)&&p(e.count)&&this.uniqueValuesStatus==="success"){let t=this.uniqueValues?.uniqueValueInfos??[];for(let i=0;i<t.length;i++){let r=t[i];if(r.value===null){e.totalCount=r.count+e.count;break}}e.totalCount??=e.count}this.statistics=e,this.statisticsStatus="success"}catch{this.statisticsStatus="failed"}}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{props:e}=this,{view:t,fieldInfo:i}=e;["date","timestamp-offset"].includes(this._getStatisticsType(i))&&(this.timeZoneHandle=C.watch(()=>t?.timeZone,()=>this.requestUpdate()))}_getFieldTypeLabel(e){let{_messages:t}=this,i=t.fieldTypes;switch(e){case"big-integer":return i.bigInteger;case"date":return i.date;case"date-only":return i.dateOnly;case"double":return i.double;case"global-id":return i.globalId;case"guid":return i.guid;case"integer":return i.integer;case"long":return i.long;case"oid":return i.oid;case"single":return i.single;case"small-integer":return i.smallInteger;case"string":return i.string;case"time-only":return i.timeOnly;case"timestamp-offset":return i.timestampOffset;default:return i.string}}_getStatisticsType(e){switch(e.layerField.type){case"big-integer":case"double":case"integer":case"single":case"small-integer":{if(e.codedValues)return"string";switch(e.layerField.valueType){case"url":case"binary":case"description":case"location-or-place-name":case"name-or-title":case"ordered-or-ranked":case"type-or-category":return"string";default:return"number"}}case"date":return"date";case"date-only":return"date-only";case"string":return"string";case"time-only":return"time-only";case"timestamp-offset":return"timestamp-offset";default:return"string"}}_getFieldValueTypeCamelCase(e){switch(e.layerField.valueType){case"count-or-amount":return"countOrAmount";case"date-and-time":return"dateAndTime";case"location-or-place-name":return"locationOrPlaceName";case"margin-of-error":return"marginOfError";case"name-or-title":return"nameOrTitle";case"ordered-or-ranked":return"orderedOrRanked";case"percentage-or-ratio":return"percentageOrRatio";case"type-or-category":return"typeOrCategory";case"unique-identifier":return"uniqueIdentifier";case"phone-number":return"phoneNumber";case"email-address":return"emailAddress";default:return e.layerField.valueType??void 0}}_getDisplayString(e,t){let{props:i}=this,{fieldInfo:r}=i;switch(r.simpleFieldType){case"date":return this._getDateString(e,t);case"date-only":return this._getDateOnlyString(e,t);case"guid":return this._getGuidString(e);case"number":return this._getNumberString(e,t);case"time-only":return this._getTimeOnlyString(e,t);case"timestamp-offset":return this._getTimestampOffsetString(e,t);default:return`${e}`}}_getDateString(e,t){let{view:i}=this.props;return i&&i.timeZone==="unknown"?h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"})}_getTimestampOffsetString(e,t){let{view:i}=this.props;return typeof e=="string"?i&&i.timeZone==="unknown"?h.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):h.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"}):this._getDateString(e,t)}_getDateOnlyString(e,t){return h.formatDateOnly(e,this.getIntlDateTimeFormattingOptions("short-date",t))}_getTimeOnlyString(e,t){return typeof e=="string"?h.formatTimeOnly(e,this.getIntlDateTimeFormattingOptions("short-date-long-time",t)):h.formatDate(e,{...this.getIntlDateTimeFormattingOptions("long-time",{...t,isTimeOnly:!0}),timeZone:"utc"})}_getGuidString(e){return e.startsWith("{")?e:`{${e}}`}_getNumberString(e,t){let i=t?.useFieldFormatting?e:Math.round(e*100)/100;return h.formatNumber(i,this.getIntlNumberFormattingOptions(t))}_printNumValue(e,t){return p(e)?this._getNumberString(e,t):"--"}_setCompleteRef(e){if(this.completeRefHandler&&clearInterval(this.completeRefHandler),e){let t=0;this.completeRefHandler=setInterval(()=>{(t>130||this.isFinished(this.uniqueValuesStatus)&&this.isFinished(this.statisticsStatus))&&(clearInterval(this.completeRefHandler),this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit()),t++},1e3)}}getCurrentFieldFormat(){let{props:e}=this,{layer:t,fieldName:i}=e;return(this.originalLayerSupportsFieldConfigs()?t.getFieldConfiguration(i):void 0)?.fieldFormat??void 0}getIntlNumberFormattingOptions(e){let t=this.getCurrentFieldFormat();if(!e?.useFieldFormatting)return t?{useGrouping:["always","auto"].includes(t.useGrouping)}:h.convertNumberFormatToIntlOptions({digitSeparator:this.getPopupTemplateFieldInfo()?.format?.digitSeparator??!0});let i=t?{minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,useGrouping:["always","auto"].includes(t.useGrouping)}:void 0;if(i)return i;let r=this.getPopupTemplateFieldInfo();return h.convertNumberFormatToIntlOptions({digitSeparator:r?.format?.digitSeparator??!0,places:r?.format?.places??2})}getIntlDateTimeFormattingOptions(e,t){let i=this.getCurrentFieldFormat();if(!t?.useFieldFormatting)return i?t?.isTimeOnly?de:le:h.convertDateFormatToIntlOptions(e);let r=i?{dateStyle:t?.isTimeOnly?void 0:i.dateStyle??void 0,year:i.dateStyle?void 0:i.year??void 0,month:i.dateStyle?void 0:i.month??void 0,timeStyle:i.timeStyle??void 0,hourCycle:i.hour12==="never"?"h23":"h11"}:void 0;if(r)return r;let s=this.getPopupTemplateFieldInfo();return h.convertDateFormatToIntlOptions(s?.format?.dateFormat??e)}originalLayerSupportsFieldConfigs(){let{layer:e}=this;return W.supportsFieldConfiguration(e)}getPopupTemplateFieldInfo(){let{props:e}=this,{layer:t,fieldName:i}=e;return("popupTemplate"in t?t.popupTemplate:void 0)?.fieldInfos?.find(r=>r.fieldName===i)}isFinished(e){return["success","failed"].includes(e)}render(){return this._propWatcherTask.render({pending:()=>u`<calcite-scrim loading></calcite-scrim>`,complete:()=>{let{props:e}=this,{fieldInfo:t}=e;return t?u`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>`:""},error:()=>""})}renderFieldType(){let{_messages:e,props:t}=this,{fieldInfo:i}=t,r=this._getFieldTypeLabel(i.layerField.type);return u`<div class="section"><div class="title">${e.fieldType}</div><div>${r}</div></div>`}renderFieldAlias(){let{_messages:e,props:t,hideAlias:i}=this,{fieldInfo:r}=t;return i?"":u`<div class="section"><div class="title">${e.fieldAlias}</div><div>${r.label}</div></div>`}renderFieldDescription(){let{_messages:e,props:t}=this,{layer:i}=t;if(!y(i))return"";let{fieldInfo:r}=t,s=r.layerField.description;return u`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${I({missing:!s})}>${s||e.fieldDescriptionNotSet}</div></div>`}renderFieldValueType(){let{_messages:e,props:t}=this,{layer:i}=t;if(!y(i))return"";let{fieldInfo:r}=t,s=this._getFieldValueTypeCamelCase(r);return u`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${I(s?"":"missing")}>${s?e.fieldValueTypes[s]:e.fieldValueTypeNotSet}</div></div>`}renderFieldSampleValue(){let{oneFeatureResponse:e,oneFeatureResponseStatus:t,statisticsStatus:i,statistics:r,uniqueValuesStatus:s,uniqueValues:o,_messages:d,props:n}=this,{layer:m,fieldName:l,fieldInfo:c}=n,{statistics:g}=d,f;if(F(m)||V(m)||!S(m)&&["string","oid","guid"].includes(this._getStatisticsType(c))&&s!=="failed")return"";t==="success"?e.features.forEach(v=>{(f===void 0||f===null&&v.attributes[l]!==null)&&(f=v.attributes[l])}):i==="success"?f=r?.min??void 0:s==="success"&&(f=o?.uniqueValueInfos?.[0]?.value??o?.uniqueValueInfos?.[1]?.value??void 0);let w=c.codedValues;return p(f)&&(w?f=w.find(v=>f===v.code)?.name||f:f=this._getDisplayString(f,{useFieldFormatting:!0})),u`<div class="section"><div class="title">${d.fieldSampleValue}</div><div class=${I(t==="failed"&&i==="failed"&&s==="failed"||!p(f)?"missing":"")}>${t==="success"||i==="success"||s==="success"?f?.toString()??g.allNulls:t==="failed"&&i==="failed"&&s==="failed"?d.fieldSampleNotAvailable:d.fieldSampleRetrieving}</div></div>`}renderFieldNumericFormat(){let{_messages:e,props:t,hideNumericFormat:i}=this,{fieldName:r,fieldInfo:s,layer:o}=t;if(i||!["double","long","single"].includes(s.layerField.type))return"";let d=this.originalLayerSupportsFieldConfigs()?o.getFieldConfiguration(r):void 0;if(d?.fieldFormat){let{minimumFractionDigits:m,maximumFractionDigits:l}=d.fieldFormat;return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}",m.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}",l.toString())}</div></div>`}let n="popupTemplate"in o?o.popupTemplate:void 0;if(n?.fieldInfos){let m=n.fieldInfos?.filter(l=>l.fieldName===r);if(m?.length){let l=m[0];if(p(l?.format?.places)){let c=l.format.places;return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}",c.toString())}</div></div>`}}}return u`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`}renderFieldStatistics(){let{statisticsStatus:e,uniqueValuesStatus:t,hideStatistics:i,_messages:r,props:s}=this,{layer:o,fieldInfo:d}=s;return i?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):k(o)||R(o)||S(o)||F(o)||V(o)||["long"].includes(d.layerField.type)?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):u`<div class="section"><div class="title">${r.fieldStatistics}</div>${!this.isFinished(t)&&!this.isFinished(e)?this.renderWaitingForStatistics():e==="failed"&&t==="failed"?this.renderNoStatistics():this.renderStatistics()}</div>`}renderWaitingForStatistics(){let{_messages:e}=this;return $("field-info-statistics-content",u`<div class="missing">${e.fieldStatisticsRetrieving}</div>`)}renderNoStatistics(){let{_messages:e}=this;return $("field-info-statistics-content",u`<div class="missing" ${b(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`)}renderStatistics(){let{props:e}=this,{fieldInfo:t}=e;switch(this._getStatisticsType(t)){case"number":return this.renderNumberStatistics();case"guid":case"oid":case"string":return this.renderStringStatistics();case"date":case"date-only":case"time-only":case"timestamp-offset":return this.renderDateStatistics();default:return""}}renderNumberStatistics(){let{statistics:e,uniqueValuesStatus:t,statisticsStatus:i,_messages:r}=this;if(!e)return this.isFinished(t)&&this.isFinished(i)?this.renderNoStatistics():this.renderWaitingForStatistics();let{statistics:s}=r;return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${s.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${p(e.sum)?u`<div class="statistics-row"><div>${s.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>`:null}${p(e.min)?u`<div class="statistics-row"><div>${s.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>`:null}${p(e.max)?u`<div class="statistics-row"><div>${s.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>`:null}${p(e.avg)?u`<div class="statistics-row"><div>${s.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>`:null}${p(e.stddev)?u`<div class="statistics-row"><div>${s.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>`:null}${this.renderNullValues()}</div>`)}renderStringStatistics(){let{statistics:e,uniqueValuesStatus:t,_messages:i}=this,{statistics:r}=i;return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${r.numberOfValues}</div>${t!=="success"?u`<div class="missing">--</div>`:u`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`)}renderDateStatistics(){let{statistics:e,view:t,props:i,uniqueValuesStatus:r,statisticsStatus:s,_messages:o}=this,{fieldInfo:d}=i;if(!e||!p(e.max)||!p(e.min))return this.isFinished(r)&&this.isFinished(s)?this.renderNoStatistics():this.renderWaitingForStatistics();let{statistics:n}=o,m=e.max-e.min,l=Math.floor(m/31536e6),c=Math.floor((m-l*31536e6)/2628e6),g=Math.ceil((m-c*2628e6)/864e5);g>=30&&(c+=1,g=0);let f=l===1?n.timeSpanOptions.year:l>1?n.timeSpanOptions.years.replace("${years}",l.toString()):"";f+=l>0&&(c>0||g>0)?", ":"",f+=c===1?n.timeSpanOptions.month:c>1?n.timeSpanOptions.months.replace("${months}",c.toString()):"",f+=c>0&&g>0?", ":"",f+=g===1?n.timeSpanOptions.day:g>1?n.timeSpanOptions.days.replace("${days}",g.toString()):"";let w=d.simpleFieldType!=="timestamp-offset"||!t||t.timeZone!=="unknown",v=d.simpleFieldType==="time-only";return $("field-info-statistics-content",u`<div ${b(this._setCompleteRef)}><div class="statistics-row"><div>${n.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${w&&p(e.min)?u`<div class="statistics-row"><div>${v?n.minimumTime:n.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>`:null}${w&&p(e.max)?u`<div class="statistics-row"><div>${v?n.maximumTime:n.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>`:null}${w&&p(e.avg)?u`<div class="statistics-row"><div>${v?n.averageTime:n.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>`:null}${w&&!v&&p(e.min)&&p(e.max)&&m>0?u`<div class="statistics-row"><div>${n.timespan}</div><div class="data">${f}</div></div>`:null}${this.renderNullValues()}</div>`)}renderTopValues(){let{uniqueValues:e,uniqueValuesStatus:t,_messages:i,props:r}=this,{fieldInfo:s}=r,{statistics:o}=i;if(e?.uniqueValueInfos?.length){let d=e.uniqueValueInfos;d.sort((l,c)=>l.count<c.count?1:l.count>c.count?-1:0);let n=s.codedValues,m=d.filter(l=>l.value!==null).filter((l,c)=>l&&c<10).map(l=>{let c=l.value;return n?n.forEach(g=>{c===g.code&&(c=g.name)}):c=this._getDisplayString(c),u`<div class="statistics-row"><div class="data">${`${c}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`});return m.length?u`<div><div class="statistics-row-top-values"><div>${d.length>10?o.topTenValues:o.topValues}</div><div>${o.count}</div></div>${m}</div>`:""}else return u`<div><div class="statistics-row-top-values"><div>${o.topValues}</div><div>${o.count}</div></div><div class="statistics-row"><div class="missing">${t==="failed"?i.fieldUniqueValuesNotAvailable:i.fieldSampleRetrieving}</div></div></div>`}renderNullValues(){let{statistics:e,uniqueValues:t,_messages:i}=this,{statistics:r}=i,s=e?.nullcount;if(!p(s)&&t){let o=t.uniqueValueInfos;for(let d=0;d<o.length;d++){let n=o[d];if(n.value===null){s=n.count;break}}}return u`<div class="statistics-row"><div>${r.numberOfNulls}</div>${p(s)?u`<div class="data">${this._printNumValue(s)}</div>`:u`<div class="missing">--</div>`}</div>`}};G("arcgis-field-info",M);return M},"config","core/reactiveUtils","intl","applications/PortalApp/layerUtils","core/lang","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","layers/support/CodedValue","rest/support/Query")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{e as n}from"./
|
|
2
|
+
import{e as n}from"./ONVTTBLX.js";import"./H4Q2JVNO.js";import{L as r,R as l,h as c,j as t}from"./HTASM5P7.js";var h=c`:host{display:flex;flex:auto;inline-size:300px;min-block-size:0;min-inline-size:0;padding-inline:var(--calcite-space-sm)}arcgis-slider{flex:auto}arcgis-ticks{--arcgis-ticks-font-size: var(--calcite-font-size--3);--arcgis-ticks-gap: var(--calcite-space-base)}.content-end-stack{display:flex;flex-direction:column;flex:1}.ticks-stack{height:var(--calcite-space-sm);position:relative}.ticks-stack arcgis-ticks{inset:var(--calcite-space-none);position:absolute}.label-ticks{--arcgis-ticks-tick-length: var(--calcite-space-2xs);--arcgis-ticks-tick-color: transparent}.minor-ticks{--arcgis-ticks-tick-length: var(--calcite-space-2xs)}.major-ticks{--arcgis-ticks-tick-length: var(--calcite-space-sm)}:host([layout="vertical"]){flex-basis:300px;inline-size:var(--calcite-size-xl);padding-inline:var(--calcite-space-none);arcgis-slider:has(.label-ticks){position:relative;inset-inline-end:var(--calcite-space-md-plus)}arcgis-ticks{--arcgis-ticks-gap: var(--calcite-space-sm)}.content-end-stack{position:relative}.ticks-stack{height:100%}.label-ticks{--arcgis-ticks-tick-length: var(--calcite-space-base);inset:var(--calcite-space-none);position:absolute}}`,a=class extends r{constructor(){super(...arguments),this.autoDestroyDisabled=!1,this.canNext=!1,this.canPlay=!1,this.canPrevious=!1,this.disabled=!1,this.layout="horizontal",this.mirrored=!1,this.arcgisPropertyChange=n()("canNext","canPlay","canPrevious","currentValue")}static{this.properties={autoDestroyDisabled:5,canNext:5,canPlay:5,canPrevious:5,currentValue:9,disabled:5,labelFormatter:0,labels:0,layout:3,max:9,min:9,mirrored:5,steps:0,majorTicks:0,minorTicks:0}}static{this.styles=h}get _ascending(){return!this.mirrored}async destroy(){await this.manager.destroy()}reset(){this.currentValue=this._ascending?this.steps?.at(0):this.steps?.at(-1)}step(s){if(!this.steps||this.currentValue===void 0)return;let e=s==="next"===this._ascending?1:-1,i=this.steps.indexOf(this.currentValue)+e;i>=this.steps.length||i<0||(this.currentValue=this.steps[i],this._checkState())}connectedCallback(){super.connectedCallback(),this.el.hidden=!0}willUpdate(s){s.has("steps")&&this.steps?.length&&(this.min??=this.steps[0],this.max??=this.steps.at(-1)),(s.has("currentValue")||s.has("max"))&&this.max!==void 0&&(this.currentValue??=this.max),this.el.hidden=this.min===void 0||this.max===void 0||this.currentValue===void 0,this._checkState()}_checkState(){if(!this.steps?.length){this.canPlay=!1,this.canNext=!1,this.canPrevious=!1;return}this.canPlay=!0;let s=this.steps.findIndex(i=>i===this.currentValue),e=this.steps.length-1;this.canNext=this._ascending?s<e:s>0,this.canPrevious=this._ascending?s>0:s<e}_handleSliderChange(s){this.currentValue=s.currentTarget.values[0],this._checkState()}_handleSliderInput(s){this.currentValue=s.currentTarget.values[0],this._checkState()}render(){return this.currentValue===void 0?null:t`<arcgis-slider .disabled=${this.disabled} .layout=${this.layout} .min=${this.min} .max=${this.max} .steps=${this.steps} .mirrored=${this.mirrored} .values=${[this.currentValue]} @arcgisInput=${s=>this._handleSliderInput(s)} @arcgisChange=${s=>this._handleSliderChange(s)}>${(this.majorTicks?.length||this.minorTicks?.length||this.labels?.length)&&t`<div slot=content-end class="content-end-stack">${(this.majorTicks?.length||this.minorTicks?.length)&&t`<div class="ticks-stack">${this.majorTicks?.length&&t`<arcgis-ticks .layout=${this.layout} class="major-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.majorTicks} mode=value></arcgis-ticks>`||""}${this.minorTicks?.length&&t`<arcgis-ticks .layout=${this.layout} class="minor-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.minorTicks} mode=value></arcgis-ticks>`||""}</div>`||""}${this.labels?.length&&t`<arcgis-ticks .layout=${this.layout} class="label-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.labels} mode=value show-labels label-placement=end .labelFormatter=${this.labelFormatter}></arcgis-ticks>`||""}</div>`||""}</arcgis-slider>`}};l("arcgis-value-picker-slider",a);export{a as ArcgisValuePickerSlider};
|