1import{M as I,m as P,U as $,Q as C,n as D,q as E,r as M,u as V,v as k,w as g,A as z,B as L}from"./arcade-CglIOutm.js";import{F as ot}from"./arcade-CglIOutm.js";import{fi as u,ek as x,fk as O,hH as b,at as Z,eB as c,aB as J,hC as R,hA as G,hz as N,g2 as B,z as q,bw as U,B as H,bv as j,bu as Q,eC as W,eA as X}from"./index-CyVzZKgG.js";import{r as p}from"./arcadeEnvironment-G2YAnjBm.js";import{V as K,A as F,p as y,t as Y,l as ee,H as te,B as ne,X as re}from"./Dictionary-Cj5Tbp8q.js";import{D as ae,w as se,I as h}from"./Feature-DwjJ_cpw.js";import{t as T}from"./ImmutableArray-BPVd6ESQ.js";import{n as ie}from"./isImageryGraphicOrigin-Ccuhb4eK.js";import{n as oe}from"./isImageryTileGraphicOrigin-ZR-gBf9D.js";import{a as le}from"./rasterFieldUtils-BkfUyMyK.js";import"./aiServices-B95MHqwC.js";import"./commonProperties-DHiB1uzW.js";import"./shared-CQFVI6D5.js";import"./WhereClause-CCCZLDyG.js";import"./streamLayerUtils-DFlbJ4P1.js";import"./unitConversion-DW0DkvOx.js";import"./number-B8pwjyXY.js";const ue=()=>Z.getLogger("esri.arcade.Pixel");function w(e){return e.rasterFields.filter(t=>t.name.startsWith(le))}class A{constructor(t,n,r){this._graphic=n,this._timeZone=r,this.arcadeDeclaredClass="esri.arcade.Pixel",this._values=new Map,this._fields=new Map(t.map(s=>[p(s.name),s]))}static fromImageryGraphic(t,n){if(!ie(t.origin)&&!oe(t.origin))throw new u(null,"InvalidParameter",null);return new A(w(t.origin.layer),t,n)}static getDeclaredMembers(t){return w(t).map(n=>x(n.name)&&n.type==="string"?{name:n.name,type:"array",elementType:{type:"text"}}:ae(n)).filter(n=>n!=null)}keys(){return Array.from(this._fields.values()).map(t=>t.name).sort()}hasField(t){return this._fields.has(p(t))}field(t){const n=this._fields.get(p(t));if(n==null)throw new u(null,"FieldNotFound",null,{key:t});return O(this._values,n.name,()=>{const r=this._graphic.getAttribute(n.name);return r==null?null:x(n.name)&&typeof r=="string"?new T(r.split(/,\s*|\s+/)):b(r)||K(r)?se(r,n.type,this._timeZone??"system"):(ue().warn(`Unsupported type for attribute: ${n.name}. Ignoring value.`),null)})}isEmpty(){return this._fields.size<=0}castToText(t=!1){const n={};for(const r of this._fields.values())n[r.name]=this.field(r.name);return F(n,{useNumbersForDates:t})}}const d="Voxel.Position",f="Voxel.LocalTime";function ce(e){const t=e.getAttribute(d);if(typeof t!="string")throw new u(null,"InvalidParameter",null);const n=JSON.parse(t);if(!Array.isArray(n)||typeof n[0]!="number"||typeof n[1]!="number"||typeof n[2]!="number")throw new u(null,"InvalidParameter",null);return new T(n)}function fe(e,t){const n=e.getAttribute(f);if(n==null)return null;if(!b(n))throw new u(null,"InvalidParameter",null);return c.dateJSAndZoneToArcadeDate(n,t)}class ze{constructor(t,n){this._graphic=t,this._timeZone=n,this.arcadeDeclaredClass="esri.arcade.Voxel",this._layer=t.sourceLayer}static getDeclaredMembers(t){return t.fields.map(n=>{switch(n.name){case d:return{name:n.name,type:"array",elementType:{type:"number"}};case f:return{name:n.name,type:"date"};default:switch(n.type){case"string":return{name:n.name,type:"text"};case"double":return{name:n.name,type:"number"}}return null}}).filter(n=>n!=null)}getPosition(){return this._position!==void 0?this._position:this._position=ce(this._graphic)}getLocalTime(){return this._localTime!==void 0?this._localTime:this._localTime=fe(this._graphic,this._timeZone??"system")}keys(){return this._layer.fields.map(t=>t.name).sort()}hasField(t){return this._layer.fieldsIndex.has(t)}field(t){var r,s;const n=(s=(r=this._layer.fieldsIndex)==null?void 0:r.get(t))==null?void 0:s.name;if(n==null)throw new u(null,"FieldNotFound",null,{key:t});switch(n){case d:return this.getPosition();case f:return this.getLocalTime()}return this._graphic.attributes[n]??null}isEmpty(){return this._layer.fields.length<=0}castToText(t=!1){var r;const n={...this._graphic.attributes};n[d]=this.getPosition(),f in n&&(n[f]=this.getLocalTime());for(const s of Object.keys(n))(r=this._layer.fieldsIndex)!=null&&r.has(s)||delete n[s];return F(n,{useNumbersForDates:t})}}const pe={vars:{$feature:"any",$view:"any"}};function me(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function Le(e){return e==null?null:R(e)||Y(e)?"array":ee(e)?"date":G(e)?"text":N(e)?"boolean":B(e)?"number":e instanceof y?"dictionary":te(e)?"feature":e instanceof q?"point":e instanceof U?"polygon":e instanceof H?"polyline":e instanceof j?"multipoint":e instanceof Q?"extent":e instanceof W?"dateOnly":e instanceof X?"time":ne(e)?"featureSet":re(e)?"featureSetCollection":null}function m(e){if(!e)return null;try{return P(e)}catch{}return null}function Oe(e,t){const n=typeof e=="string"?m(e):e;if(!n)return null;try{return t=t||J(pe),I(n,t)}catch{}return null}function Ze(e,t,n){return{vars:{$feature:e==null?new h:h.createFromGraphic(e,n),$view:t==null?void 0:t.view},spatialReference:t==null?void 0:t.sr,timeZone:n??null}}function Je(e,t,n){return h.createFromGraphicLikeObject(t,e,n,null)}function Re(e,t){e.vars!=null&&(e.vars.$feature=t)}function Ge(e,t){let n;try{n=E(e,t)}catch{n=null}return n}function Ne(e,t){let n;try{n=e?e(t):null}catch{n=null}return n}
1function Be(e,t){try{return e?e(t):Promise.resolve(null)}catch{return Promise.resolve(null)}}const de=["$feature","$aggregatedFeatures","$voxel"].map(e=>p(e));function qe(e,t){if(!e)return[];const n=typeof e=="string"?m(e):e;if(!n)return[];const r=new Map;if(Array.isArray(t)||t==null)for(const a of de)r.set(a,t);else for(const[a,i]of t)r.set(p(a),i);const s=M(n).flatMap(({varId:a,memberNamePattern:i})=>{if(!r.has(a))return[];if(i.includes("*")){const o=r.get(a);if(o==null)return[];const l=new RegExp(`^${i.split(/\*+/).map(me).join(".*")}$`,"i");return o.filter(S=>l.test(S))}return i.toLowerCase()});return[...new Set(s.sort())]}function Ue(e){return $(e,"$view")}function He(e,t){return!!e&&$(e,t)}function je(e){if(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null))return;let t,n;const{timeProperties:r,timeZone:s}=e;if(r!=null){const{currentStart:a,currentEnd:i}=r;s!=null?(t=a!=null?c.dateJSAndZoneToArcadeDate(a,s):null,n=i!=null?c.dateJSAndZoneToArcadeDate(i,s):null):(t=a!=null?c.dateJSToArcadeDate(a):null,n=i!=null?c.dateJSToArcadeDate(i):null)}return{view:e.viewingMode&&e.scale!=null?new y({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:t!=null||n!=null?new y({__proto__:null,currentStart:t,currentEnd:n,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function Qe({url:e,spatialReference:t,lrucache:n,interceptor:r}){const s=g();return s?s.createFeatureSetCollectionFromService(e,t,n,r):null}function We({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:s,interceptor:a}){if(e===null)return null;const i=g();return i?i.constructFeatureSet(e,t,n,r??!0,s,a):null}function Xe(e){if((e==null?void 0:e.map)===null)return null;const t=g();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Ke(e,t){return y.convertJsonToArcade(e,t)}function Ye(e,t,n=[]){return V(e,t,n)}function et(){return D()}function tt(){return C()}function ye(e){return"type"in e&&(e.type==="class-breaks"||e.type==="dictionary"||e.type==="dot-density"||e.type==="pie-chart"||e.type==="simple"||e.type==="unique-value")}function he(e){return e.declaredClass==="esri.layers.support.LabelClass"}function ge(e){return e.declaredClass==="esri.PopupTemplate"}function v(e,t){var r,s;if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(ye(n)){if(n.type==="dot-density"){const o=(r=n.attributes)==null?void 0:r.some(l=>t(l.valueExpression));if(o)return o}const a=n.visualVariables,i=!!a&&a.some(o=>{let l=t(o.valueExpression);return o.type==="size"&&(_(o.minSize)&&(l=l||t(o.minSize.valueExpression)),_(o.maxSize)&&(l=l||t(o.maxSize.valueExpression))),l});return!(!("valueExpression"in n)||!t(n.valueExpression))||i}if(he(n)){const a=(s=n.labelExpressionInfo)==null?void 0:s.expression;return!(!a||!t(a))||!1}return!!ge(n)&&(!!n.expressionInfos&&n.expressionInfos.some(a=>t(a.expression))||Array.isArray(n.content)&&n.content.some(a=>{var i;return a.type==="expression"&&t((i=a.expressionInfo)==null?void 0:i.expression)}))}function ve(e){const t=m(e);return!!t&&z(t)}function nt(e){return v(e,ve)}function xe(e){const t=m(e);return!!t&&L(t)}function rt(e){return v(e,xe)}function at(e){return v(e,t=>{const n=m(t);return!!n&&k(n)})}function _(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}export{y as Dictionary,A as Pixel,ze as Voxel,ot as arcade,h as arcadeFeature,We as convertFeatureLayerToFeatureSet,Ke as convertJsonToArcade,Xe as convertMapToFeatureSetCollection,Qe as convertServiceUrlToWorkspace,Ze as createExecContext,Je as createFeature,Oe as createFunction,m as createSyntaxTree,Ue as dependsOnView,tt as enableFeatureSetOperations,et as enableGeometryOperations,Ge as evalSyntaxTree,Be as executeAsyncFunction,Ne as executeFunction,qe as extractFieldNames,Le as getArcadeType,je as getViewInfo,nt as hasGeometryFunctions,rt as hasGeometryOperations,He as hasVariable,Ye as loadScriptDependencies,at as requiresTrack,Re as updateExecContext};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.