@arcgis/core 4.33.0-next.20250226 → 4.33.0-next.20250227
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2716394f121804d93b4e.js → 4253438dd3045566892d.js} +1 -1
- package/assets/esri/core/workers/chunks/823bf95f42cc42f20e22.js +1 -0
- package/assets/esri/core/workers/chunks/ae25c6108918d37e61bf.js +1 -0
- package/assets/esri/core/workers/chunks/{feb656f172ec9fe64752.js → af005704f23088db3ded.js} +1 -1
- package/assets/esri/core/workers/chunks/{dea40706ca4e37d5c6e2.js → d4d011eea16a89a5aad9.js} +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/sqlCompareUtils.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/package.json +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TestShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BandArithmeticShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CompositeBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ComputeChangeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ContrastBrightnessShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ExtractBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/GrayscaleShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/LocalShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/NDVIShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/StretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/View.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/assets/esri/core/workers/chunks/66338f008ff0992ffca2.js +0 -1
- package/assets/esri/core/workers/chunks/d5ebe6b7cd9c8e40b386.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{1262:(e,t,n)=>{n.d(t,{L8:()=>s,Z7:()=>r});var r,a,i=n(799);(a=r||(r={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[r.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[r.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[r.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[r.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[r.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[r.UnsupportedOperator]:"Unsupported operator - {operator}",[r.UnsupportedSyntax]:"Unsupported syntax - {node}",[r.UnsupportedSqlFunction]:"Sql function not found = {function}",[r.InvalidDataType]:"Invalid sql data type",[r.InvalidDate]:"Invalid date encountered",[r.InvalidOperator]:"Invalid operator encountered",[r.InvalidTime]:"Invalid time encountered",[r.IllegalInterval]:"Illegal interval",[r.FunctionNotRecognized]:"Function not recognized",[r.InvalidTimeStamp]:"Invalid timestamp encountered",[r.InvalidParameterCount]:"Invalid parameter count for call to {name}",[r.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[r.YearMonthIntervals]:"Year-Month Intervals not supported",[r.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.HC)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}},15032:(e,t,n)=>{n.d(t,{k:()=>u});var r=n(78502),a=n(73444),i=n(96285);function o(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let n="";for(const r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":n+=r;break;case"A":case"a":n+="a";break;default:n+=`'${r}'`}return n}const s="esri.core.sql.timeonly";class u{constructor(e,t,n,r){this._hour=e,this._minute=t,this._second=n,this._millisecond=r,this.declaredRootClass=s}static isTimeOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return u.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,r.Fq)(this.hour)&&(0,r.Fq)(this.minute)&&(0,r.Fq)(this.second)&&(0,r.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?i.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,n,r){const a=new u(e,t,n,r);return a.isValid()?a:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),n=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),a=Math.floor(e%1e3);return new u(r,n,t,a)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];t?(t=o(t))&&n.push(t):null!==t&&""!==t||(n.push("HH:mm:ss"),n.push("HH:mm:ss.SSS"),n.push("hh:mm:ss a"),n.push("hh:mm:ss.SSS a"),n.push("HH:mm"),n.push("hh:mm a"),n.push("H:mm"),n.push("h:mm a"),n.push("H:mm:ss"),n.push("h:mm:ss a"),n.push("H:mm:ss.SSS"),n.push("h:mm:ss.SSS a"));for(const t of n){const n=i.c9.fromFormat(e,t);if(n.isValid)return new u(n.hour,n.minute,n.second,n.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},44729:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(66131),a=n(73444),i=n(96285);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(n)||[])switch(r){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}const s="esri.core.sql.dateonly";class u{constructor(e,t,n){this._year=e,this._month=t,this._day=n,this.declaredRootClass=s}static isDateOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return u.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new u(this._year,this._month,this._day)}toDateTime(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";const n=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(n).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.c9.fromMillis(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.c9.fromSeconds(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,n){const r=new u(e,t,n);return!1===r.isValid?null:r}static fromDateJS(e){return u.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return u.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];if(t)(t=o(t))&&n.push(t);else if(null===t||""===t){const t=i.c9.fromISO(e,{setZone:!0});return t.isValid?u.fromParts(t.year,t.month,t.day):null}for(const r of n){const n=i.c9.fromFormat(e,t??r);if(n.isValid)return new u(n.year,n.month,n.day)}return null}static fromNow(e="system"){const t=i.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new u(t.year,t.month,t.day)}}},55612:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const i="esri.core.sql.SqlTimeStampOffset";class o{constructor(e){this._timeStampOffset=e,this.declaredRootClass=i,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===i}toDateTime(){return this._date??=r.c9.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return o.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new o(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new o(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,i=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let d="";i<10&&(d="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(m+="."+s.toString().padStart(3,"0"));const h=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+m+h)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return o.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),i=n(55612),o=n(15032),s=n(96285);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L8(a.Z7.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.L8(a.Z7.InvalidParameterCount,{name:e.toUpperCase()});return n.evaluate(t)}function l(e,t){const n=c[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}const c={min:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>f(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(null!==r){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=h(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>h(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const i=e[r];if(null!==i){if(!d(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function m(e,t){if(null===e)return null;let n=null,a=null;for(const u of e){let e=u;e=r.n.isDateOnly(u)||o.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():i.g.isTimestampOffset(u)?u.toMilliseconds():u,(null===n||"max"===t&&null!==a&&null!==e&&a<=e||"min"===t&&null!==a&&null!==e&&a>=e)&&(n=u,a=e)}return n}function h(e){if(null===e)return null;if(0===(e=e.filter((e=>null!==e))).length)return null;const t=f(e);if(null===t)return null;let n=0;for(const r of e){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n+=(t-r)**2}return n/(e.length-1)}},78502:(e,t,n)=>{n.d(t,{Fq:()=>o,Yc:()=>a,Yq:()=>i});var r=n(5443);function a(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new r.A({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function o(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},88368:(e,t,n)=>{n.d(t,{A:()=>ce});var r=n(44208),a=n(74639),i=n(44729),o=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new o.L8(o.Z7.PrimarySecondaryQualifiers)}function u(e,t){if(t.includes(".")){const n=t.split(".");e.second=parseFloat(n[0]),e.millis=parseInt(n[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class c{constructor(){this.declaredRootClass=l,this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static isInterval(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===l}static createFromMilliseconds(e){const t=new c;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,n){let r=null;const a=new c;if(a.op="-"===n?"-":"+","interval-period"===t.type){s(t);const n=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new o.L8(o.Z7.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new o.L8(o.Z7.IllegalInterval);u(a,e)}else{if(!n.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.period]=parseFloat(e)}}else{if(s(t.start),s(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new o.L8(o.Z7.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(r=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.start.period]=parseFloat(e.split(" ")[0]),a[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1])}break;case"second":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1]),u(a,n[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a.hour=parseFloat(e.split(":")[0]),a.minute=parseFloat(e.split(":")[1]);break;case"second":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new o.L8(o.Z7.IllegalInterval);if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new o.L8(o.Z7.IllegalInterval)}}return a}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}var f=n(55612),d=n(15032),m=n(3330),h=n(96285);const p=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function S(e,t){if(t instanceof h.bo)return t===m.GB.instance?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return h.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t})}}function N(e){return c.isInterval(e)}function O(e){return h.c9.isDateTime(e)}function C(e){return i.n.isDateOnly(e)}function D(e){return d.k.isTimeOnly(e)}function _(e){return f.g.isTimestampOffset(e)}function F(e){let t=p.exec(e);if(null!==t){const[,e,n,r]=t,a=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),0);if(null!==a)return a;throw new o.L8(o.Z7.InvalidTime)}if(t=v.exec(e),null!==t){const[,e,n]=t,r=d.k.fromParts(parseInt(e,10),parseInt(n,10),0,0);if(null!==r)return r;throw new o.L8(o.Z7.InvalidTime)}if(t=w.exec(e),null!==t){const[,e,n,r,a]=t,i=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==i)return i;throw new o.L8(o.Z7.InvalidTime)}throw new o.L8(o.Z7.InvalidTime)}function M(e,t,n=!1){let r=y.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,m.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,m=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=L.exec(e),null!==r){const[,e,n,a,i,s]=r,u=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:0},{zone:(0,m.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=g.exec(e),null!==r){const[,e,n,a]=r,i=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,m.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function Z(e,t){const n=g.exec(e);if(null===n)try{return M(e,t)}catch{throw new o.L8(o.Z7.InvalidDate)}const[,r,a,s]=n,u=i.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new o.L8(o.Z7.InvalidDate);return u}var x=n(34727),E=n(799),b=n(54218);function A(e){return!!O(e)||!!_(e)}function P(e){return!!(O(e)||C(e)||_(e)||D(e))}function $(e){if(O(e))return e.toMillis();if(C(e))return e.toNumber();if(_(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function R(e,t,n){if(null==e||null==t)return null;if((0,b.Et)(e)){if((0,b.Et)(t))return U(e,t,n);if((0,b.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return U(e,r,n);const a=e.toString();switch(n){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,n);if(P(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if((0,b.Kg)(e)){if((0,b.Et)(t))return function(e,t,n){const r=parseFloat(e);if(!isNaN(r))return U(r,t,n);const a=t.toString();switch(n){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,n);if((0,b.Kg)(t))return function(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,n);if(O(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator)}else if(O(e)){if(A(t)){if((0,m.Y4)(e.zone)){if(h.c9.isDateTime(t)&&!(0,m.Y4)(t.zone))return k(e,t,n);if(f.g.isTimestampOffset(t))return k(e,t,n)}else if(h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)){if(!(0,m.Y4)(e.zone))return k(e,t,n);if(f.g.isTimestampOffset(e))return k(e,t,n)}return U($(e),$(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return U((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(_(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),U(r.toMillis(),t.toMilliseconds(),n)}(e,t,n);if(O(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),U(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return U(e.toNumber(),t.toNumber(),n);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(D(e)){if(D(t))return U(e.toNumber(),t.toNumber(),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(A(t))throw new o.L8(o.Z7.InvalidOperator)}else if(_(e)){if(A(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):U($(e),$(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return U((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function U(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function k(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=V(e),a=V(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function V(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function z(e,t,n){const r=Y[e.toLowerCase()];if(null==r)throw new o.L8(o.Z7.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new o.L8(o.Z7.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t,n)}function q(e){return!((0,b.$P)(e)||C(e)||O(e)||D(e)||_(e))}function H(e){return C(e)||D(e)?e.toString():_(e)?e.toSQLValue():O(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,b.$P)(e)?H(h.c9.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,b.$P)(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(O(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(C(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(_(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,n]=e;return null==t||null==n?null:t.toString().substring(n-1)}if(3===e.length){const[t,n,r]=e;return null==t||null==n||null==r?null:r<=0?"":t.toString().substring(n-1,n+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,n=t?e[1]:" ",r=t?e[2]:e[1];if(null==n||null==r)return null;const a=`(${(0,E.Cj)(n)})`;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${a}*|${a}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${a}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${a}*$`,"g"),"")}throw new o.L8(o.Z7.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],n=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*n)/n}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length||0===e[1]?Math.trunc(e[0]):(0,x.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,b.Kg)(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let n=0;n<e.length;n++){if(null==e[n])return null;t+=e[n].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:e=>R(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const n=e[0],r=e[1];if(null===n)return null;switch(r.type){case"integer":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"smallint":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);if(e>32767||e<-32767)throw new o.L8(o.Z7.CannotCastValue);return e}case"float":case"real":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseFloat(n);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"time":return function(e){if((0,b.$P)(e))return d.k.fromDateJS(e);if(O(e))return d.k.fromDateTime(e);if(C(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e))return e;if(_(e))return d.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return F(e);throw new o.L8(o.Z7.CannotCastValue)}(n);case"date":return function(e){if((0,b.$P)(e))return i.n.fromDateJS(e);if(O(e))return i.n.fromParts(e.year,e.month,e.day);if(C(e))return e;if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e)&&null===i.n.fromParts(e.year,e.month,e.day))throw new o.L8(o.Z7.CannotCastValue);if((0,b.Kg)(e)){const t=i.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new o.L8(o.Z7.CannotCastValue)}(n);case"timestamp":return function(e,t,n){if((0,b.$P)(e))return S(e,t);if(O(e))return e;if(C(e))return e.toDateTimeLuxon("unknown");if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e))return e;if((0,b.Kg)(e))return M(e,"unknown",n);throw new o.L8(o.Z7.CannotCastValue)}(n,t,!0===r.withtimezone);case"varchar":{const e=H(n);if(e.length>r.size)throw new o.L8(o.Z7.CannotCastValue);return e}default:throw new o.L8(o.Z7.InvalidDataType)}}}};function K(e,t,n,r){if("||"===e)return z("concat",[t,n],r);if(null===t||null===n)return null;if((0,b.Et)(t)){if((0,b.Et)(n))return j(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(e,r,n)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}if(C(t)){if((0,b.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(D(t)){if((0,b.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(N(t)){if((0,b.Et)(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(O(t)){if((0,b.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus({milliseconds:r});case"-":return e.minus({milliseconds:r})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(_(t)){if((0,b.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.addMilliseconds(r);case"-":return e.addMilliseconds(-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if((0,b.Kg)(t)){if((0,b.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}throw new o.L8(o.Z7.InvalidOperator)}function j(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new o.L8(o.Z7.InvalidOperator)}function Q(e,t,n,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=t,a.found=n,a.location=r,a.name="SyntaxError",a}function J(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(Q,Error),Q.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,u=J("",i.line.toString().length," "),l=r[a.line-1],c=(a.line===s.line?s.column:l.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+l+"\n"+u+" | "+J("",a.column-1," ")+J("",c,"^")}else t+="\n at "+o}return t},Q.buildMessage=function(e,t){var n={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return n[e.type](e)}return"Expected "+function(e){var t,n,r=e.map(o);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."};class B{static parse(e){return function(e,t){var n,r={},a=(t=void 0!==t?t:{}).grammarSource,i={start:ni},o=ni,s="!",u="=",l=">=",c=">",f="<=",d="<>",m="!=",h="||",p="@",v="'",w="N'",g="''",y=".",I="null",T="true",L="false",S="in",N="is",O="like",C="escape",D="not",_="and",F="or",M="between",Z="from",x="for",E="substring",b="extract",A="trim",P="position",$="timestamp",R="date",U="time",k="leading",V="trailing",z="both",q="cast",H="as",Y="integer",K="int",j="smallint",J="float",B="real",G="varchar",W="to",X="interval",ee="year",te="timezone_hour",ne="timezone_minute",re="month",ae="day",ie="hour",oe="minute",se="second",ue="case",le="end",ce="when",fe="then",de="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ge=/^[+\-]/,ye=/^[*\/]/,Ie=/^[A-Za-z_\x80-\uFFFF]/,Te=/^[A-Za-z0-9_]/,Le=/^[A-Za-z0-9_.\x80-\uFFFF]/,Se=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Ce=/^[eE]/,De=/^[ \t\n\r]/,_e=/^[^`]/,Fe=Ba("!",!1),Me=Ba("=",!1),Ze=Ba(">=",!1),xe=Ba(">",!1),Ee=Ba("<=",!1),be=Ba("<>",!1),Ae=Ga([["<","="]],!1,!1),Pe=Ba("!=",!1),$e=Ga(["+","-"],!1,!1),Re=Ba("||",!1),Ue=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["",""]],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ze=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),qe=Ga(['"'],!1,!1),He=Ba("@",!1),Ye=Ba("'",!1),Ke=Ba("N'",!1),je=Ba("''",!1),Qe=Ga(["'"],!0,!1),Je=Ba(".",!1),Be=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=Ba("NULL",!0),Xe=Ba("TRUE",!0),et=Ba("FALSE",!0),tt=Ba("IN",!0),nt=Ba("IS",!0),rt=Ba("LIKE",!0),at=Ba("ESCAPE",!0),it=Ba("NOT",!0),ot=Ba("AND",!0),st=Ba("OR",!0),ut=Ba("BETWEEN",!0),lt=Ba("FROM",!0),ct=Ba("FOR",!0),ft=Ba("SUBSTRING",!0),dt=Ba("EXTRACT",!0),mt=Ba("TRIM",!0),ht=Ba("POSITION",!0),pt=Ba("TIMESTAMP",!0),vt=Ba("DATE",!0),wt=Ba("TIME",!0),gt=Ba("LEADING",!0),yt=Ba("TRAILING",!0),It=Ba("BOTH",!0),Tt=Ba("CAST",!0),Lt=Ba("AS",!0),St=Ba("INTEGER",!0),Nt=Ba("INT",!0),Ot=Ba("SMALLINT",!0),Ct=Ba("FLOAT",!0),Dt=Ba("REAL",!0),_t=Ba("VARCHAR",!0),Ft=Ba("TO",!0),Mt=Ba("INTERVAL",!0),Zt=Ba("YEAR",!0),xt=Ba("TIMEZONE_HOUR",!0),Et=Ba("TIMEZONE_MINUTE",!0),bt=Ba("MONTH",!0),At=Ba("DAY",!0),Pt=Ba("HOUR",!0),$t=Ba("MINUTE",!0),Rt=Ba("SECOND",!0),Ut=Ba("CASE",!0),kt=Ba("END",!0),Vt=Ba("WHEN",!0),zt=Ba("THEN",!0),qt=Ba("ELSE",!0),Ht=Ba(",",!1),Yt=Ba("(",!1),Kt=Ba(")",!1),jt=Ga([" ","\t","\n","\r"],!1,!1),Qt=Ba("`",!1),Jt=Ga(["`"],!0,!1),Bt=function(e){return e},Gt=function(e){return{type:"expression-list",location:Qa(),value:e}},Wt=function(e,t,n){return{op:t,expr:n,location:Qa()}},Xt=function(e,t){return qo(e,t)},en=function(e,t,n){return{op:t,expr:n,location:Qa()}},tn=function(e,t){return qo(e,t)},nn=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,Qa())},rn=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?qo(e,t.tail):Vo(t.op,e,t.right,t.escape,Qa())},an=function(e,t){return{op:e,expr:t,location:Qa()}},on=function(e){return{type:"arithmetic",tail:e}},sn=function(e,t){return{op:e+"NOT",right:t}},un=function(e,t){return{op:e,right:t}},ln=function(e,t,n){return zo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},fn=function(e,t,n){return zo(Qa(),t,n)},dn=function(e,t){return{op:e,right:t}},mn=function(e){return e[0]+" "+e[2]},hn=function(e){return e[0]+" "+e[2]},pn=function(e,t,n){return{op:e,right:t,escape:n.value}},vn=function(e,t){return{op:e,right:t,escape:""}},wn=function(e,t){return{op:e,right:t}},gn=function(e,t){return{op:e,right:t}},yn=function(e,t,n){return{op:t,expr:n,location:Qa()}},In=function(e,t){return qo(e,t)},Tn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Ln=function(e,t){return qo(e,t)},Sn=function(e){return e.paren=!0,e},Nn=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:Qa(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:Qa(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:Qa(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:Qa()}:{type:"column-reference",location:Qa(),table:"",column:e}},On=function(e){return{type:"column-reference",location:Qa(),table:"",column:e,delimited:!0}},Cn=function(e){return e},Dn=function(e,t){return e+t.join("")},_n=function(e,t){return e+t.join("")},Fn=function(e){return e},Mn=function(e){return e.join("")},Zn=function(){return'"'},xn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return zo(Qa(),e,t)},bn=function(e,t){return zo(Qa(),e,t)},An=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return zo(Qa(),e,t,...n?[n]:[])},$n=function(e,t,n){return zo(Qa(),e,t,n)},Rn=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},Un=function(e,t){return zo(Qa(),e,t)},kn=function(e,t){return zo(Qa(),e,t)},Vn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},zn=function(){return{type:"data-type",location:Qa(),value:{type:"integer"}}},qn=function(){return{type:"data-type",location:Qa(),value:{type:"smallint"}}},Hn=function(){return{type:"data-type",location:Qa(),value:{type:"float"}}},Yn=function(){return{type:"data-type",location:Qa(),value:{type:"real"}}},Kn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},jn=function(){return{type:"data-type",location:Qa(),value:{type:"timestamp"}}},Qn=function(){return{type:"data-type",location:Qa(),value:{type:"time"}}},Jn=function(e){return{type:"data-type",location:Qa(),value:{type:"varchar",size:parseInt(e)}}},Bn=function(e,t,n){return zo(Qa(),e,t,n)},Gn=function(e,t){return zo(Qa(),e,t)},Wn=function(e){return{type:"function",location:Qa(),name:"trim",args:e}},Xn=function(e){return{type:"string",location:Qa(),value:e??"BOTH"}},er=function(e,t){return zo(Qa(),e,t)},tr=function(e,t){return zo(Qa(),e,t)},nr=function(e){return{type:"function",location:Qa(),name:"position",args:e}},rr=function(e,t){return{type:"function",location:Qa(),name:e,args:t}},ar=function(e){return{type:"string",location:Qa(),value:e}},ir=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Ja("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:Qa(),value:e.value}},or=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&Ja("Time literal is invalid")}(e.value),{type:"time",location:Qa(),value:e.value}},sr=function(e,t,n){return{type:"interval",location:Qa(),value:t,qualifier:n,op:e}},ur=function(e,t){return{type:"interval",location:Qa(),value:e,qualifier:t,op:""}},lr=function(e,t){return{type:"interval-qualifier",location:Qa(),start:e,end:t}},cr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},fr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},mr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},hr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},pr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},vr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},wr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},gr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},yr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Ir=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Tr=function(){return{type:"string",location:Qa(),value:"day"}},Lr=function(){return{type:"string",location:Qa(),value:"hour"}},Sr=function(){return{type:"string",location:Qa(),value:"minute"}},Nr=function(){return{type:"string",location:Qa(),value:"month"}},Or=function(){return{type:"string",location:Qa(),value:"year"}},Cr=function(e){return parseFloat(e)},Dr=function(e){return parseFloat(e)},_r=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Ja("Date literal is invalid")}(e.value),{type:"date",location:Qa(),value:e.value}},Fr=function(){return{type:"null",location:Qa(),value:null}},Mr=function(){return{type:"boolean",location:Qa(),value:!0}},Zr=function(){return{type:"boolean",location:Qa(),value:!1}},xr=function(){return"'"},Er=function(e){return{type:"string",location:Qa(),value:e.join("")}},br=function(e,t){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}},Ar=function(e,t,n){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}},Pr=function(e){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:null,elseLocation:null}},$r=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},Ur=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},Vr=function(e){return{type:"number",location:Qa(),value:e}},zr=function(e,t,n){return parseFloat(e+t+n)},qr=function(e,t){return parseFloat(e+t)},Hr=function(e,t){return parseFloat(e+t)},Yr=function(e){return parseFloat(e)},Kr=function(e,t){return e[0]+t},jr=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},Jr=function(e){return e.join("")},Br=function(e,t){return"e"+(null===t?"":t)},Gr=function(){return"IN"},Wr=function(){return"IS"},Xr=function(){return"LIKE"},ea=function(){return"ESCAPE"},ta=function(){return"NOT"},na=function(){return"AND"},ra=function(){return"OR"},aa=function(){return"BETWEEN"},ia=function(){return"FROM"},oa=function(){return"FOR"},sa=function(){return"SUBSTRING"},ua=function(){return"EXTRACT"},la=function(){return"TRIM"},ca=function(){return"POSITION"},fa=function(){return"TIMESTAMP"},da=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ga=function(){return"AS"},ya=function(){return"INTEGER"},Ia=function(){return"INT"},Ta=function(){return"SMALLINT"},La=function(){return"FLOAT"},Sa=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Ca=function(){return"INTERVAL"},Da=function(){return"YEAR"},_a=function(){return"TIMEZONE_HOUR"},Fa=function(){return"TIMEZONE_MINUTE"},Ma=function(){return"MONTH"},Za=function(){return"DAY"},xa=function(){return"HOUR"},Ea=function(){return"MINUTE"},ba=function(){return"SECOND"},Aa=function(){return"CASE"},Pa=function(){return"END"},$a=function(){return"WHEN"},Ra=function(){return"THEN"},Ua=function(){return"ELSE"},ka=function(e){return e},Va=function(e){return e.join("")},za=0|t.peg$currPos,qa=za,Ha=[{line:1,column:1}],Ya=za,Ka=t.peg$maxFailExpected||[],ja=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Qa(){return Xa(qa,za)}function Ja(e,t){throw ti(e,t=void 0!==t?t:Xa(qa,za))}function Ba(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ga(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Wa(t){var n,r=Ha[t];if(r)return r;if(t>=Ha.length)n=Ha.length-1;else for(n=t;!Ha[--n];);for(r={line:(r=Ha[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Ha[t]=r,r}function Xa(e,t,n){var r=Wa(e),i=Wa(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ei(e){za<Ya||(za>Ya&&(Ya=za,Ka=[]),Ka.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=za,Ro(),(t=ai())!==r?(Ro(),qa=e,e=Bt(t)):(za=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=za,Po()!==r){for(Ro(),t=[],n=ai();n!==r;)t.push(n),n=za,a=za,i=Ro(),(o=Ao())!==r?a=i=[i,o,Ro()]:(za=a,a=r),a!==r&&(a=ai())===r?(za=n,n=r):n=a;n=Ro(),(a=$o())!==r?(qa=e,e=Gt(t)):(za=e,e=r)}else za=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=za,(t=ii())!==r){for(n=[],a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Xt(t,n)}else za=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=za,(t=oi())!==r){for(n=[],a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=tn(t,n)}else za=e,e=r;return e}function oi(){var t,n,a,i,o;return t=za,(n=Ji())===r&&(n=za,33===e.charCodeAt(za)?(a=s,za++):(a=r,0===ja&&ei(Fe)),a!==r?(i=za,ja++,61===e.charCodeAt(za)?(o=u,za++):(o=r,0===ja&&ei(Me)),ja--,o===r?i=void 0:(za=i,i=r),i!==r?n=a=[a,i]:(za=n,n=r)):(za=n,n=r)),n!==r?(a=Ro(),(i=oi())!==r?(qa=t,t=nn(i)):(za=t,t=r)):(za=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=za,(t=ci())!==r?(n=za,Ro(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,t=[],n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r),n!==r)for(;n!==r;)t.push(n),n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r);else t=r;return t!==r&&(qa=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=za,(t=li())!==r?(Ro(),(n=ri())!==r?(qa=e,e=wn(t,n)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=li())!==r?(Ro(),(n=Li())!==r?(qa=e,e=gn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=za,(t=Ji())!==r?(Ro(),(n=Wi())!==r?(a=Ro(),i=za,(o=ci())!==r?(Ro(),(s=Bi())!==r?(Ro(),(u=ci())!==r?(qa=i,i=ln(n,o,u)):(za=i,i=r)):(za=i,i=r)):(za=i,i=r),i!==r?(qa=e,e=cn(n,i)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Wi())!==r?(Ro(),n=za,(a=ci())!==r?(i=Ro(),(o=Bi())!==r?(Ro(),(s=ci())!==r?(qa=n,n=fn(t,a,s)):(za=n,n=r)):(za=n,n=r)):(za=n,n=r),n!==r?(qa=e,e=dn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=Ki())!==r?(Ro(),(n=Ji())!==r?(Ro(),(a=ci())!==r?(qa=e,e=sn(t,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Ki())!==r?(Ro(),(n=ci())!==r?(qa=e,e=un(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(Ro(),Qi()!==r?(Ro(),(a=xi())!==r?(qa=e,e=pn(t,n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(qa=e,e=vn(t,n)):(za=e,e=r)):(za=e,e=r)),e}()),e}())!==r?n=a:(za=n,n=r),n===r&&(n=null),qa=e,e=rn(t,n)):(za=e,e=r),e}()),t}function si(){var t;return e.substr(za,2)===l?(t=l,za+=2):(t=r,0===ja&&ei(Ze)),t===r&&(62===e.charCodeAt(za)?(t=c,za++):(t=r,0===ja&&ei(xe)),t===r&&(e.substr(za,2)===f?(t=f,za+=2):(t=r,0===ja&&ei(Ee)),t===r&&(e.substr(za,2)===d?(t=d,za+=2):(t=r,0===ja&&ei(be)),t===r&&(t=e.charAt(za),we.test(t)?za++:(t=r,0===ja&&ei(Ae)),t===r&&(e.substr(za,2)===m?(t=m,za+=2):(t=r,0===ja&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=ji())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=mn(t)),(e=t)===r&&(e=ji()),e}function li(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=Yi())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=hn(t)),(e=t)===r&&(e=Yi()),e}function ci(){var e,t,n,a,i,o;if(e=za,(t=di())!==r){for(n=[],a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=In(t,n)}else za=e,e=r;return e}function fi(){var t;return t=e.charAt(za),ge.test(t)?za++:(t=r,0===ja&&ei($e)),t===r&&(e.substr(za,2)===h?(t=h,za+=2):(t=r,0===ja&&ei(Re))),t}function di(){var e,t,n,a,i,o;if(e=za,(t=hi())!==r){for(n=[],a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Ln(t,n)}else za=e,e=r;return e}function mi(){var t;return t=e.charAt(za),ye.test(t)?za++:(t=r,0===ja&&ei(Ue)),t}function hi(){var e,t;return(e=function(){var e;return(e=xi())===r&&(e=function(){var e,t,n,a;return e=za,(t=function(){var e,t,n,a;return e=za,(t=Pi())!==r&&(n=$i())!==r&&(a=Ri())!==r?(qa=e,e=zr(t,n,a)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=$i())!==r?(qa=e,e=qr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=Ri())!==r?(qa=e,e=Hr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(qa=e,t=Yr(t)),e=t))),e}())!==r?(n=za,ja++,a=vi(),ja--,a===r?n=void 0:(za=n,n=r),n!==r?(qa=e,e=Vr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,(t=qi())!==r&&(qa=e,t=Mr()),(e=t)===r&&(e=za,(t=Hi())!==r&&(qa=e,t=Zr()),e=t),e}())===r&&(e=function(){var e,t;return e=za,(t=zi())!==r&&(qa=e,t=Fr()),t}())===r&&(e=function(){var e,t;return e=za,oo()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=_r(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,io()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=ir(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=Ci())===r&&(e=function(){var e,t;return e=za,so()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=or(t)):(za=e,e=r)):(za=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=za,no()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=En(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=bn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=An(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=za,to()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),i=za,eo()!==r?(o=Ro(),(s=ai())!==r?(Ro(),i=s):(za=i,i=r)):(za=i,i=r),i===r&&(i=null),$o()!==r?(qa=t,t=Pn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),(i=Ao())!==r?(Ro(),(o=ai())!==r&&(s=$o())!==r?(qa=t,t=$n(n,a,o)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Rn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=za,ro()!==r?(Ro(),t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Xi()!==r?(Ro(),(i=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Bn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Gn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Wn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,ao()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Yi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=er(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=tr(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=nr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,fo()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),mo()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=Un(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=kn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Vn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,t=za,ja++,n=no(),ja--,n===r?t=void 0:(za=t,t=r),t!==r&&(n=ko())!==r?(Ro(),(a=ri())!==r?(qa=e,e=rr(n,a)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Zo())!==r?(qa=e,e=br(t,n)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;if(e===r)if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Ai())!==r?(i=Ro(),Zo()!==r?(qa=e,e=Ar(t,n,a)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Zo())!==r?(qa=e,e=Pr(t)):(za=e,e=r)}else za=e,e=r;if(e===r)if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Ai())!==r?(a=Ro(),Zo()!==r?(qa=e,e=$r(t,n)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=za,(t=function(){var e,t;return e=za,(t=function(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=gi();a!==r;)n.push(a),a=gi();qa=e,e=Dn(t,n)}else za=e,e=r;return e}())!==r&&(qa=e,t=Cn(t)),t}())!==r&&(qa=e,t=Nn(t)),(e=t)===r&&(e=za,(t=function(){var e,t;return e=za,Ti()!==r?(t=function(){var e,t,n;for(e=za,t=[],n=yi();n!==r;)t.push(n),n=yi();return qa=e,Mn(t)}(),Ti()!==r?(qa=e,e=Fn(t)):(za=e,e=r)):(za=e,e=r),e}())!==r&&(qa=e,t=On(t)),e=t),e}())===r&&(e=Li())===r&&(e=za,Po()!==r?(Ro(),(t=ai())!==r?(Ro(),$o()!==r?(qa=e,e=Sn(t)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)),e}function pi(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();qa=e,e=_n(t,n)}else za=e,e=r;return e}function vi(){var t;return t=e.charAt(za),Ie.test(t)?za++:(t=r,0===ja&&ei(ke)),t}function wi(){var t;return t=e.charAt(za),Te.test(t)?za++:(t=r,0===ja&&ei(Ve)),t}function gi(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function yi(){var e;return(e=Ii())===r&&(e=function(){var e;return e=za,Ti()!==r&&Ti()!==r?(qa=e,e=Zn()):(za=e,e=r),e}()),e}function Ii(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function Ti(){var t;return t=e.charAt(za),Se.test(t)?za++:(t=r,0===ja&&ei(qe)),t}function Li(){var t,n,a,i;return t=za,n=za,64===e.charCodeAt(za)?(a=p,za++):(a=r,0===ja&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(za=n,n=r),n!==r&&(qa=t,n=xn(n)),n}function Si(){var e,t,n;return e=za,(t=ho())===r&&(t=po()),t!==r&&(qa=e,t=zn()),(e=t)===r&&(e=za,(t=vo())!==r&&(qa=e,t=qn()),(e=t)===r&&(e=za,(t=wo())!==r&&(qa=e,t=Hn()),(e=t)===r&&(e=za,(t=go())!==r&&(qa=e,t=Yn()),(e=t)===r&&(e=za,(t=oo())!==r&&(qa=e,t=Kn()),(e=t)===r&&(e=za,(t=io())!==r&&(qa=e,t=jn()),(e=t)===r&&(e=za,(t=so())!==r&&(qa=e,t=Qn()),(e=t)===r&&(e=za,(t=yo())!==r?(Ro(),Po()!==r?(Ro(),(n=Ui())!==r?(Ro(),$o()!==r?(qa=e,e=Jn(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)))))))),e}function Ni(){var e,t;return e=za,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),qa=e,Xn(t)}function Oi(){var e,t;return e=za,(t=Lo())===r&&(t=Oo())===r&&(t=Co())===r&&(t=Do())===r&&(t=_o())===r&&(t=Fo())===r&&(t=So())===r&&(t=No()),t!==r&&(qa=e,t=ar(t)),t}function Ci(){var t,n,a,i;return t=za,To()!==r?(Ro(),n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r?(Ro(),(a=Zi())!==r?(Ro(),(i=Di())!==r?(qa=t,t=sr(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,To()!==r?(Ro(),(n=Zi())!==r?(Ro(),(a=Di())!==r?(qa=t,t=ur(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t}function Di(){var e,t,n;return e=za,(t=function(){var e,t,n;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=cr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=fr(t)),e=t),e}())!==r?(Ro(),Io()!==r?(Ro(),(n=function(){var e,t,n,a;return e=za,(t=_i())!==r&&(qa=e,t=dr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=mr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=hr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=pr()),e=t))),e}())!==r?(qa=e,e=lr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=vr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=wr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=gr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=yr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=Ir()),e=t)))),e}()),e}function _i(){var e,t;return e=za,(t=Co())!==r&&(qa=e,t=Tr()),(e=t)===r&&(e=za,(t=Do())!==r&&(qa=e,t=Lr()),(e=t)===r&&(e=za,(t=_o())!==r&&(qa=e,t=Sr()),(e=t)===r&&(e=za,(t=Oo())!==r&&(qa=e,t=Nr()),(e=t)===r&&(e=za,(t=Lo())!==r&&(qa=e,t=Or()),e=t)))),e}function Fi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Cr(t)),t}function Mi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Dr(t)),t}function Zi(){var e;return(e=xi())===r&&(e=Li()),e}function xi(){var t,n,a,i,o;if(t=za,39===e.charCodeAt(za)?(n=v,za++):(n=r,0===ja&&ei(Ye)),n===r&&(e.substr(za,2)===w?(n=w,za+=2):(n=r,0===ja&&ei(Ke))),n!==r){for(a=[],i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));i!==r;)a.push(i),i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));39===e.charCodeAt(za)?(i=v,za++):(i=r,0===ja&&ei(Ye)),i!==r?(qa=t,t=Er(a)):(za=t,t=r)}else za=t,t=r;return t}function Ei(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Rr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function bi(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Ur(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function Ai(){var e,t;return e=za,bo()!==r?(Ro(),(t=ai())!==r?(qa=e,e=kr(t)):(za=e,e=r)):(za=e,e=r),e}function Pi(){var t,n,a;return(t=Ui())===r&&(t=za,n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r&&(a=Ui())!==r?(qa=t,t=Kr(n,a)):(za=t,t=r)),t}function $i(){var t,n,a;return t=za,46===e.charCodeAt(za)?(n=y,za++):(n=r,0===ja&&ei(Je)),n!==r?((a=Ui())===r&&(a=null),qa=t,t=jr(a)):(za=t,t=r),t}function Ri(){var e,t,n;return e=za,(t=Vi())!==r&&(n=Ui())!==r?(qa=e,e=Qr(t,n)):(za=e,e=r),e}function Ui(){var e,t,n;if(e=za,t=[],(n=ki())!==r)for(;n!==r;)t.push(n),n=ki();else t=r;return t!==r&&(qa=e,t=Jr(t)),t}function ki(){var t;return t=e.charAt(za),Oe.test(t)?za++:(t=r,0===ja&&ei(Be)),t}function Vi(){var t,n,a;return t=za,n=e.charAt(za),Ce.test(n)?za++:(n=r,0===ja&&ei(Ge)),n!==r?(a=e.charAt(za),ge.test(a)?za++:(a=r,0===ja&&ei($e)),a===r&&(a=null),qa=t,t=Br(n,a)):(za=t,t=r),t}function zi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===I?za+=4:(n=r,0===ja&&ei(We)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function qi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===T?za+=4:(n=r,0===ja&&ei(Xe)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Hi(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===L?za+=5:(n=r,0===ja&&ei(et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Yi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===S?za+=2:(n=r,0===ja&&ei(tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Gr()):(za=t,t=r)):(za=t,t=r),t}function Ki(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===N?za+=2:(n=r,0===ja&&ei(nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Wr()):(za=t,t=r)):(za=t,t=r),t}function ji(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===O?za+=4:(n=r,0===ja&&ei(rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Xr()):(za=t,t=r)):(za=t,t=r),t}function Qi(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===C?za+=6:(n=r,0===ja&&ei(at)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ea()):(za=t,t=r)):(za=t,t=r),t}function Ji(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===D?za+=3:(n=r,0===ja&&ei(it)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ta()):(za=t,t=r)):(za=t,t=r),t}function Bi(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===_?za+=3:(n=r,0===ja&&ei(ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=na()):(za=t,t=r)):(za=t,t=r),t}function Gi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===F?za+=2:(n=r,0===ja&&ei(st)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ra()):(za=t,t=r)):(za=t,t=r),t}function Wi(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===M?za+=7:(n=r,0===ja&&ei(ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=aa()):(za=t,t=r)):(za=t,t=r),t}function Xi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===Z?za+=4:(n=r,0===ja&&ei(lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ia()):(za=t,t=r)):(za=t,t=r),t}function eo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===x?za+=3:(n=r,0===ja&&ei(ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=oa()):(za=t,t=r)):(za=t,t=r),t}function to(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===E?za+=9:(n=r,0===ja&&ei(ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=sa()):(za=t,t=r)):(za=t,t=r),t}function no(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===b?za+=7:(n=r,0===ja&&ei(dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ua()):(za=t,t=r)):(za=t,t=r),t}function ro(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===A?za+=4:(n=r,0===ja&&ei(mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=la()):(za=t,t=r)):(za=t,t=r),t}function ao(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===P?za+=8:(n=r,0===ja&&ei(ht)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ca()):(za=t,t=r)):(za=t,t=r),t}function io(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===$?za+=9:(n=r,0===ja&&ei(pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=fa()):(za=t,t=r)):(za=t,t=r),t}function oo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===R?za+=4:(n=r,0===ja&&ei(vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=da()):(za=t,t=r)):(za=t,t=r),t}function so(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===U?za+=4:(n=r,0===ja&&ei(wt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ma()):(za=t,t=r)):(za=t,t=r),t}function uo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===k?za+=7:(n=r,0===ja&&ei(gt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ha()):(za=t,t=r)):(za=t,t=r),t}function lo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===V?za+=8:(n=r,0===ja&&ei(yt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=pa()):(za=t,t=r)):(za=t,t=r),t}function co(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===z?za+=4:(n=r,0===ja&&ei(It)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=va()):(za=t,t=r)):(za=t,t=r),t}function fo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===q?za+=4:(n=r,0===ja&&ei(Tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=wa()):(za=t,t=r)):(za=t,t=r),t}function mo(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===H?za+=2:(n=r,0===ja&&ei(Lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ga()):(za=t,t=r)):(za=t,t=r),t}function ho(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===Y?za+=7:(n=r,0===ja&&ei(St)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ya()):(za=t,t=r)):(za=t,t=r),t}function po(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===K?za+=3:(n=r,0===ja&&ei(Nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ia()):(za=t,t=r)):(za=t,t=r),t}function vo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===j?za+=8:(n=r,0===ja&&ei(Ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ta()):(za=t,t=r)):(za=t,t=r),t}function wo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===J?za+=5:(n=r,0===ja&&ei(Ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=La()):(za=t,t=r)):(za=t,t=r),t}function go(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===B?za+=4:(n=r,0===ja&&ei(Dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Sa()):(za=t,t=r)):(za=t,t=r),t}function yo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===G?za+=7:(n=r,0===ja&&ei(_t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Na()):(za=t,t=r)):(za=t,t=r),t}function Io(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===W?za+=2:(n=r,0===ja&&ei(Ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Oa()):(za=t,t=r)):(za=t,t=r),t}function To(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===X?za+=8:(n=r,0===ja&&ei(Mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ca()):(za=t,t=r)):(za=t,t=r),t}function Lo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ee?za+=4:(n=r,0===ja&&ei(Zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Da()):(za=t,t=r)):(za=t,t=r),t}function So(){var t,n,a,i;return t=za,(n=e.substr(za,13)).toLowerCase()===te?za+=13:(n=r,0===ja&&ei(xt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=_a()):(za=t,t=r)):(za=t,t=r),t}function No(){var t,n,a,i;return t=za,(n=e.substr(za,15)).toLowerCase()===ne?za+=15:(n=r,0===ja&&ei(Et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Fa()):(za=t,t=r)):(za=t,t=r),t}function Oo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===re?za+=5:(n=r,0===ja&&ei(bt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ma()):(za=t,t=r)):(za=t,t=r),t}function Co(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===ae?za+=3:(n=r,0===ja&&ei(At)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Za()):(za=t,t=r)):(za=t,t=r),t}function Do(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ie?za+=4:(n=r,0===ja&&ei(Pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=xa()):(za=t,t=r)):(za=t,t=r),t}function _o(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===oe?za+=6:(n=r,0===ja&&ei($t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ea()):(za=t,t=r)):(za=t,t=r),t}function Fo(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===se?za+=6:(n=r,0===ja&&ei(Rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ba()):(za=t,t=r)):(za=t,t=r),t}function Mo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ue?za+=4:(n=r,0===ja&&ei(Ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Aa()):(za=t,t=r)):(za=t,t=r),t}function Zo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===le?za+=3:(n=r,0===ja&&ei(kt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Pa()):(za=t,t=r)):(za=t,t=r),t}function xo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ce?za+=4:(n=r,0===ja&&ei(Vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=$a()):(za=t,t=r)):(za=t,t=r),t}function Eo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===fe?za+=4:(n=r,0===ja&&ei(zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ra()):(za=t,t=r)):(za=t,t=r),t}function bo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===de?za+=4:(n=r,0===ja&&ei(qt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ua()):(za=t,t=r)):(za=t,t=r),t}function Ao(){var t;return 44===e.charCodeAt(za)?(t=me,za++):(t=r,0===ja&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(za)?(t=he,za++):(t=r,0===ja&&ei(Yt)),t}function $o(){var t;return 41===e.charCodeAt(za)?(t=pe,za++):(t=r,0===ja&&ei(Kt)),t}function Ro(){var e,t;for(e=[],t=Uo();t!==r;)e.push(t),t=Uo();return e}function Uo(){var t;return t=e.charAt(za),De.test(t)?za++:(t=r,0===ja&&ei(jt)),t}function ko(){var t,n,a,i;if(t=za,(n=pi())!==r&&(qa=t,n=ka(n)),(t=n)===r)if(t=za,96===e.charCodeAt(za)?(n=ve,za++):(n=r,0===ja&&ei(Qt)),n!==r){if(a=[],i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt));else a=r;a!==r?(96===e.charCodeAt(za)?(i=ve,za++):(i=r,0===ja&&ei(Qt)),i!==r?(qa=t,t=Va(a)):(za=t,t=r)):(za=t,t=r)}else za=t,t=r;return t}function Vo(e,t,n,r,a){const i={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(i.escape=r),i}function zo(e,...t){return{type:"expression-list",location:e,value:t}}function qo(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Vo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:za,peg$FAILED:r,peg$maxFailExpected:Ka,peg$maxFailPos:Ya};if(n!==r&&za===e.length)return n;throw n!==r&&za<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(Ka,Ya<e.length?e.charAt(Ya):null,Ya<e.length?Xa(Ya,Ya+1):Xa(Ya,Ya))}(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const W=new Set(["current_timestamp","current_date","current_time"]);class X{constructor(e){this.staticData=e}makeBool(e){return fe(e)}featureValue(e,t,n,r){return Se(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Le(e,t,n)}ensureArray(e){return de(e)}applyIn(e,t){return ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return ge(e)}currentTime(e){return ye(e)}makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}compare(e,t,n){return R(t,n,e)}calculate(e,t,n,r){return K(e,t,n,r)}evaluateTime(e){return F(e)}evaluateTimestamp(e,t,n){return M(e,t,n)}evaluateDate(e,t){return Z(e,t)}evaluateFunction(e,t,n){return z(e,t,n)}lookup(e,t){const n=t[e];return void 0===n?null:n}between(e,t){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],">=")&&R(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],"<")||R(e,t[1],">")}ternaryNot(e){return me(e)}ternaryAnd(e,t){return he(e,t)}ternaryOr(e,t){return pe(e,t)}}function ee(e,...t){return`this.${e}(${t.join(", ")})`}function te(e){return void 0===e?"void 0":JSON.stringify(e)}function ne({type:e,period:t,precision:n,secondary:r}){return JSON.stringify({type:e,period:t,precision:n,secondary:r})}const re="feature",ae="lookups",ie="attributeAdapter",oe="fieldsIndex",se="timeZone",ue="currentUser";class le{constructor(e){this._parseTree=e,this._staticData=Object.create(null),this._nextStaticDataId=0,this._tempVars=new Set,this._nextTempVarId=0}compile(){const e=this._compileNode(this._parseTree),t=`\n ${this._tempVars.size>0?`var ${Array.from(this._tempVars).join(", ")};`:""}\n return this.convertInterval(${e});\n `;return new Function(re,ae,ie,oe,se,ue,t).bind(new X(this._staticData))}_storeStaticData(e){const t="static$"+this._nextStaticDataId++;return this._staticData[t]=e,t}_compileRefStaticData(e){return`this.staticData[${te(e)}]`}_generateTempVar(){const e="temp$"+this._nextTempVarId++;return this._tempVars.add(e),e}_compileSimpleCase(e){const t=this._compileNode(e.operand),n=this._generateTempVar(),r=[];for(const t of e.clauses){const e=ee("compare",te("="),n,this._compileNode(t.operand)),a=this._compileNode(t.value);r.push(`${e} ? (${a}) :`)}return null!=e.else?r.push(this._compileNode(e.else)):r.push(te(null)),`(${n} = ${t}, ${r.join(" ")})`}_compileSearchedCase(e){const t=[];for(const n of e.clauses){const e=ee("makeBool",this._compileNode(n.operand)),r=this._compileNode(n.value);t.push(`${e} ? (${r}) :`)}return null!=e.else?t.push(this._compileNode(e.else)):t.push(te(null)),t.join(" ")}_compileInExpr(e,t){const n=new Set,r=[];for(const e of t.value)"number"===e.type||"string"===e.type?n.add(e.value):r.push(e);const a=this._compileNode(e),i=ee("ensureArray",this._compileNode({type:"expression-list",location:t.location,value:r}));if(n.size>0){const e=this._compileRefStaticData(this._storeStaticData(n)),t=this._generateTempVar();return r.length>0?`(${t} = ${a}, ${e}.has(${t}) || ${ee("applyIn",t,i)})`:`(${t} = ${a}, ${t} == null ? null : ${e}.has(${t}))`}return ee("applyIn",a,i)}_compileNode(e){switch(e.type){case"interval":return ee("makeSqlInterval",this._compileNode(e.value),"interval-qualifier"===e.qualifier.type?function({type:e,start:t,end:n}){return`{type: ${te(e)}, start: ${ne(t)}, end: ${ne(n)}}`}(e.qualifier):ne(e.qualifier),te(e.op));case"case-expression":return"simple"===e.format?this._compileSimpleCase(e):this._compileSearchedCase(e);case"parameter":return ee("lookup",te(e.value.toLowerCase()),ae);case"expression-list":return`[${e.value.map((e=>this._compileNode(e))).join(", ")}]`;case"unary-expression":return ee("ternaryNot",this._compileNode(e.expr));case"binary-expression":switch(e.operator){case"AND":return ee("ternaryAnd",this._compileNode(e.left),this._compileNode(e.right));case"OR":return ee("ternaryOr",this._compileNode(e.left),this._compileNode(e.right));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return ee("equalsNull",this._compileNode(e.left));case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return`!${ee("equalsNull",this._compileNode(e.left))}`;case"IN":return this._compileInExpr(e.left,e.right);case"NOT IN":return ee("ternaryNot",this._compileInExpr(e.left,e.right));case"BETWEEN":return ee("between",this._compileNode(e.left),this._compileNode(e.right));case"NOTBETWEEN":return ee("notbetween",this._compileNode(e.left),this._compileNode(e.right));case"LIKE":return ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape));case"NOT LIKE":return ee("ternaryNot",ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape)));case"<>":case"<":case">":case">=":case"<=":case"=":return ee("compare",te(e.operator),this._compileNode(e.left),this._compileNode(e.right));case"*":case"-":case"+":case"/":case"||":return ee("calculate",te(e.operator),this._compileNode(e.left),this._compileNode(e.right),se);default:throw new o.L8(o.Z7.UnsupportedOperator,{operator:e.operator})}case"null":case"boolean":case"string":case"number":return te(e.value);case"time":try{return this._compileRefStaticData(this._storeStaticData(F(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(Z(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(M(e.value,"unknown")))}catch{return ee("evaluateTimestamp",te(e.value),te("unknown"))}case"current-time":return"date"===e.mode?ee("currentDate",se):"time"===e.mode?ee("currentTime",se):ee("currentTimestamp",se);case"current-user":return ue;case"column-reference":return ee("featureValue",re,te(e.column),oe,ie);case"data-type":return function({type:e,size:t,withtimezone:n}){return JSON.stringify({type:e,size:t,withtimezone:n})}(e.value);case"function":return ee("evaluateFunction",te(e.name),this._compileNode(e.args),se)}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}class ce{static create(e,t={}){return new ce(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}constructor(e,t,n="UTC",r=null){this.fieldsIndex=t,this.timeZone=n,this.currentUser=r,this.parameters={},this._compiledExecutor=null,this._hasDateFunctions=void 0,this.parseTree=B.parse(e);const{isStandardized:a,isAggregate:i,currentUserRequired:o,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=i,this.currentUserRequired=o}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toStorageFormat():D(e)?e.toStorageString():C(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toMilliseconds():C(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():_(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?d.k.fromDateJS(e).toStorageString():O(e)?d.k.fromDateTime(e).toStorageString():_(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():D(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(O(e))return f.g.fromDateTime(e).toStorageFormat();if(_(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Ne,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}tryGetCompiledExecutor(){if(null!=this._compiledExecutor)return this._compiledExecutor;if((0,r.A)("esri-csp-restrictions"))return null;const e=new le(this.parseTree);return this._compiledExecutor=e.compile(),this._compiledExecutor}calculateValueCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.calculateValue(e,t):r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}testFeature(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.testFeature(e,t):!!r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,G(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||W.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return G(this.parseTree,(t=>{if("function"===t.type){const n=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,a=`${n}-${t}`;e.has(a)||e.set(a,{aggregateType:n,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return G(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,i=!1,o=!1;return G(this.parseTree,(s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,i;r?a=i=r.name??"":(i=s.column,a=i.toLowerCase()),n.has(a)||(n.add(a),t.push(i)),s.column=i;break}case"current-user":o=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Y[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===i&&(i=(0,a.M)(e,n));break}}})),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:i,currentUserRequired:o}}_evaluateNode(e,t,n,r,i){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,i);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,i);for(let o=0;o<e.clauses.length;o++)if(R(a,this._evaluateNode(e.clauses[o].operand,t,n,r,i),"="))return this._evaluateNode(e.clauses[o].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}else{for(let a=0;a<e.clauses.length;a++)if(fe(this._evaluateNode(e.clauses[a].operand,t,n,r,i)))return this._evaluateNode(e.clauses[a].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,b.$P)(s)?h.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const o of e.value)a.push(this._evaluateNode(o,t,n,r,i));return a}case"unary-expression":return me(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return he(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return pe(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,n,r,i);case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,n,r,i);case"IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return ve(this._evaluateNode(e.left,t,n,r,i),a)}case"NOT IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return me(ve(this._evaluateNode(e.left,t,n,r,i),a))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],">=")&&R(a,o[1],"<=")}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],"<")||R(a,o[1],">")}case"LIKE":return Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return me(Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return R(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return K(e.operator,this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=Z(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return F(e.value);case"current-time":return"date"===e.mode?ge(this.timeZone):"time"===e.mode?ye(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Se(t,e.column,this.fieldsIndex,n);case"data-type":return e.value;case"function":{if(this.isAggregate&&(0,a.M)(e.name,e.args.value.length)){const t=[];for(const a of e.args?.value||[]){const e=[];for(const t of r||[])e.push(this._evaluateNode(a,t,n,null,i));t.push(e)}return(0,a.s)(e.name,t)}const o=this._evaluateNode(e.args,t,n,r,i);return z(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function fe(e){return!0===e}function de(e){return Array.isArray(e)?e:[e]}function me(e){return null!==e?!0!==e:null}function he(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function pe(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function ve(e,t){if(null==e)return null;let n=!1;for(const r of t)if(null==r)n=null;else{if(e===r){n=!0;break}if(P(e)&&P(r)&&(n=R(e,r,"="),n))break}return n}function we(e){return S(new Date,e)}function ge(e){return i.n.fromNow(e)}function ye(e){const t=S(new Date,e);return d.k.fromDateTime(t)}const Ie="-[]/{}()*+?.\\^$|";var Te;function Le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Te.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Te.Normal:i===n?a=Te.Escaped:Ie.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Te.Escaped:Ie.includes(i)?r+="\\"+i:r+=i,a=Te.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Se(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t),o=n?.get(t);return null==a||"esriFieldTypeDate"!==o?.type&&"date"!==o?.type?null==a||"esriFieldTypeDateOnly"!==o?.type&&"date-only"!==o?.type?null==a||"esriFieldTypeTimeOnly"!==o?.type&&"time-only"!==o?.type?null==a||"esriFieldTypeTimestampOffset"!==o?.type&&"timestamp-offset"!==o?.type?a:new f.g(a):d.k.fromReader(a):i.n.fromReader(a):S(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Te||(Te={}));const Ne={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}},95466:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(49186),a=n(25482),i=n(53966),o=n(91869),s=n(3330),u=n(30524),l=n(56400),c=n(96285);const f=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],v(e))}static fromLayerJSON(e){return new d(e.fields??[],v(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const a=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(a,e),this._normalizedFieldsMap.set(r,e),n.push(`${a}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,u.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,u.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,u.te)(e)||(0,u.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,u.te)(e)||(0,u.Xz)(e)||e.nullable||void 0!==(0,u.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),l.n$):p.has(t.type)?l.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===l.L5?s.GB.instance:t===l.n$?c.mQ.utcInstance:(0,o.tE)(f,t,(()=>c.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,u.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>a.A.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,u.rS)(e)?.toLowerCase()??""}const p=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function v(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:a}=e,i=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",s=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,u=a?function(e){return"timeZone"in e}(a)?a.timeZone??s:a.dateFieldsTimeReference?(0,l.ZS)(a.dateFieldsTimeReference):s??l.n$:null,c=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,l.ZS)(r.timeReference):s:null,f=new Map([[m(a?.creationDateField??""),u],[m(a?.editDateField??""),u],[m(i),c],[m(o),c]]);for(const{name:r,type:a}of e.fields)if(p.has(a))t.set(r,l.L5);else if("date"!==a&&"esriFieldTypeDate"!==a)t.set(r,null);else if(n)t.set(r,l.L5);else{const e=f.get(m(r??""))??s;t.set(r,e)}return t}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1162,3186],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>s});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},17311:(e,t,r)=>{r.d(t,{A:()=>d});var n=r(90237),i=r(69622),s=r(60999),o=r(5503),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608)),u=r(30524),p=r(71386);let c=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,s.UT)((()=>(0,p.lw)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new o.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),n=this.fieldsIndex.get(r.at(-1)??"");n&&e.add(n.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){try{const{attributes:n}=t,i=r?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(r.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const r=this._createFormattedAttributes(e,t,i).global;return s({attributes:n,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:r,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const r=t.getObjectId();if(null==r)return t;if(!(0,u.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[r];const n=await e.queryFeatures(t);if(1===n?.features.length)return n.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),n=e?.name??r.fieldName;r.fieldName=n,t.set(n.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const n=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const s={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:n,attributes:s,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,u.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"_arcadeTask",null),(0,n._)([(0,a.MZ)()],c.prototype,"_featureUtils",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"featureUtilsPromise",null),(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"calculatedExpressions",null),(0,n._)([(0,a.MZ)()],c.prototype,"displayField",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"effectivePopupTemplate",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"expressionsUsedInTitle",null),(0,n._)([(0,a.MZ)()],c.prototype,"fieldsIndex",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"fieldInfoMap",null),(0,n._)([(0,a.MZ)()],c.prototype,"fields",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"objectIdField",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"requiredFields",null),c=(0,n._)([(0,l.$)("esri.layers.support.TitleCreator")],c);const d=c},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>h,XJ:()=>f,lc:()=>y,mX:()=>g,rU:()=>b,tH:()=>F});var n=r(799);const i="__begin__",s="__end__",o=new RegExp(i,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(s+"$","i"),p='"',c=p+" + ",d=" + "+p;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);switch(t.type){case"conventional":return g(t.expression);case"arcade":return t.expression}return null}function b(e){const t=f(e);switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return F(t.expression)}return null}function g(e){let t;return e?(t=(0,n.HC)(e,(e=>i+'$feature["'+e+'"]'+s)),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(o,c).replaceAll(a,d)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,M=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,_=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function F(e){if(!e)return null;let t=v.exec(e)||M.exec(e);return t?t[1]||t[3]:(t=_.exec(e),t?t[2]:null)}},37531:(e,t,r)=>{r.d(t,{dt:()=>y,GG:()=>g,UQ:()=>b,Sx:()=>c});var n=r(68197),i=r(60999),s=(r(44208),r(51850)),o=(r(76369),r(62046)),a=(r(2741),r(78888),r(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new a.q(1e3),new n.A([128,128,128]);var l=r(78504),u=r(33910);const p=new n.A("white");function c(e,t){if(!e)return null;let r=null;return(0,u.wk)(e)?r=function(e){const t=e.symbolLayers;if(!t)return null;let r=null;return t.forEach((e=>{"object"===e.type&&e.resource?.href||(r="water"===e.type?e.color:e.material?e.material.color:null)})),r?new n.A(r):null}(e):(0,u.$y)(e)&&(r="cim"===e.type?(0,o.Nk)(e):e.color?new n.A(e.color):null),r?d(r,t):null}function d(e,t){if(null==t||null==e)return e;const r=e.toRgba();return r[3]=r[3]*t,new n.A(r)}function y(e,t,r){e&&(t||null!=r)&&(t&&(t=new n.A(t)),(0,u.wk)(e)?function(e,t,r){const n=e.symbolLayers;if(!n)return;const i=e=>d(t??e??(null!=r?p:null),r);n.forEach((e=>{if("object"!==e.type||!e.resource?.href||t)if("water"===e.type)e.color=i(e.color);else{const t=null!=e.material?e.material.color:null,n=i(t);if(null==e.material?e.material=new l.N({color:n}):e.material.color=n,null!=r&&"outline"in e&&null!=e.outline?.color&&(e.outline.color=d(e.outline.color,r)),"marker"in e&&null!=e.marker){const t=i(e.marker.color);e.marker.color=t}}}))}(e,t,r):(0,u.$y)(e)&&function(e,t,r){(t=t??e.color)&&(e.color=d(t,r)),null!=r&&"outline"in e&&e.outline?.color&&(e.outline.color=d(e.outline.color,r))}(e,t,r))}function h(e){for(const t of e)if("number"==typeof t)return t;return null}function f(e,t,r){for(let n=0;n<3;n++){const i=e[n];switch(i){case"symbol-value":{const e=r[n];return null!=e?e/t[n]:1}case"proportional":break;default:if(i&&t[n])return i/t[n]}}return null}function m(e,t,r,n){switch(e){case"proportional":return r*n;case"symbol-value":return null!=t?t:r;default:return e}}async function b(e,t){if(e&&t)return(0,u.wk)(e)?async function(e,t){const n=e.symbolLayers;n&&await(0,i.jJ)(n,(async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}(e,t);break;case"icon":case"line":case"text":!function(e,t){const r=h(t);null!=r&&(e.size=r)}(e,t);break;case"path":!function(e,t){const r=f(t,s.Un,[e.width,void 0,e.height]);null!=r&&(e.width=m(t[0],e.width,1,r),e.height=m(t[2],e.height,1,r))}(e,t);break;case"object":await async function(e,t){const{resourceSize:n,symbolSize:i}=await async function(e){const{computeObjectLayerResourceSize:t}=await r.e(5404).then(r.bind(r,95404)),n=await t(e,10),{width:i,height:s,depth:o}=e,a=[i,o,s];let l=1;for(let e=0;e<3;e++){const t=a[e];if(null!=t){l=t/n[e];break}}for(let e=0;e<3;e++)null==a[e]&&(a[e]=n[e]*l);return{resourceSize:n,symbolSize:a}}(e),s=f(t,n,i);null!=s&&(e.width=m(t[0],i[0],n[0],s),e.depth=m(t[1],i[1],n[1],s),e.height=m(t[2],i[2],n[2],s))}(e,t)}}(e,t)))}(e,t):void((0,u.$y)(e)&&function(e,t){const r=h(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}(e,t))}function g(e,t,r){if(e&&null!=t)if((0,u.wk)(e)){const n=e.symbolLayers;n&&n.forEach((e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)}))}else(0,u.$y)(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}},39516:(e,t,r)=>{let n;async function i(){return null==n&&(n=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),n}async function s(e,t){const r=await i(),n=r.get(e,t);if(null==n)throw r.getError(e,t);return n}function o(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>s,IW:()=>a,mA:()=>o})},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var n=r(90237),i=r(66552),s=r(53966),o=r(10107),a=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),p="percent-of-total",c="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&p||null,t&&r&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==p||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n._)([(0,o.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,n._)([(0,a.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,n._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},41560:(e,t,r)=>{r.d(t,{Ch:()=>o,mW:()=>s});var n=r(34727),i=r(39516);function s(e,t){return{...t,filterMode:e.mode}}function o(e,t,r){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],p(r)),t[1]=Math.min(t[1],c(n));return t}(e);if(s&&((0,n.gg)(t,s[0])||(0,n.ZH)(r,s[1])))return"";const o=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=p(e.at(0)?.minScale),s=c(e.at(-1)?.maxScale);if((0,n.ZH)(i,t)||(0,n.gg)(s,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,n.ZH)(p(i.minScale),c(r.maxScale)))return!0}return!1}(o,t,r)?"1=1":o.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)l(n.minScale,n.maxScale,t,r)&&(yield n)}}function l(e,t,r,i){return e=p(e),r=p(r),t=c(t),!(!(0,n.Sp)(r,e)&&(i??r)>e||(0,n.Hx)(t,r)||void 0!==i&&(0,n.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function p(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},59929:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ee});var n=r(90237),i=r(69540),s=r(5503),o=r(49186),a=r(81583),l=r(92071),u=r(74887),p=r(36708),c=r(39516),d=r(84952),y=r(10107),h=(r(44208),r(53966)),f=(r(87811),r(36005)),m=r(40608),b=r(4146),g=r(52136),w=r(18768),v=r(63074),M=r(69208),_=r(6455),F=r(47685),I=r(87796),A=r(16131),x=r(8303),T=r(54310),S=r(25036),k=r(82935),C=r(60694),E=r(10873),Z=r(15426),j=r(17036),O=r(30524),P=r(85334),L=r(90360),$=r(86162),q=r(92438),R=r(96576),z=r(93618),N=r(62046),U=r(37531);const V={key:"type",base:q.A,errorContext:"renderer",typeMap:{simple:R.A,"unique-value":z.A,"class-breaks":$.A}},G=(0,L.C)({types:V}),D=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];var H=r(13874),Q=r(4902),B=r(4718),K=r(92474),W=r(97768),X=r(93637),J=r(43937),Y=r(89317),ee=r(38141),te=r(16930),re=r(29005),ne=r(46499),ie=r(39383),se=r(17311),oe=r(61956),ae=r(30291),le=r(59868),ue=r(85360);const pe=(0,j.p)();let ce=0;function de(e,t){let r=e.json.write;return"object"!=typeof r&&(r=e.json.write={}),r.ignoreOrigin=!0,t?.spatialOnly&&(r.layerContainerTypes=Y.K),e}function ye(e){const t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),"object"==typeof t.write&&(e?.spatialOnly&&(t.write.layerContainerTypes=Y.K),e?.target&&(t.write.target=e.target)),t}function he(e){switch(e){case"point":case"multipoint":return le.UK.clone();case"polyline":return le.A7.clone();case"polygon":case"multipatch":return le.Cx.clone();default:return null}}function fe(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function me(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},i=fe(e,t);if(null!=i){const{defaultValues:e}=i;for(const t in e)n[t]=e[t]}return n[t.subtypeField]=e,new re.A({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}let be=class extends((0,l.P)(i.A.ClonableMixin(Q.A.IdentifiableMixin(K.A)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ce++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return(0,O.yp)(this.renderer,this.fieldsIndex),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,W.pR)(e),new se.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,displayField:this.parent?.displayField??"",fields:this.fields,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}get featureTitleFields(){return[...this._titleCreator.requiredFields]}writeFieldOverrides(e,t,r){const{fields:n,parent:i}=this;let s;if(n){s=[];let e=0;n.forEach((({name:t,alias:r,editable:n,visible:o})=>{if(!o)return;const a=i?.fields?.find((e=>e.name===t));if(!a)return;const l={name:t};let u=!1;r!==a.alias&&(l.alias=r,u=!0),n!==a.editable&&(l.editable=n,u=!0),s.push(l),u&&e++})),0===e&&s.length===n.length&&(s=null)}else s=(0,B.o8)(e);s?.length&&(0,X.sM)(r,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e?.fields;if(!e||!n?.length)return null;const{subtypes:i,subtypeField:s}=e,o=i?.find((e=>e.code===r)),a=o?.defaultValues,l=o?.domains,u=[];for(const e of n){const n=e.clone(),{name:i}=n,o=t?.find((e=>e.name===i));if(n.visible=!t||!!o,o){const{alias:e,editable:t}=o;e&&(n.alias=e),!1===t&&(n.editable=!1)}const p=a?.[i]??null;n.defaultValue=i===s?r:p;const c=l?.[i]??null;n.domain=i===s?null:c?"inherited"===c.type?n.domain:c.clone():null,u.push(n)}return u}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?this.parent.globalIdField:(h.A.getLogger(this).error(ve("globalIdField")),null)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||h.A.getLogger(this).error(ve("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){(0,O.yp)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new R.A({symbol:he(e)})}(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const n=t.drawingInfo?.renderer,i=G(n,t,r);let s;const{subtypeCode:o}=this;if(null!=o&&function(e,t){return!(!t||"unique-value"!==e?.type||null==e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(i,t.subtypeField)){const e=i.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(o)));e&&(s=new R.A({symbol:e.symbol}))}else"simple"!==i?.type||i.visualVariables?.length||(s=i);return s}readRenderer(e,t,r){const n=t?.layerDefinition?.drawingInfo?.renderer;if(!n)return;const i=n.visualVariables?.some((e=>"rotationInfo"!==e.type));return i?void 0:G(n,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??te.A.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[me(this.subtypeCode,t)]}readTitleFromService(e,t){const r=fe(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw ve("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw ve("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw ve("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw ve("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:i}=this;if(r){const{displayField:e,editFieldsInfo:s,objectIdField:o}=r;t={displayField:e,editFieldsInfo:s,fields:n,objectIdField:o,title:i}}return(0,ae.tn)(t,e)}createQuery(){if(!this.parent)throw ve("createQuery");const e=(0,Z.VZ)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,c.mA)(t,this.parent.definitionExpression),e}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const t=(0,Z.pc)(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw ve("queryAttachments");const n=e.clone();return n.where=we(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw ve("queryFeatureCount");return r.parent.queryFeatureCount(ge(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw ve("queryFeatures");return r.parent.queryFeatures(ge(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw ve("queryObjectIds");return r.parent.queryObjectIds(ge(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw ve("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw ve("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],be.prototype,"_titleCreator",null),(0,n._)([(0,y.MZ)({type:ue.A,json:ye({name:"attributeTableInfo"})})],be.prototype,"attributeTableTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"capabilities",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"effectiveCapabilities",null),(0,n._)([(0,y.MZ)({json:ye()})],be.prototype,"charts",void 0),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:ye({name:"enableEditing"})})],be.prototype,"editingEnabled",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],be.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"elevationInfo",null),(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],be.prototype,"featureTitleFields",null),(0,n._)([(0,y.MZ)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],be.prototype,"fieldOverrides",void 0),(0,n._)([(0,J.K)("fieldOverrides")],be.prototype,"writeFieldOverrides",null),(0,n._)([(0,y.MZ)({...pe.fields,readOnly:!0,json:{read:!1}})],be.prototype,"fields",null),(0,n._)([(0,y.MZ)(pe.fieldsIndex)],be.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"floorInfo",null),(0,n._)([(0,y.MZ)({type:ee.A,json:ye({name:"formInfo"})})],be.prototype,"formTemplate",void 0),(0,n._)([(0,y.MZ)({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],be.prototype,"id",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"isTable",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"geometryType",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"globalIdField",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"type",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.kF)))],be.prototype,"labelsVisible",void 0),(0,n._)([(0,y.MZ)({type:[ne.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:ie.w},write:{ignoreOrigin:!0,layerContainerTypes:Y.K}}})],be.prototype,"labelingInfo",void 0),(0,n._)([(0,y.MZ)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:Y.K}}})],be.prototype,"layerType",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.fV)))],be.prototype,"legendEnabled",void 0),(0,n._)([(0,y.MZ)({type:["show","hide"]})],be.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(E.hn);return e.json.origins.service.read=!1,de(e,{spatialOnly:!0})})())],be.prototype,"minScale",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(E.hG);return e.json.origins.service.read=!1,de(e,{spatialOnly:!0})})())],be.prototype,"maxScale",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"effectiveScaleRange",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"objectIdField",null),(0,n._)([(0,y.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0,json:ye({spatialOnly:!0})})],be.prototype,"opacity",void 0),(0,n._)([(0,y.MZ)({clonable:!1})],be.prototype,"parent",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.M6)))],be.prototype,"popupEnabled",void 0),(0,n._)([(0,y.MZ)({type:H.A,json:ye({name:"popupInfo"})})],be.prototype,"popupTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"defaultPopupTemplate",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"relationships",null),(0,n._)([(0,y.MZ)({types:V,json:ye({target:"layerDefinition.drawingInfo.renderer",spatialOnly:!0})})],be.prototype,"renderer",null),(0,n._)([(0,f.w)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],be.prototype,"readRendererFromService",null),(0,n._)([(0,f.w)("renderer",["layerDefinition.drawingInfo.renderer"])],be.prototype,"readRenderer",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"spatialReference",null),(0,n._)([(0,y.MZ)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],be.prototype,"subtypeCode",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"subtypeField",null),(0,n._)([(0,y.MZ)({type:[re.A],json:ye({name:"layerDefinition.templates"})})],be.prototype,"templates",void 0),(0,n._)([(0,f.w)("service","templates",["geometryType","subtypeField","subtypes","type"])],be.prototype,"readTemplatesFromService",null),(0,n._)([(0,y.MZ)({type:String,json:ye()})],be.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["subtypes"])],be.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"url",null),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"userHasUpdateItemPrivileges",null),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:ye({name:"visibility",spatialOnly:!0})})],be.prototype,"visible",void 0),be=(0,n._)([(0,m.$)("esri.layers.support.SubtypeSublayer")],be);const ge=(e,t,r)=>{if(!r)return t.createQuery();const n=oe.A.from(r);return n.where=we(n.where,e.subtypeField,t.subtypeCode),n},we=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${r}`,s=e??"";return n.test(s)?s.replace(n,i):(0,c.mA)(i,s)},ve=e=>new o.A(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),Me=be;var _e=r(96184),Fe=r(91908),Ie=r(54218),Ae=r(92935);const xe="SubtypeGroupLayer";function Te(e,t){return new o.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Se(e,t){const r=[];for(const n of e){const e=new Me;e.read(n,t),r.push(e)}return r}const ke=(0,j.p)();let Ce=class extends((0,I.j)((0,_.FJ)((0,F.w6)((0,v.dM)((0,k.e)((0,S.j)((0,T.J)((0,w.b)((0,A.q)((0,x.A)((0,l.P)((0,M.d)((0,g.p)(i.A.ClonableMixin(b.A))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(s.A.ofType(Me)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=(0,u.sg)((async(e,t,n)=>{const{save:i,saveAs:s}=await r.e(5740).then(r.bind(r,33359));switch(e){case Ae.X.SAVE:return i(this,t);case Ae.X.SAVE_AS:return s(this,n,t)}})),this.addHandles((0,p.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p.OH))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.QP).then((async()=>{if(!this.url)throw new o.A("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new o.A("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,Z.VA)(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,Z.C$)(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=(0,d.An)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,d.fj)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,C.yG)(this.url,t):t}async addAttachment(e,t){const r=await(0,Z.Xl)(this,e,t,xe);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const n=await(0,Z.bt)(this,e,t,r,xe);return this.lastEditsEventDate=new Date,n}async applyEdits(e,t){return(0,Z.ct)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.qr)(Promise.all([r.e(364),r.e(8628),r.e(2593),r.e(9062)]).then(r.bind(r,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,Z.VZ)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,c.mA)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await(0,Z.mm)(this,e,t,xe);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return(0,Z.WP)(this,e,xe)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=(0,Z.pc)(this,e);if(t)return t}const r=(0,Z.Nv)(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return(0,a.g)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,Z.lV)(this,e,t,xe)}async queryFeatures(e,t){const r=await this.load(),n=oe.A.from(e)??r.createQuery(),i=n.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),n.outFields=i);const s=await r.source.queryFeatures(n,t);if(s?.features)for(const e of s.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return s}async queryObjectIds(e,t){return(await(0,Z.sg)(this,e,t,xe)).filter(Ie.Et)}async queryFeatureCount(e,t){return(0,Z.Ye)(this,e,t,xe)}async queryExtent(e,t){return(0,Z.B5)(this,e,t,xe)}async queryRelatedFeatures(e,t){return(0,Z.hM)(this,e,t,xe)}async queryRelatedFeaturesCount(e,t){return(0,Z.S2)(this,e,t,xe)}async save(e){return this._debouncedSaveOperations(Ae.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ae.X.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:n,messages:i}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==n)return i?.push(Te(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===n)return i?.push(Te(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(i?.push(new o.A("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,Fe.D)(this,e)}async getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this.displayField&&this.fieldsIndex.has(this.displayField)?e.attributes[this.fieldsIndex.get(this.displayField).name]??"":this.objectIdField&&this.fieldsIndex.has(this.objectIdField)?e.attributes[this.fieldsIndex.get(this.objectIdField).name]??"":""}get requiredFeatureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new o.A("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,O.sv)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,Z.jp)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"createQueryVersion",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"editingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({...ke.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Ce.prototype,"fields",void 0),(0,n._)([(0,y.MZ)(ke.fieldsIndex)],Ce.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)(E.id)],Ce.prototype,"id",void 0),(0,n._)([(0,y.MZ)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],Ce.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{"web-document":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}},"portal-item":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],Ce.prototype,"operationalLayerType",null),(0,n._)([(0,y.MZ)(ke.outFields)],Ce.prototype,"outFields",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"parsedUrl",null),(0,n._)([(0,y.MZ)({clonable:!1})],Ce.prototype,"source",null),(0,n._)([(0,y.MZ)({type:s.A.ofType(Me),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let n=null;if(this.useUniqueColorsForSublayers){const i=function(e,t){const r=e.drawingInfo?.renderer,n=r?G(r,e,t):null;if("simple"===n?.type)return(0,U.Sx)(n.symbol,null)?n.symbol.clone():null}(t,r);n=i?function(e,t){return(0,P.Iy)(D,e,{offset:!0,shuffle:!0}).reverse().map((e=>{const r=t.clone();return"cim"===r.type?(0,N.Fe)(r,e):(0,U.dt)(r,e),new R.A({symbol:r})}))}(e.length,i):null}const i=e.map((({code:e},i)=>{const s=new Me({subtypeCode:e});s.read(t,r);const o=n?.[i];return o&&s.read({drawingInfo:{renderer:o.toJSON()}},r),s}));return new(s.A.ofType(Me))(i)}}}},read:{source:["layers","tables"],reader(e,t,r){let n;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?n=Se(t.layers,r):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(n=Se(t.tables,r)),new(s.A.ofType(Me))(n)}},write:{ignoreOrigin:!0,writer(e,t,r,n){const i=[];for(const t of e){const e=t.write({},n);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],Ce.prototype,"sublayers",void 0),(0,n._)([(0,y.MZ)()],Ce.prototype,"useUniqueColorsForSublayers",void 0),(0,n._)([(0,y.MZ)({type:_e.A})],Ce.prototype,"timeInfo",void 0),(0,n._)([(0,y.MZ)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],Ce.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["name"])],Ce.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({json:{read:!1}})],Ce.prototype,"type",void 0),(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],Ce.prototype,"requiredFeatureTitleFields",null),Ce=(0,n._)([(0,m.$)("esri.layers.SubtypeGroupLayer")],Ce);const Ee=Ce},62046:(e,t,r)=>{r.d(t,{Fe:()=>l,Nk:()=>s});var n=r(68197),i=r(93397);function s(e){const t=[];return o((0,i.lW)(e),t),t.length?new n.A((0,i.e6)(t[0])):null}function o(e,t){if(!e)return;let r;r="CIMTextSymbol"===e.type?e.symbol:e;const n="CIMPolygonSymbol"===e.type;if(r?.symbolLayers)for(const e of r.symbolLayers)if(!(e.colorLocked||n&&((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&a(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{o(e.symbol,t)}));break;case"CIMSolidStroke":case"CIMSolidFill":a(t,e.color);break;case"CIMHatchFill":o(e.lineSymbol,t)}}function a(e,t){for(const r of e)if(r.join(".")===t.join("."))return;e.push(t)}function l(e,t,r){t instanceof n.A||(t=new n.A(t));const s=(0,i.lW)(e);s&&u(s,t,r)}function u(e,t,r){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===n?.type;if(n?.symbolLayers)for(const e of n.symbolLayers){if(e.colorLocked)continue;if(s)if(r){const{layersToColor:t}=r;if(((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))&&"fill"===t||(0,i.jn)(e)&&"outline"===t)continue}else if((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))continue;const n=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=n;break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{u(e.symbol,t,r)}));break;case"CIMSolidStroke":case"CIMSolidFill":e.color=n;break;case"CIMHatchFill":u(e.lineSymbol,t,r)}}}},81583:(e,t,r)=>{r.d(t,{L:()=>a,g:()=>o});var n=r(60999),i=r(5503),s=r(92474);async function o(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],o=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?o(...t):i.A.isCollection(t)?t.forEach((e=>o(e))):s.A.isLoadable(t)&&r.push(t))};t(o);let a=null;if(await(0,n.Tj)(r,(async e=>{const t=await(0,n.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||a||(a=t)})),a)throw a.error;return e}},85334:(e,t,r)=>{r.d(t,{$:()=>b,IB:()=>o,Iy:()=>F,N2:()=>g,RH:()=>v,ZD:()=>w});var n=r(68197),i=r(4576),s=r(4718);function o(e){return"r"in e&&"g"in e&&"b"in e}function a(e){return"h"in e&&"s"in e&&"v"in e}function l(e){return"l"in e&&"a"in e&&"b"in e}function u(e){return"l"in e&&"c"in e&&"h"in e}r(34727),r(87317),r(91829);const p=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],c=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function d(e,t){const r=[];let n,i;if(e[0].length!==t.length)throw new Error("dimensions do not match");const s=e.length,o=e[0].length;let a=0;for(n=0;n<s;n++){for(a=0,i=0;i<o;i++)a+=e[n][i]*t[i];r.push(a)}return r}function y(e){const t=[e.r/255,e.g/255,e.b/255].map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4)),r=d(p,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function h(e){const t=d(c,[e.x/100,e.y/100,e.z/100]).map((e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function f(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map((e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function m(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((e=>e>6/29?e**3:3*(6/29)**2*(e-4/29)));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function b(e){return o(e)?e:u(e)?function(e){return h(m(function(e){const t=e.l,r=e.c,n=e.h;return{l:t,a:r*Math.cos(n),b:r*Math.sin(n)}}(e)))}(e):l(e)?function(e){return h(m(e))}(e):function(e){return"x"in e&&"y"in e&&"z"in e}(e)?h(e):a(e)?function(e){const t=(e.h+360)%360/60,r=e.s/100,n=e.v/100*255,i=n*r,s=i*(1-Math.abs(t%2-1));let o;switch(Math.floor(t)){case 0:o={r:i,g:s,b:0};break;case 1:o={r:s,g:i,b:0};break;case 2:o={r:0,g:i,b:s};break;case 3:o={r:0,g:s,b:i};break;case 4:o={r:s,g:0,b:i};break;case 5:case 6:o={r:i,g:0,b:s};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+n-i),o.g=Math.round(o.g+n-i),o.b=Math.round(o.b+n-i),o}(e):e}function g(e){return a(e)?e:function(e){const t=e.r,r=e.g,n=e.b,i=Math.max(t,r,n),s=i-Math.min(t,r,n);let o=i,a=0===s?0:i===t?(r-n)/s%6:i===r?(n-t)/s+2:(t-r)/s+4,l=0===s?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=100/255,{h:a,s:l,v:o}}(b(e))}function w(e){return l(e)?e:function(e){return f(y(e))}(b(e))}function v(e){return u(e)?e:function(e){return function(e){const t=e.l,r=e.a,n=e.b,i=Math.sqrt(r*r+n*n);let s=Math.atan2(n,r);return s=s>0?s:s+2*Math.PI,{l:t,c:i,h:s}}(f(y(e)))}(b(e))}var M,_;function F(e,t,r={}){if(0===e.length||t<=0)return[];if(1===(e=e.map((e=>"string"==typeof e?new n.A(e):e))).length||1===t){const r=[],n=e[0];for(let e=0;e<t;e++)r.push(n.clone());return r}if(r.shuffle&&(e=(0,i.k4)((0,s.o8)(e),r.seed)),e.length>=t){const r=[],n=(e.length-1)/(t-1);for(let i=0;i<t;i++){const t=Math.round(i*n);r.push(e[t].clone())}return r}return function(e,t,r={}){const n=[],s=e.length-1,o=Math.ceil((t-e.length)/s);e:for(let i=0;i<s;i++){const s=e[i],a=e[i+1];for(let i=1;i<=o;i++){const l=i/(o+1);if(n.push(A(s,a,l,r)),n.length+e.length===t)break e}}return[...e.map((e=>e.clone())),...(0,i.k4)(n,r.seed??1)]}(e,t,r)}(_=M||(M={}))[_.Low=160]="Low",_[_.High=225]="High";const I=(e,t)=>{const r=Math.floor(10*t())-5;return Math.min(255,Math.max(0,e+r))};function A(e,t,r,s={}){const o=e.r,a=e.g,l=e.b,u=t.r,p=t.g,c=t.b,d=Math.round(o+(u-o)*r),y=Math.round(a+(p-a)*r),h=Math.round(l+(c-l)*r);if(!s.offset)return new n.A([d,y,h]);const f=(0,i.Mo)(s.seed);return new n.A([I(d,f),I(y,f),I(h,f)])}},92935:(e,t,r)=>{var n;r.d(t,{X:()=>n}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(n||(n={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1162,3186],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>s});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},17311:(e,t,r)=>{r.d(t,{A:()=>d});var n=r(90237),i=r(69622),s=r(60999),o=r(5503),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608)),u=r(30524),p=r(71386);let c=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,s.UT)((()=>(0,p.lw)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new o.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),n=this.fieldsIndex.get(r.at(-1)??"");n&&e.add(n.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){try{const{attributes:n}=t,i=r?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(r.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const r=this._createFormattedAttributes(e,t,i).global;return s({attributes:n,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:r,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const r=t.getObjectId();if(null==r)return t;if(!(0,u.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[r];const n=await e.queryFeatures(t);if(1===n?.features.length)return n.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),n=e?.name??r.fieldName;r.fieldName=n,t.set(n.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const n=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const s={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:n,attributes:s,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,u.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"_arcadeTask",null),(0,n._)([(0,a.MZ)()],c.prototype,"_featureUtils",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"featureUtilsPromise",null),(0,n._)([(0,a.MZ)({readOnly:!0})],c.prototype,"calculatedExpressions",null),(0,n._)([(0,a.MZ)()],c.prototype,"displayField",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"effectivePopupTemplate",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"expressionsUsedInTitle",null),(0,n._)([(0,a.MZ)()],c.prototype,"fieldsIndex",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"fieldInfoMap",null),(0,n._)([(0,a.MZ)()],c.prototype,"fields",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"objectIdField",void 0),(0,n._)([(0,a.MZ)()],c.prototype,"requiredFields",null),c=(0,n._)([(0,l.$)("esri.layers.support.TitleCreator")],c);const d=c},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>h,XJ:()=>f,lc:()=>y,mX:()=>g,rU:()=>b,tH:()=>I});var n=r(799);const i="__begin__",s="__end__",o=new RegExp(i,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(s+"$","i"),p='"',c=p+" + ",d=" + "+p;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);switch(t.type){case"conventional":return g(t.expression);case"arcade":return t.expression}return null}function b(e){const t=f(e);switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return I(t.expression)}return null}function g(e){let t;return e?(t=(0,n.HC)(e,(e=>i+'$feature["'+e+'"]'+s)),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(o,c).replaceAll(a,d)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,M=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,_=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function I(e){if(!e)return null;let t=v.exec(e)||M.exec(e);return t?t[1]||t[3]:(t=_.exec(e),t?t[2]:null)}},37531:(e,t,r)=>{r.d(t,{dt:()=>y,GG:()=>g,UQ:()=>b,Sx:()=>c});var n=r(68197),i=r(60999),s=(r(44208),r(51850)),o=(r(76369),r(62046)),a=(r(2741),r(78888),r(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new a.q(1e3),new n.A([128,128,128]);var l=r(78504),u=r(33910);const p=new n.A("white");function c(e,t){if(!e)return null;let r=null;return(0,u.wk)(e)?r=function(e){const t=e.symbolLayers;if(!t)return null;let r=null;return t.forEach((e=>{"object"===e.type&&e.resource?.href||(r="water"===e.type?e.color:e.material?e.material.color:null)})),r?new n.A(r):null}(e):(0,u.$y)(e)&&(r="cim"===e.type?(0,o.Nk)(e):e.color?new n.A(e.color):null),r?d(r,t):null}function d(e,t){if(null==t||null==e)return e;const r=e.toRgba();return r[3]=r[3]*t,new n.A(r)}function y(e,t,r){e&&(t||null!=r)&&(t&&(t=new n.A(t)),(0,u.wk)(e)?function(e,t,r){const n=e.symbolLayers;if(!n)return;const i=e=>d(t??e??(null!=r?p:null),r);n.forEach((e=>{if("object"!==e.type||!e.resource?.href||t)if("water"===e.type)e.color=i(e.color);else{const t=null!=e.material?e.material.color:null,n=i(t);if(null==e.material?e.material=new l.N({color:n}):e.material.color=n,null!=r&&"outline"in e&&null!=e.outline?.color&&(e.outline.color=d(e.outline.color,r)),"marker"in e&&null!=e.marker){const t=i(e.marker.color);e.marker.color=t}}}))}(e,t,r):(0,u.$y)(e)&&function(e,t,r){(t=t??e.color)&&(e.color=d(t,r)),null!=r&&"outline"in e&&e.outline?.color&&(e.outline.color=d(e.outline.color,r))}(e,t,r))}function h(e){for(const t of e)if("number"==typeof t)return t;return null}function f(e,t,r){for(let n=0;n<3;n++){const i=e[n];switch(i){case"symbol-value":{const e=r[n];return null!=e?e/t[n]:1}case"proportional":break;default:if(i&&t[n])return i/t[n]}}return null}function m(e,t,r,n){switch(e){case"proportional":return r*n;case"symbol-value":return null!=t?t:r;default:return e}}async function b(e,t){if(e&&t)return(0,u.wk)(e)?async function(e,t){const n=e.symbolLayers;n&&await(0,i.jJ)(n,(async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}(e,t);break;case"icon":case"line":case"text":!function(e,t){const r=h(t);null!=r&&(e.size=r)}(e,t);break;case"path":!function(e,t){const r=f(t,s.Un,[e.width,void 0,e.height]);null!=r&&(e.width=m(t[0],e.width,1,r),e.height=m(t[2],e.height,1,r))}(e,t);break;case"object":await async function(e,t){const{resourceSize:n,symbolSize:i}=await async function(e){const{computeObjectLayerResourceSize:t}=await r.e(5404).then(r.bind(r,95404)),n=await t(e,10),{width:i,height:s,depth:o}=e,a=[i,o,s];let l=1;for(let e=0;e<3;e++){const t=a[e];if(null!=t){l=t/n[e];break}}for(let e=0;e<3;e++)null==a[e]&&(a[e]=n[e]*l);return{resourceSize:n,symbolSize:a}}(e),s=f(t,n,i);null!=s&&(e.width=m(t[0],i[0],n[0],s),e.depth=m(t[1],i[1],n[1],s),e.height=m(t[2],i[2],n[2],s))}(e,t)}}(e,t)))}(e,t):void((0,u.$y)(e)&&function(e,t){const r=h(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}(e,t))}function g(e,t,r){if(e&&null!=t)if((0,u.wk)(e)){const n=e.symbolLayers;n&&n.forEach((e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)}))}else(0,u.$y)(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}},39516:(e,t,r)=>{let n;async function i(){return null==n&&(n=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),n}async function s(e,t){const r=await i(),n=r.get(e,t);if(null==n)throw r.getError(e,t);return n}function o(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>s,IW:()=>a,mA:()=>o})},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var n=r(90237),i=r(66552),s=r(53966),o=r(10107),a=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),p="percent-of-total",c="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&p||null,t&&r&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==p||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n._)([(0,o.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,n._)([(0,a.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,n._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},41560:(e,t,r)=>{r.d(t,{Ch:()=>o,mW:()=>s});var n=r(34727),i=r(39516);function s(e,t){return{...t,filterMode:e.mode}}function o(e,t,r){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],p(r)),t[1]=Math.min(t[1],c(n));return t}(e);if(s&&((0,n.gg)(t,s[0])||(0,n.ZH)(r,s[1])))return"";const o=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=p(e.at(0)?.minScale),s=c(e.at(-1)?.maxScale);if((0,n.ZH)(i,t)||(0,n.gg)(s,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,n.ZH)(p(i.minScale),c(r.maxScale)))return!0}return!1}(o,t,r)?"1=1":o.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)l(n.minScale,n.maxScale,t,r)&&(yield n)}}function l(e,t,r,i){return e=p(e),r=p(r),t=c(t),!(!(0,n.Sp)(r,e)&&(i??r)>e||(0,n.Hx)(t,r)||void 0!==i&&(0,n.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function p(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},59929:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ee});var n=r(90237),i=r(69540),s=r(5503),o=r(49186),a=r(81583),l=r(92071),u=r(74887),p=r(36708),c=r(39516),d=r(84952),y=r(10107),h=(r(44208),r(53966)),f=(r(87811),r(36005)),m=r(40608),b=r(4146),g=r(52136),w=r(18768),v=r(63074),M=r(69208),_=r(6455),I=r(47685),F=r(87796),A=r(16131),x=r(8303),T=r(54310),S=r(25036),k=r(82935),C=r(60694),E=r(10873),Z=r(15426),j=r(17036),O=r(30524),P=r(85334),L=r(90360),$=r(86162),q=r(92438),R=r(96576),z=r(93618),N=r(62046),U=r(37531);const V={key:"type",base:q.A,errorContext:"renderer",typeMap:{simple:R.A,"unique-value":z.A,"class-breaks":$.A}},G=(0,L.C)({types:V}),D=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];var H=r(13874),Q=r(4902),B=r(4718),K=r(92474),W=r(97768),X=r(93637),J=r(43937),Y=r(89317),ee=r(38141),te=r(16930),re=r(29005),ne=r(46499),ie=r(39383),se=r(17311),oe=r(61956),ae=r(30291),le=r(59868),ue=r(85360);const pe=(0,j.p)();let ce=0;function de(e,t){let r=e.json.write;return"object"!=typeof r&&(r=e.json.write={}),r.ignoreOrigin=!0,t?.spatialOnly&&(r.layerContainerTypes=Y.K),e}function ye(e){const t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),"object"==typeof t.write&&(e?.spatialOnly&&(t.write.layerContainerTypes=Y.K),e?.target&&(t.write.target=e.target)),t}function he(e){switch(e){case"point":case"multipoint":return le.UK.clone();case"polyline":return le.A7.clone();case"polygon":case"multipatch":return le.Cx.clone();default:return null}}function fe(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function me(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},i=fe(e,t);if(null!=i){const{defaultValues:e}=i;for(const t in e)n[t]=e[t]}return n[t.subtypeField]=e,new re.A({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}let be=class extends((0,l.P)(i.A.ClonableMixin(Q.A.IdentifiableMixin(K.A)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ce++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return(0,O.yp)(this.renderer,this.fieldsIndex),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,W.pR)(e),new se.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,displayField:this.parent?.displayField??"",fields:this.fields,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}get featureTitleFields(){return[...this._titleCreator.requiredFields]}writeFieldOverrides(e,t,r){const{fields:n,parent:i}=this;let s;if(n){s=[];let e=0;n.forEach((({name:t,alias:r,editable:n,visible:o})=>{if(!o)return;const a=i?.fields?.find((e=>e.name===t));if(!a)return;const l={name:t};let u=!1;r!==a.alias&&(l.alias=r,u=!0),n!==a.editable&&(l.editable=n,u=!0),s.push(l),u&&e++})),0===e&&s.length===n.length&&(s=null)}else s=(0,B.o8)(e);s?.length&&(0,X.sM)(r,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e?.fields;if(!e||!n?.length)return null;const{subtypes:i,subtypeField:s}=e,o=i?.find((e=>e.code===r)),a=o?.defaultValues,l=o?.domains,u=[];for(const e of n){const n=e.clone(),{name:i}=n,o=t?.find((e=>e.name===i));if(n.visible=!t||!!o,o){const{alias:e,editable:t}=o;e&&(n.alias=e),!1===t&&(n.editable=!1)}const p=a?.[i]??null;n.defaultValue=i===s?r:p;const c=l?.[i]??null;n.domain=i===s?null:c?"inherited"===c.type?n.domain:c.clone():null,u.push(n)}return u}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?this.parent.globalIdField:(h.A.getLogger(this).error(ve("globalIdField")),null)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||h.A.getLogger(this).error(ve("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){(0,O.yp)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new R.A({symbol:he(e)})}(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const n=t.drawingInfo?.renderer,i=G(n,t,r);let s;const{subtypeCode:o}=this;if(null!=o&&function(e,t){return!(!t||"unique-value"!==e?.type||null==e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(i,t.subtypeField)){const e=i.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(o)));e&&(s=new R.A({symbol:e.symbol}))}else"simple"!==i?.type||i.visualVariables?.length||(s=i);return s}readRenderer(e,t,r){const n=t?.layerDefinition?.drawingInfo?.renderer;if(!n)return;const i=n.visualVariables?.some((e=>"rotationInfo"!==e.type));return i?void 0:G(n,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??te.A.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[me(this.subtypeCode,t)]}readTitleFromService(e,t){const r=fe(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw ve("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw ve("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw ve("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw ve("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:i}=this;if(r){const{displayField:e,editFieldsInfo:s,objectIdField:o}=r;t={displayField:e,editFieldsInfo:s,fields:n,objectIdField:o,title:i}}return(0,ae.tn)(t,e)}createQuery(){if(!this.parent)throw ve("createQuery");const e=(0,Z.VZ)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,c.mA)(t,this.parent.definitionExpression),e}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const t=(0,Z.pc)(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw ve("queryAttachments");const n=e.clone();return n.where=we(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw ve("queryFeatureCount");return r.parent.queryFeatureCount(ge(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw ve("queryFeatures");return r.parent.queryFeatures(ge(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw ve("queryObjectIds");return r.parent.queryObjectIds(ge(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw ve("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw ve("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],be.prototype,"_titleCreator",null),(0,n._)([(0,y.MZ)({type:ue.A,json:ye({name:"attributeTableInfo"})})],be.prototype,"attributeTableTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"capabilities",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"effectiveCapabilities",null),(0,n._)([(0,y.MZ)({json:ye()})],be.prototype,"charts",void 0),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:ye({name:"enableEditing"})})],be.prototype,"editingEnabled",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],be.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"elevationInfo",null),(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],be.prototype,"featureTitleFields",null),(0,n._)([(0,y.MZ)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],be.prototype,"fieldOverrides",void 0),(0,n._)([(0,J.K)("fieldOverrides")],be.prototype,"writeFieldOverrides",null),(0,n._)([(0,y.MZ)({...pe.fields,readOnly:!0,json:{read:!1}})],be.prototype,"fields",null),(0,n._)([(0,y.MZ)(pe.fieldsIndex)],be.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"floorInfo",null),(0,n._)([(0,y.MZ)({type:ee.A,json:ye({name:"formInfo"})})],be.prototype,"formTemplate",void 0),(0,n._)([(0,y.MZ)({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],be.prototype,"id",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"isTable",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"geometryType",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"globalIdField",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"type",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.kF)))],be.prototype,"labelsVisible",void 0),(0,n._)([(0,y.MZ)({type:[ne.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:ie.w},write:{ignoreOrigin:!0,layerContainerTypes:Y.K}}})],be.prototype,"labelingInfo",void 0),(0,n._)([(0,y.MZ)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:Y.K}}})],be.prototype,"layerType",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.fV)))],be.prototype,"legendEnabled",void 0),(0,n._)([(0,y.MZ)({type:["show","hide"]})],be.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(E.hn);return e.json.origins.service.read=!1,de(e,{spatialOnly:!0})})())],be.prototype,"minScale",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(E.hG);return e.json.origins.service.read=!1,de(e,{spatialOnly:!0})})())],be.prototype,"maxScale",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"effectiveScaleRange",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"objectIdField",null),(0,n._)([(0,y.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0,json:ye({spatialOnly:!0})})],be.prototype,"opacity",void 0),(0,n._)([(0,y.MZ)({clonable:!1})],be.prototype,"parent",void 0),(0,n._)([(0,y.MZ)(de((0,B.o8)(E.M6)))],be.prototype,"popupEnabled",void 0),(0,n._)([(0,y.MZ)({type:H.A,json:ye({name:"popupInfo"})})],be.prototype,"popupTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"defaultPopupTemplate",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"relationships",null),(0,n._)([(0,y.MZ)({types:V,json:ye({target:"layerDefinition.drawingInfo.renderer",spatialOnly:!0})})],be.prototype,"renderer",null),(0,n._)([(0,f.w)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],be.prototype,"readRendererFromService",null),(0,n._)([(0,f.w)("renderer",["layerDefinition.drawingInfo.renderer"])],be.prototype,"readRenderer",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"spatialReference",null),(0,n._)([(0,y.MZ)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],be.prototype,"subtypeCode",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"subtypeField",null),(0,n._)([(0,y.MZ)({type:[re.A],json:ye({name:"layerDefinition.templates"})})],be.prototype,"templates",void 0),(0,n._)([(0,f.w)("service","templates",["geometryType","subtypeField","subtypes","type"])],be.prototype,"readTemplatesFromService",null),(0,n._)([(0,y.MZ)({type:String,json:ye()})],be.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["subtypes"])],be.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],be.prototype,"url",null),(0,n._)([(0,y.MZ)({readOnly:!0})],be.prototype,"userHasUpdateItemPrivileges",null),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:ye({name:"visibility",spatialOnly:!0})})],be.prototype,"visible",void 0),be=(0,n._)([(0,m.$)("esri.layers.support.SubtypeSublayer")],be);const ge=(e,t,r)=>{if(!r)return t.createQuery();const n=oe.A.from(r);return n.where=we(n.where,e.subtypeField,t.subtypeCode),n},we=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${r}`,s=e??"";return n.test(s)?s.replace(n,i):(0,c.mA)(i,s)},ve=e=>new o.A(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),Me=be;var _e=r(96184),Ie=r(91908),Fe=r(54218),Ae=r(92935);const xe="SubtypeGroupLayer";function Te(e,t){return new o.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Se(e,t){const r=[];for(const n of e){const e=new Me;e.read(n,t),r.push(e)}return r}const ke=(0,j.p)();let Ce=class extends((0,F.j)((0,_.FJ)((0,I.w6)((0,v.dM)((0,k.e)((0,S.j)((0,T.J)((0,w.b)((0,A.q)((0,x.A)((0,l.P)((0,M.d)((0,g.p)(i.A.ClonableMixin(b.A))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(s.A.ofType(Me)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=(0,u.sg)((async(e,t,n)=>{const{save:i,saveAs:s}=await r.e(5740).then(r.bind(r,33359));switch(e){case Ae.X.SAVE:return i(this,t);case Ae.X.SAVE_AS:return s(this,n,t)}})),this.addHandles((0,p.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p.OH))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.QP).then((async()=>{if(!this.url)throw new o.A("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new o.A("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,Z.VA)(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,Z.C$)(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=(0,d.An)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,d.fj)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,C.yG)(this.url,t):t}async addAttachment(e,t){const r=await(0,Z.Xl)(this,e,t,xe);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const n=await(0,Z.bt)(this,e,t,r,xe);return this.lastEditsEventDate=new Date,n}async applyEdits(e,t){return(0,Z.ct)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.qr)(Promise.all([r.e(364),r.e(8628),r.e(2593),r.e(9062)]).then(r.bind(r,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,Z.VZ)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,c.mA)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await(0,Z.mm)(this,e,t,xe);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return(0,Z.WP)(this,e,xe)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=(0,Z.pc)(this,e);if(t)return t}const r=(0,Z.Nv)(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return(0,a.g)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,Z.lV)(this,e,t,xe)}async queryFeatures(e,t){const r=await this.load(),n=oe.A.from(e)??r.createQuery(),i=n.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),n.outFields=i);const s=await r.source.queryFeatures(n,t);if(s?.features)for(const e of s.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return s}async queryObjectIds(e,t){return(await(0,Z.sg)(this,e,t,xe)).filter(Fe.Et)}async queryFeatureCount(e,t){return(0,Z.Ye)(this,e,t,xe)}async queryExtent(e,t){return(0,Z.B5)(this,e,t,xe)}async queryRelatedFeatures(e,t){return(0,Z.hM)(this,e,t,xe)}async queryRelatedFeaturesCount(e,t){return(0,Z.S2)(this,e,t,xe)}async save(e){return this._debouncedSaveOperations(Ae.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ae.X.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:n,messages:i}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==n)return i?.push(Te(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===n)return i?.push(Te(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(i?.push(new o.A("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,Ie.D)(this,e)}async getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this.displayField&&this.fieldsIndex.has(this.displayField)?e.attributes[this.fieldsIndex.get(this.displayField).name]??"":this.objectIdField&&this.fieldsIndex.has(this.objectIdField)?e.attributes[this.fieldsIndex.get(this.objectIdField).name]??"":""}get featureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new o.A("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,O.sv)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,Z.jp)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"createQueryVersion",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"editingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({...ke.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Ce.prototype,"fields",void 0),(0,n._)([(0,y.MZ)(ke.fieldsIndex)],Ce.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)(E.id)],Ce.prototype,"id",void 0),(0,n._)([(0,y.MZ)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],Ce.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{"web-document":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}},"portal-item":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],Ce.prototype,"operationalLayerType",null),(0,n._)([(0,y.MZ)(ke.outFields)],Ce.prototype,"outFields",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],Ce.prototype,"parsedUrl",null),(0,n._)([(0,y.MZ)({clonable:!1})],Ce.prototype,"source",null),(0,n._)([(0,y.MZ)({type:s.A.ofType(Me),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let n=null;if(this.useUniqueColorsForSublayers){const i=function(e,t){const r=e.drawingInfo?.renderer,n=r?G(r,e,t):null;if("simple"===n?.type)return(0,U.Sx)(n.symbol,null)?n.symbol.clone():null}(t,r);n=i?function(e,t){return(0,P.Iy)(D,e,{offset:!0,shuffle:!0}).reverse().map((e=>{const r=t.clone();return"cim"===r.type?(0,N.Fe)(r,e):(0,U.dt)(r,e),new R.A({symbol:r})}))}(e.length,i):null}const i=e.map((({code:e},i)=>{const s=new Me({subtypeCode:e});s.read(t,r);const o=n?.[i];return o&&s.read({drawingInfo:{renderer:o.toJSON()}},r),s}));return new(s.A.ofType(Me))(i)}}}},read:{source:["layers","tables"],reader(e,t,r){let n;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?n=Se(t.layers,r):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(n=Se(t.tables,r)),new(s.A.ofType(Me))(n)}},write:{ignoreOrigin:!0,writer(e,t,r,n){const i=[];for(const t of e){const e=t.write({},n);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],Ce.prototype,"sublayers",void 0),(0,n._)([(0,y.MZ)()],Ce.prototype,"useUniqueColorsForSublayers",void 0),(0,n._)([(0,y.MZ)({type:_e.A})],Ce.prototype,"timeInfo",void 0),(0,n._)([(0,y.MZ)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],Ce.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["name"])],Ce.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({json:{read:!1}})],Ce.prototype,"type",void 0),(0,n._)([(0,y.MZ)({clonable:!1,readOnly:!0})],Ce.prototype,"featureTitleFields",null),Ce=(0,n._)([(0,m.$)("esri.layers.SubtypeGroupLayer")],Ce);const Ee=Ce},62046:(e,t,r)=>{r.d(t,{Fe:()=>l,Nk:()=>s});var n=r(68197),i=r(93397);function s(e){const t=[];return o((0,i.lW)(e),t),t.length?new n.A((0,i.e6)(t[0])):null}function o(e,t){if(!e)return;let r;r="CIMTextSymbol"===e.type?e.symbol:e;const n="CIMPolygonSymbol"===e.type;if(r?.symbolLayers)for(const e of r.symbolLayers)if(!(e.colorLocked||n&&((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&a(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{o(e.symbol,t)}));break;case"CIMSolidStroke":case"CIMSolidFill":a(t,e.color);break;case"CIMHatchFill":o(e.lineSymbol,t)}}function a(e,t){for(const r of e)if(r.join(".")===t.join("."))return;e.push(t)}function l(e,t,r){t instanceof n.A||(t=new n.A(t));const s=(0,i.lW)(e);s&&u(s,t,r)}function u(e,t,r){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===n?.type;if(n?.symbolLayers)for(const e of n.symbolLayers){if(e.colorLocked)continue;if(s)if(r){const{layersToColor:t}=r;if(((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))&&"fill"===t||(0,i.jn)(e)&&"outline"===t)continue}else if((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))continue;const n=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=n;break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{u(e.symbol,t,r)}));break;case"CIMSolidStroke":case"CIMSolidFill":e.color=n;break;case"CIMHatchFill":u(e.lineSymbol,t,r)}}}},81583:(e,t,r)=>{r.d(t,{L:()=>a,g:()=>o});var n=r(60999),i=r(5503),s=r(92474);async function o(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],o=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?o(...t):i.A.isCollection(t)?t.forEach((e=>o(e))):s.A.isLoadable(t)&&r.push(t))};t(o);let a=null;if(await(0,n.Tj)(r,(async e=>{const t=await(0,n.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||a||(a=t)})),a)throw a.error;return e}},85334:(e,t,r)=>{r.d(t,{$:()=>b,IB:()=>o,Iy:()=>I,N2:()=>g,RH:()=>v,ZD:()=>w});var n=r(68197),i=r(4576),s=r(4718);function o(e){return"r"in e&&"g"in e&&"b"in e}function a(e){return"h"in e&&"s"in e&&"v"in e}function l(e){return"l"in e&&"a"in e&&"b"in e}function u(e){return"l"in e&&"c"in e&&"h"in e}r(34727),r(87317),r(91829);const p=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],c=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function d(e,t){const r=[];let n,i;if(e[0].length!==t.length)throw new Error("dimensions do not match");const s=e.length,o=e[0].length;let a=0;for(n=0;n<s;n++){for(a=0,i=0;i<o;i++)a+=e[n][i]*t[i];r.push(a)}return r}function y(e){const t=[e.r/255,e.g/255,e.b/255].map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4)),r=d(p,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function h(e){const t=d(c,[e.x/100,e.y/100,e.z/100]).map((e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function f(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map((e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function m(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((e=>e>6/29?e**3:3*(6/29)**2*(e-4/29)));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function b(e){return o(e)?e:u(e)?function(e){return h(m(function(e){const t=e.l,r=e.c,n=e.h;return{l:t,a:r*Math.cos(n),b:r*Math.sin(n)}}(e)))}(e):l(e)?function(e){return h(m(e))}(e):function(e){return"x"in e&&"y"in e&&"z"in e}(e)?h(e):a(e)?function(e){const t=(e.h+360)%360/60,r=e.s/100,n=e.v/100*255,i=n*r,s=i*(1-Math.abs(t%2-1));let o;switch(Math.floor(t)){case 0:o={r:i,g:s,b:0};break;case 1:o={r:s,g:i,b:0};break;case 2:o={r:0,g:i,b:s};break;case 3:o={r:0,g:s,b:i};break;case 4:o={r:s,g:0,b:i};break;case 5:case 6:o={r:i,g:0,b:s};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+n-i),o.g=Math.round(o.g+n-i),o.b=Math.round(o.b+n-i),o}(e):e}function g(e){return a(e)?e:function(e){const t=e.r,r=e.g,n=e.b,i=Math.max(t,r,n),s=i-Math.min(t,r,n);let o=i,a=0===s?0:i===t?(r-n)/s%6:i===r?(n-t)/s+2:(t-r)/s+4,l=0===s?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=100/255,{h:a,s:l,v:o}}(b(e))}function w(e){return l(e)?e:function(e){return f(y(e))}(b(e))}function v(e){return u(e)?e:function(e){return function(e){const t=e.l,r=e.a,n=e.b,i=Math.sqrt(r*r+n*n);let s=Math.atan2(n,r);return s=s>0?s:s+2*Math.PI,{l:t,c:i,h:s}}(f(y(e)))}(b(e))}var M,_;function I(e,t,r={}){if(0===e.length||t<=0)return[];if(1===(e=e.map((e=>"string"==typeof e?new n.A(e):e))).length||1===t){const r=[],n=e[0];for(let e=0;e<t;e++)r.push(n.clone());return r}if(r.shuffle&&(e=(0,i.k4)((0,s.o8)(e),r.seed)),e.length>=t){const r=[],n=(e.length-1)/(t-1);for(let i=0;i<t;i++){const t=Math.round(i*n);r.push(e[t].clone())}return r}return function(e,t,r={}){const n=[],s=e.length-1,o=Math.ceil((t-e.length)/s);e:for(let i=0;i<s;i++){const s=e[i],a=e[i+1];for(let i=1;i<=o;i++){const l=i/(o+1);if(n.push(A(s,a,l,r)),n.length+e.length===t)break e}}return[...e.map((e=>e.clone())),...(0,i.k4)(n,r.seed??1)]}(e,t,r)}(_=M||(M={}))[_.Low=160]="Low",_[_.High=225]="High";const F=(e,t)=>{const r=Math.floor(10*t())-5;return Math.min(255,Math.max(0,e+r))};function A(e,t,r,s={}){const o=e.r,a=e.g,l=e.b,u=t.r,p=t.g,c=t.b,d=Math.round(o+(u-o)*r),y=Math.round(a+(p-a)*r),h=Math.round(l+(c-l)*r);if(!s.offset)return new n.A([d,y,h]);const f=(0,i.Mo)(s.seed);return new n.A([F(d,f),F(y,f),F(h,f)])}},92935:(e,t,r)=>{var n;r.d(t,{X:()=>n}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(n||(n={}))}}]);
|