@arcgis/core 4.33.0-next.20250509 → 4.33.0-next.20250511

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.
Files changed (67) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/06eb4832b6c86744e52e.js +1 -0
  4. package/assets/esri/core/workers/chunks/170c346cf5a18adb25b0.js +1 -0
  5. package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +1 -0
  6. package/assets/esri/core/workers/chunks/{d874d24568b1acedebc4.js → 297d2c0a9d3f1e978318.js} +1 -1
  7. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +1 -0
  8. package/assets/esri/core/workers/chunks/{b1035bf4a016b1199236.js → 83d6a1b3db7d364d156b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7ed9a9c33a08ebba5570.js → 92cbe9af8a6c061bfb57.js} +1 -1
  10. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +1 -0
  11. package/assets/esri/core/workers/chunks/{61c74a733718d667b071.js → d551f70560a2b1ef5696.js} +1 -1
  12. package/assets/esri/core/workers/chunks/f6a1fec33b0d81acce61.js +1 -0
  13. package/core/has.js +1 -1
  14. package/core/sql/StandardizedFunctions.js +1 -1
  15. package/core/sql/WhereGrammar.js +1 -1
  16. package/geometry/support/meshUtils/External.js +1 -1
  17. package/geometry/support/meshUtils/loadExternal.js +1 -1
  18. package/interfaces.d.ts +340 -14
  19. package/layers/SceneLayer.js +1 -1
  20. package/layers/VideoLayer.js +1 -1
  21. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  22. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  23. package/layers/video/VideoController.js +1 -1
  24. package/package.json +1 -1
  25. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  26. package/rest/support/meshFeatureSet.js +1 -1
  27. package/smartMapping/renderers/size.js +1 -1
  28. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  29. package/support/revision.js +1 -1
  30. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  31. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  32. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  33. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  34. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  35. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  36. package/views/3d/layers/I3SMeshView3D.js +1 -1
  37. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  38. package/views/3d/layers/SceneLayerView3D.js +1 -1
  39. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  40. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  41. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  42. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  43. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  44. package/views/3d/layers/i3s/I3SQueryResultGeometry.js +5 -0
  45. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  46. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  47. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  48. package/views/interactive/keybindings.js +1 -1
  49. package/webdoc/IPSInfo.js +1 -1
  50. package/webdoc/ips/AppleIPSProperties.d.ts +4 -0
  51. package/webdoc/ips/AppleIPSProperties.js +5 -0
  52. package/webdoc/ips/Configuration.d.ts +4 -0
  53. package/webdoc/ips/Configuration.js +5 -0
  54. package/webdoc/ips/GNSSProperties.d.ts +4 -0
  55. package/webdoc/ips/GNSSProperties.js +5 -0
  56. package/webdoc/ips/PathSnappingProperties.d.ts +4 -0
  57. package/webdoc/ips/PathSnappingProperties.js +5 -0
  58. package/webdoc/ips/SmoothingProperties.d.ts +4 -0
  59. package/webdoc/ips/SmoothingProperties.js +5 -0
  60. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  61. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  62. package/assets/esri/core/workers/chunks/46104db7f77952bb6c12.js +0 -1
  63. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +0 -1
  64. package/assets/esri/core/workers/chunks/49f0e53b3c9ba8451442.js +0 -1
  65. package/assets/esri/core/workers/chunks/5371df31553626528c69.js +0 -1
  66. package/assets/esri/core/workers/chunks/ad9bcd9dae45cdf90cbb.js +0 -1
  67. package/assets/esri/core/workers/chunks/c28d4717ed588c0d8bf1.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8368],{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)}}},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 p=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(p+="."+s.toString().padStart(3,"0"));const m=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+p+m)}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=>p(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>p(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=m(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=>m(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 p(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 m(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)}},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),p=n(3330),m=n(96285);const h=/^(\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]+)$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,y=/^(\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})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function N(e,t){if(t instanceof m.bo)return t===p.GB.instance?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return m.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t})}}function O(e){return c.isInterval(e)}function S(e){return m.c9.isDateTime(e)}function E(e){return i.n.isDateOnly(e)}function x(e){return d.k.isTimeOnly(e)}function C(e){return f.g.isTimestampOffset(e)}function Z(e){let t=h.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=g.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=m.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,p.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=y.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,p=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===p.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return p}if(r=L.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=T.exec(e),null!==r){const[,e,n,a,i,s]=r,u=m.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,p.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=I.exec(e),null!==r){const[,e,n,a]=r,i=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,p.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function _(e,t){const n=I.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 D=n(34727),P=n(799),b=n(54218);function F(e){return!!S(e)||!!C(e)}function A(e){return!!(S(e)||E(e)||C(e)||x(e))}function R(e){if(S(e))return e.toMillis();if(E(e))return e.toNumber();if(C(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function $(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(A(t))throw new o.L8(o.Z7.InvalidOperator);if(E(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(S(t))throw new o.L8(o.Z7.InvalidOperator);if(E(t))throw new o.L8(o.Z7.InvalidOperator);if(x(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if(S(e)){if(F(t)){if((0,p.Y4)(e.zone)){if(m.c9.isDateTime(t)&&!(0,p.Y4)(t.zone))return V(e,t,n);if(f.g.isTimestampOffset(t))return V(e,t,n)}else if(m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)){if(!(0,p.Y4)(e.zone))return V(e,t,n);if(f.g.isTimestampOffset(e))return V(e,t,n)}return U(R(e),R(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(E(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(x(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(E(e)){if(C(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(S(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(E(t))return U(e.toNumber(),t.toNumber(),n);if(x(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(x(e)){if(x(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(E(t))throw new o.L8(o.Z7.InvalidOperator);if(F(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(F(t))return m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)?V(e,t,n):U(R(e),R(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(E(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(x(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 V(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=k(e),a=k(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 k(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=K[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)||E(e)||S(e)||x(e)||C(e))}function H(e){return E(e)||x(e)?e.toString():C(e)?e.toSQLValue():S(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,b.$P)(e)?H(m.c9.fromJSDate(e)):e.toString()}const K={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(S(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(E(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(x(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(C(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,P.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,D.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=>$(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(S(e))return d.k.fromDateTime(e);if(E(e))throw new o.L8(o.Z7.CannotCastValue);if(x(e))return e;if(C(e))return d.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return Z(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(S(e))return i.n.fromParts(e.year,e.month,e.day);if(E(e))return e;if(x(e))throw new o.L8(o.Z7.CannotCastValue);if(C(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 N(e,t);if(S(e))return e;if(E(e))return e.toDateTimeLuxon("unknown");if(x(e))throw new o.L8(o.Z7.CannotCastValue);if(C(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 Y(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(O(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(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(S(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(E(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(O(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(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(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(C(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(S(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(x(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(O(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(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(S(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(O(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(O(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(x(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(E(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.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(S(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(S(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(O(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(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(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(C(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(S(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(C(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(O(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(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(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(C(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(S(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(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(x(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(E(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(S(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)}class Q extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let n=null;const r=e.find((e=>e.source===this.location.source));r&&(n=r.text.split(/\r\n|\n|\r/g));const 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(n){const e=this.location.end,r="".padEnd(i.line.toString().length," "),s=n[a.line-1],u=(a.line===e.line?e.column:s.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+r+" |\n"+i.line+" | "+s+"\n"+r+" | "+"".padEnd(a.column-1," ")+"".padEnd(u,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function a(e){return r?e.replace(r,(e=>"\\u{"+n(e)+"}")):e}function i(e){return a(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,(e=>"\\x0"+n(e))).replace(/[\x10-\x1F\x7F-\x9F]/g,(e=>"\\x"+n(e))))}function o(e){return a(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,(e=>"\\x0"+n(e))).replace(/[\x10-\x1F\x7F-\x9F]/g,(e=>"\\x"+n(e))))}const s={literal:e=>'"'+i(e.text)+'"',class(e){const t=e.parts.map((e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function u(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(u);if(t.sort(),t.length>0){let e=1;for(let n=1;n<t.length;n++)t[n-1]!==t[n]&&(t[e]=t[n],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."}}function B(e,t){const n={},r=(t=void 0!==t?t:{}).grammarSource,a={start:vn};let i=vn;const o="!",s="=",u=">=",l=">",c="<=",f="<>",d="!=",p="||",m="@",h="'",v="N'",w="''",I=".",g="null",y="true",L="false",T="in",N="is",O="like",S="escape",E="not",x="and",C="or",Z="between",M="from",_="for",D="substring",P="extract",b="trim",F="position",A="timestamp",R="date",$="time",U="leading",V="trailing",k="both",z="cast",q="as",H="integer",K="int",Y="smallint",j="float",B="real",G="varchar",J="to",W="interval",X="year",ee="timezone_hour",te="timezone_minute",ne="month",re="day",ae="hour",ie="minute",oe="second",se="case",ue="end",le="when",ce="then",fe="else",de=",",pe="(",me=")",he="`",ve=/^[<-=]/,we=/^[+\-]/,Ie=/^[*\/]/,ge=/^[A-Za-z_\x80-\uFFFF]/,ye=/^[A-Za-z0-9_]/,Le=/^[A-Za-z0-9_.\x80-\uFFFF]/,Te=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Se=/^[eE]/,Ee=/^[ \t\n\r]/,xe=/^[^`]/,Ce=cn("!",!1),Ze=cn("=",!1),Me=cn(">=",!1),_e=cn(">",!1),De=cn("<=",!1),Pe=cn("<>",!1),be=fn([["<","="]],!1,!1,!1),Fe=cn("!=",!1),Ae=fn(["+","-"],!1,!1,!1),Re=cn("||",!1),$e=fn(["*","/"],!1,!1,!1),Ue=fn([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1,!1),Ve=fn([["A","Z"],["a","z"],["0","9"],"_"],!1,!1,!1),ke=fn([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1,!1),ze=fn(['"'],!1,!1,!1),qe=cn("@",!1),He=cn("'",!1),Ke=cn("N'",!1),Ye=cn("''",!1),je=fn(["'"],!0,!1,!1),Qe=cn(".",!1),Be=fn([["0","9"]],!1,!1,!1),Ge=fn(["e","E"],!1,!1,!1),Je=cn("NULL",!0),We=cn("TRUE",!0),Xe=cn("FALSE",!0),et=cn("IN",!0),tt=cn("IS",!0),nt=cn("LIKE",!0),rt=cn("ESCAPE",!0),at=cn("NOT",!0),it=cn("AND",!0),ot=cn("OR",!0),st=cn("BETWEEN",!0),ut=cn("FROM",!0),lt=cn("FOR",!0),ct=cn("SUBSTRING",!0),ft=cn("EXTRACT",!0),dt=cn("TRIM",!0),pt=cn("POSITION",!0),mt=cn("TIMESTAMP",!0),ht=cn("DATE",!0),vt=cn("TIME",!0),wt=cn("LEADING",!0),It=cn("TRAILING",!0),gt=cn("BOTH",!0),yt=cn("CAST",!0),Lt=cn("AS",!0),Tt=cn("INTEGER",!0),Nt=cn("INT",!0),Ot=cn("SMALLINT",!0),St=cn("FLOAT",!0),Et=cn("REAL",!0),xt=cn("VARCHAR",!0),Ct=cn("TO",!0),Zt=cn("INTERVAL",!0),Mt=cn("YEAR",!0),_t=cn("TIMEZONE_HOUR",!0),Dt=cn("TIMEZONE_MINUTE",!0),Pt=cn("MONTH",!0),bt=cn("DAY",!0),Ft=cn("HOUR",!0),At=cn("MINUTE",!0),Rt=cn("SECOND",!0),$t=cn("CASE",!0),Ut=cn("END",!0),Vt=cn("WHEN",!0),kt=cn("THEN",!0),zt=cn("ELSE",!0),qt=cn(",",!1),Ht=cn("(",!1),Kt=cn(")",!1),Yt=fn([" ","\t","\n","\r"],!1,!1,!1),jt=cn("`",!1),Qt=fn(["`"],!0,!1,!1);function Bt(e,t,n){return{op:t,expr:n,location:un()}}function Gt(e,t,n){return{op:t,expr:n,location:un()}}function Jt(e,t){return{op:e,expr:t,location:un()}}function Wt(e,t,n){return{op:t,expr:n,location:un()}}function Xt(e,t,n){return{op:t,expr:n,location:un()}}let en=0|t.peg$currPos,tn=en;const nn=[{line:1,column:1}];let rn,an=en,on=t.peg$maxFailExpected||[],sn=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');i=a[t.startRule]}function un(){return pn(tn,en)}function ln(e,t){throw hn(e,t=void 0!==t?t:pn(tn,en))}function cn(e,t){return{type:"literal",text:e,ignoreCase:t}}function fn(e,t,n,r){return{type:"class",parts:e,inverted:t,ignoreCase:n,unicode:r}}function dn(t){let n,r=nn[t];if(r)return r;if(t>=nn.length)n=nn.length-1;else for(n=t;!nn[--n];);for(r=nn[n],r={line:r.line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return nn[t]=r,r}function pn(e,t,n){const a=dn(e),i=dn(t);return{source:r,start:{offset:e,line:a.line,column:a.column},end:{offset:t,line:i.line,column:i.column}}}function mn(e){en<an||(en>an&&(an=en,on=[]),on.push(e))}function hn(e,t){return new Q(e,null,null,t)}function vn(){let e,t;return e=en,Gr(),t=In(),t!==n?(Gr(),tn=e,e=t):(en=e,e=n),e}function wn(){let e,t,r,a,i,o,s,u;if(e=en,t=Qr(),t!==n){for(Gr(),r=[],a=In();a!==n;)r.push(a),a=en,i=en,o=Gr(),s=jr(),s!==n?(u=Gr(),o=[o,s,u],i=o):(en=i,i=n),i!==n?(i=In(),i===n?(en=a,a=n):a=i):a=i;a=Gr(),i=Br(),i!==n?(tn=e,e=function(e){return{type:"expression-list",location:un(),value:e}}(r)):(en=e,e=n)}else en=e,e=n;return e}function In(){let e,t,r,a,i,o;if(e=en,t=gn(),t!==n){for(r=[],a=en,Gr(),i=cr(),i!==n?(Gr(),o=gn(),o!==n?(tn=a,a=Bt(0,i,o)):(en=a,a=n)):(en=a,a=n);a!==n;)r.push(a),a=en,Gr(),i=cr(),i!==n?(Gr(),o=gn(),o!==n?(tn=a,a=Bt(0,i,o)):(en=a,a=n)):(en=a,a=n);tn=e,e=function(e,t){return ta(e,t)}(t,r)}else en=e,e=n;return e}function gn(){let e,t,r,a,i,o;if(e=en,t=yn(),t!==n){for(r=[],a=en,Gr(),i=lr(),i!==n?(Gr(),o=yn(),o!==n?(tn=a,a=Gt(0,i,o)):(en=a,a=n)):(en=a,a=n);a!==n;)r.push(a),a=en,Gr(),i=lr(),i!==n?(Gr(),o=yn(),o!==n?(tn=a,a=Gt(0,i,o)):(en=a,a=n)):(en=a,a=n);tn=e,e=function(e,t){return ta(e,t)}(t,r)}else en=e,e=n;return e}function yn(){let t,r,a,i,u;return t=en,r=ur(),r===n&&(r=en,33===e.charCodeAt(en)?(a=o,en++):(a=n,0===sn&&mn(Ce)),a!==n?(i=en,sn++,61===e.charCodeAt(en)?(u=s,en++):(u=n,0===sn&&mn(Ze)),sn--,u===n?i=void 0:(en=i,i=n),i!==n?(a=[a,i],r=a):(en=r,r=n)):(en=r,r=n)),r!==n?(a=Gr(),i=yn(),i!==n?(tn=t,t=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,un())}(i)):(en=t,t=n)):(en=t,t=n),t===n&&(t=function(){let e,t,r,a;return e=en,t=On(),t!==n?(r=en,Gr(),a=function(){let e;return e=function(){let e,t,r,a,i;if(e=en,t=[],r=en,Gr(),a=Ln(),a!==n?(Gr(),i=On(),i!==n?(tn=r,r=Jt(a,i)):(en=r,r=n)):(en=r,r=n),r!==n)for(;r!==n;)t.push(r),r=en,Gr(),a=Ln(),a!==n?(Gr(),i=On(),i!==n?(tn=r,r=Jt(a,i)):(en=r,r=n)):(en=r,r=n);else t=n;return t!==n&&(tn=e,t=function(e){return{type:"arithmetic",tail:e}}(t)),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=en,t=Nn(),t!==n?(Gr(),r=wn(),r!==n?(tn=e,e=function(e,t){return{op:e,right:t}}(t,r)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=Nn(),t!==n?(Gr(),r=Fn(),r!==n?(tn=e,e=function(e,t){return{op:e,right:t}}(t,r)):(en=e,e=n)):(en=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u;return e=en,t=ur(),t!==n?(Gr(),r=fr(),r!==n?(a=Gr(),i=en,o=On(),o!==n?(Gr(),s=lr(),s!==n?(Gr(),u=On(),u!==n?(tn=i,i=function(e,t,n){return ea(un(),t,n)}(0,o,u)):(en=i,i=n)):(en=i,i=n)):(en=i,i=n),i!==n?(tn=e,e=function(e,t){return{op:"NOT"+e,right:t}}(r,i)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=fr(),t!==n?(Gr(),r=en,a=On(),a!==n?(i=Gr(),o=lr(),o!==n?(Gr(),s=On(),s!==n?(tn=r,r=function(e,t,n){return ea(un(),t,n)}(0,a,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r!==n?(tn=e,e=function(e,t){return{op:e,right:t}}(t,r)):(en=e,e=n)):(en=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a;return e=en,t=ir(),t!==n?(Gr(),r=ur(),r!==n?(Gr(),a=On(),a!==n?(tn=e,e=function(e,t){return{op:e+"NOT",right:t}}(t,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=ir(),t!==n?(Gr(),r=On(),r!==n?(tn=e,e=function(e,t){return{op:e,right:t}}(t,r)):(en=e,e=n)):(en=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,i;return e=en,t=Tn(),t!==n?(Gr(),r=Hn(),r!==n?(Gr(),a=sr(),a!==n?(Gr(),i=Kn(),i!==n?(tn=e,e=function(e,t,n){return{op:e,right:t,escape:n.value}}(t,r,i)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=Tn(),t!==n?(Gr(),r=Hn(),r!==n?(tn=e,e=function(e,t){return{op:e,right:t,escape:""}}(t,r)):(en=e,e=n)):(en=e,e=n)),e}())))),e}(),a!==n?r=a:(en=r,r=n),r===n&&(r=null),tn=e,e=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?ta(e,t.tail):Xr(t.op,e,t.right,t.escape,un())}(t,r)):(en=e,e=n),e}()),t}function Ln(){let t;return e.substr(en,2)===u?(t=u,en+=2):(t=n,0===sn&&mn(Me)),t===n&&(62===e.charCodeAt(en)?(t=l,en++):(t=n,0===sn&&mn(_e)),t===n&&(e.substr(en,2)===c?(t=c,en+=2):(t=n,0===sn&&mn(De)),t===n&&(e.substr(en,2)===f?(t=f,en+=2):(t=n,0===sn&&mn(Pe)),t===n&&(t=e.charAt(en),ve.test(t)?en++:(t=n,0===sn&&mn(be)),t===n&&(e.substr(en,2)===d?(t=d,en+=2):(t=n,0===sn&&mn(Fe))))))),t}function Tn(){let e,t,r,a,i;return e=en,t=en,r=ur(),r!==n?(a=Gr(),i=or(),i!==n?(r=[r,a,i],t=r):(en=t,t=n)):(en=t,t=n),t!==n&&(tn=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=or()),e}function Nn(){let e,t,r,a,i;return e=en,t=en,r=ur(),r!==n?(a=Gr(),i=ar(),i!==n?(r=[r,a,i],t=r):(en=t,t=n)):(en=t,t=n),t!==n&&(tn=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=ar()),e}function On(){let e,t,r,a,i,o;if(e=en,t=En(),t!==n){for(r=[],a=en,Gr(),i=Sn(),i!==n?(Gr(),o=En(),o!==n?(tn=a,a=Wt(0,i,o)):(en=a,a=n)):(en=a,a=n);a!==n;)r.push(a),a=en,Gr(),i=Sn(),i!==n?(Gr(),o=En(),o!==n?(tn=a,a=Wt(0,i,o)):(en=a,a=n)):(en=a,a=n);tn=e,e=function(e,t){return ta(e,t)}(t,r)}else en=e,e=n;return e}function Sn(){let t;return t=e.charAt(en),we.test(t)?en++:(t=n,0===sn&&mn(Ae)),t===n&&(e.substr(en,2)===p?(t=p,en+=2):(t=n,0===sn&&mn(Re))),t}function En(){let e,t,r,a,i,o;if(e=en,t=Cn(),t!==n){for(r=[],a=en,Gr(),i=xn(),i!==n?(Gr(),o=Cn(),o!==n?(tn=a,a=Xt(0,i,o)):(en=a,a=n)):(en=a,a=n);a!==n;)r.push(a),a=en,Gr(),i=xn(),i!==n?(Gr(),o=Cn(),o!==n?(tn=a,a=Xt(0,i,o)):(en=a,a=n)):(en=a,a=n);tn=e,e=function(e,t){return ta(e,t)}(t,r)}else en=e,e=n;return e}function xn(){let t;return t=e.charAt(en),Ie.test(t)?en++:(t=n,0===sn&&mn($e)),t}function Cn(){let e,t,r,a;return e=function(){let e;return e=Kn(),e===n&&(e=function(){let e,t,r,a;return e=en,t=function(){let e,t,r,a;return e=en,t=Bn(),t!==n?(r=Gn(),r!==n?(a=Jn(),a!==n?(tn=e,e=function(e,t,n){return parseFloat(e+t+n)}(t,r,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=Bn(),t!==n?(r=Gn(),r!==n?(tn=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=Bn(),t!==n?(r=Jn(),r!==n?(tn=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=Bn(),t!==n&&(tn=e,t=function(e){return parseFloat(e)}(t)),e=t))),e}(),t!==n?(r=en,sn++,a=Mn(),sn--,a===n?r=void 0:(en=r,r=n),r!==n?(tn=e,e=function(e){return{type:"number",location:un(),value:e}}(t)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t;return e=en,t=nr(),t!==n&&(tn=e,t={type:"boolean",location:un(),value:!0}),e=t,e===n&&(e=en,t=rr(),t!==n&&(tn=e,t={type:"boolean",location:un(),value:!1}),e=t),e}(),e===n&&(e=function(){let e,t;return e=en,t=tr(),t!==n&&(tn=e,t={type:"null",location:un(),value:null}),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=en,t=gr(),t!==n?(Gr(),r=Hn(),r!==n?(tn=e,e=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)&&ln("Date literal is invalid")}(e.value),{type:"date",location:un(),value:e.value}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r;return e=en,t=Ir(),t!==n?(Gr(),r=Hn(),r!==n?(tn=e,e=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)&&ln("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:un(),value:e.value}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=Un(),e===n&&(e=function(){let e,t,r;return e=en,t=yr(),t!==n?(Gr(),r=Hn(),r!==n?(tn=e,e=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)&&ln("Time literal is invalid")}(e.value),{type:"time",location:un(),value:e.value}}(r)):(en=e,e=n)):(en=e,e=n),e}()))))))),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u;return e=en,t=hr(),t!==n?(Gr(),r=en,a=Qr(),a!==n?(Gr(),i=$n(),i!==n?(Gr(),o=dr(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r===n&&(r=en,a=Qr(),a!==n?(Gr(),i=$n(),i!==n?(Gr(),o=jr(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)),r!==n?(tn=e,e=function(e){return{type:"function",location:un(),name:"extract",args:e}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u,l,c,f;return e=en,t=mr(),t!==n?(Gr(),r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=dr(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=en,l=pr(),l!==n?(c=Gr(),f=In(),f!==n?(Gr(),u=f):(en=u,u=n)):(en=u,u=n),u===n&&(u=null),l=Br(),l!==n?(tn=r,r=function(e,t,n){return ea(un(),e,t,...n?[n]:[])}(i,s,u)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r===n&&(r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=jr(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=jr(),u!==n?(l=Gr(),c=In(),c!==n?(f=Br(),f!==n?(tn=r,r=function(e,t,n){return ea(un(),e,t,n)}(i,s,c)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)),r!==n?(tn=e,e=function(e){return{type:"function",location:un(),name:"substring",args:e}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u,l;return e=en,t=vr(),t!==n?(Gr(),r=en,a=Qr(),a!==n?(Gr(),i=Rn(),Gr(),o=In(),o!==n?(Gr(),s=dr(),s!==n?(Gr(),u=In(),u!==n?(Gr(),l=Br(),l!==n?(tn=r,r=function(e,t,n){return ea(un(),e,t,n)}(i,o,u)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r===n&&(r=en,a=Qr(),a!==n?(Gr(),i=Rn(),Gr(),o=In(),o!==n?(Gr(),s=Br(),s!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,o)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)),r!==n?(tn=e,e=function(e){return{type:"function",location:un(),name:"trim",args:e}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u;return e=en,t=wr(),t!==n?(Gr(),r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=ar(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r===n&&(r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=jr(),o!==n?(Gr(),s=In(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)),r!==n?(tn=e,e=function(e){return{type:"function",location:un(),name:"position",args:e}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,i,o,s,u;return e=en,t=Or(),t!==n?(Gr(),r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=Sr(),o!==n?(Gr(),s=An(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n),r===n&&(r=en,a=Qr(),a!==n?(Gr(),i=In(),i!==n?(Gr(),o=jr(),o!==n?(Gr(),s=An(),s!==n?(Gr(),u=Br(),u!==n?(tn=r,r=function(e,t){return ea(un(),e,t)}(i,s)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)):(en=r,r=n)),r!==n?(tn=e,e=function(e){return{type:"function",location:un(),name:"cast",args:e}}(r)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a;return e=en,t=en,sn++,r=hr(),sn--,r===n?t=void 0:(en=t,t=n),t!==n?(r=Wr(),r!==n?(Gr(),a=wn(),a!==n?(tn=e,e=function(e,t){return{type:"function",location:un(),name:e,args:t}}(r,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e}(),e===n&&(e=function(){let e;return e=function(){let e,t,r,a,i,o,s;if(e=en,t=zr(),t!==n)if(Gr(),r=In(),r!==n){for(Gr(),a=[],i=en,o=jn(),o!==n?(s=Gr(),i=o):(en=i,i=n);i!==n;)a.push(i),i=en,o=jn(),o!==n?(s=Gr(),i=o):(en=i,i=n);i=qr(),i!==n?(tn=e,e=function(e,t){return{type:"case-expression",location:un(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}}(r,a)):(en=e,e=n)}else en=e,e=n;else en=e,e=n;if(e===n)if(e=en,t=zr(),t!==n)if(Gr(),r=In(),r!==n){for(Gr(),a=[],i=en,o=jn(),o!==n?(s=Gr(),i=o):(en=i,i=n);i!==n;)a.push(i),i=en,o=jn(),o!==n?(s=Gr(),i=o):(en=i,i=n);i=Qn(),i!==n?(o=Gr(),s=qr(),s!==n?(tn=e,e=function(e,t,n){return{type:"case-expression",location:un(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}}(r,a,i)):(en=e,e=n)):(en=e,e=n)}else en=e,e=n;else en=e,e=n;return e}(),e===n&&(e=function(){let e,t,r,a,i,o;if(e=en,t=zr(),t!==n){for(Gr(),r=[],a=en,i=Yn(),i!==n?(o=Gr(),a=i):(en=a,a=n);a!==n;)r.push(a),a=en,i=Yn(),i!==n?(o=Gr(),a=i):(en=a,a=n);a=qr(),a!==n?(tn=e,e=function(e){return{type:"case-expression",location:un(),format:"searched",clauses:e,else:null,elseLocation:null}}(r)):(en=e,e=n)}else en=e,e=n;if(e===n)if(e=en,t=zr(),t!==n){for(Gr(),r=[],a=en,i=Yn(),i!==n?(o=Gr(),a=i):(en=a,a=n);a!==n;)r.push(a),a=en,i=Yn(),i!==n?(o=Gr(),a=i):(en=a,a=n);a=Qn(),a!==n?(i=Gr(),o=qr(),o!==n?(tn=e,e=function(e,t){return{type:"case-expression",location:un(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}}(r,a)):(en=e,e=n)):(en=e,e=n)}else en=e,e=n;return e}()),e}(),e===n&&(e=function(){let e,t;return e=en,t=function(){let e,t;return e=en,t=function(){let e,t,r,a;if(e=en,t=Mn(),t!==n){for(r=[],a=Dn();a!==n;)r.push(a),a=Dn();tn=e,e=function(e,t){return e+t.join("")}(t,r)}else en=e,e=n;return e}(),t!==n&&(tn=e),e=t,e}(),t!==n&&(tn=e,t=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:un(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:un(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:un(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:un()}:{type:"column-reference",location:un(),table:"",column:e}}(t)),e=t,e===n&&(e=en,t=function(){let e,t,r,a;return e=en,t=bn(),t!==n?(r=function(){let e,t,r;for(e=en,t=[],r=Pn();r!==n;)t.push(r),r=Pn();return tn=e,t=function(e){return e.join("")}(t),e=t,e}(),a=bn(),a!==n?(tn=e,e=r):(en=e,e=n)):(en=e,e=n),e}(),t!==n&&(tn=e,t=function(e){return{type:"column-reference",location:un(),table:"",column:e,delimited:!0}}(t)),e=t),e}(),e===n&&(e=Fn(),e===n&&(e=en,t=Qr(),t!==n?(Gr(),r=In(),r!==n?(Gr(),a=Br(),a!==n?(tn=e,e=function(e){return e.paren=!0,e}(r)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n))))))))))),e}function Zn(){let e,t,r,a;if(e=en,t=Mn(),t!==n){for(r=[],a=_n();a!==n;)r.push(a),a=_n();tn=e,e=function(e,t){return e+t.join("")}(t,r)}else en=e,e=n;return e}function Mn(){let t;return t=e.charAt(en),ge.test(t)?en++:(t=n,0===sn&&mn(Ue)),t}function _n(){let t;return t=e.charAt(en),ye.test(t)?en++:(t=n,0===sn&&mn(Ve)),t}function Dn(){let t;return t=e.charAt(en),Le.test(t)?en++:(t=n,0===sn&&mn(ke)),t}function Pn(){let t;return t=function(){let t;return t=e.charAt(en),Le.test(t)?en++:(t=n,0===sn&&mn(ke)),t}(),t===n&&(t=function(){let e,t,r;return e=en,t=bn(),t!==n?(r=bn(),r!==n?(tn=e,e='"'):(en=e,e=n)):(en=e,e=n),e}()),t}function bn(){let t;return t=e.charAt(en),Te.test(t)?en++:(t=n,0===sn&&mn(ze)),t}function Fn(){let t,r,a,i;return t=en,r=en,64===e.charCodeAt(en)?(a=m,en++):(a=n,0===sn&&mn(qe)),a!==n?(i=Zn(),i!==n?(a=[a,i],r=a):(en=r,r=n)):(en=r,r=n),r!==n&&(tn=t,r=function(e){return{type:"parameter",location:un(),value:e[1]}}(r)),t=r,t}function An(){let e,t,r,a,i;return e=en,t=Er(),t===n&&(t=xr()),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"integer"}}),e=t,e===n&&(e=en,t=Cr(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"smallint"}}),e=t,e===n&&(e=en,t=Zr(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"float"}}),e=t,e===n&&(e=en,t=Mr(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"real"}}),e=t,e===n&&(e=en,t=gr(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"date"}}),e=t,e===n&&(e=en,t=Ir(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"timestamp"}}),e=t,e===n&&(e=en,t=yr(),t!==n&&(tn=e,t={type:"data-type",location:un(),value:{type:"time"}}),e=t,e===n&&(e=en,t=_r(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=Wn(),a!==n?(Gr(),i=Br(),i!==n?(tn=e,e=function(e){return{type:"data-type",location:un(),value:{type:"varchar",size:parseInt(e)}}}(a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)))))))),e}function Rn(){let e,t;return e=en,t=Lr(),t===n&&(t=Tr(),t===n&&(t=Nr())),t===n&&(t=null),tn=e,t=function(e){return{type:"string",location:un(),value:e??"BOTH"}}(t),e=t,e}function $n(){let e,t;return e=en,t=br(),t===n&&(t=Rr(),t===n&&(t=$r(),t===n&&(t=Ur(),t===n&&(t=Vr(),t===n&&(t=kr(),t===n&&(t=Fr(),t===n&&(t=Ar()))))))),t!==n&&(tn=e,t=function(e){return{type:"string",location:un(),value:e}}(t)),e=t,e}function Un(){let t,r,a,i,o;return t=en,r=Pr(),r!==n?(Gr(),a=e.charAt(en),we.test(a)?en++:(a=n,0===sn&&mn(Ae)),a!==n?(Gr(),i=Hn(),i!==n?(Gr(),o=Vn(),o!==n?(tn=t,t=function(e,t,n){return{type:"interval",location:un(),value:t,qualifier:n,op:e}}(a,i,o)):(en=t,t=n)):(en=t,t=n)):(en=t,t=n)):(en=t,t=n),t===n&&(t=en,r=Pr(),r!==n?(Gr(),a=Hn(),a!==n?(Gr(),i=Vn(),i!==n?(tn=t,t=function(e,t){return{type:"interval",location:un(),value:e,qualifier:t,op:""}}(a,i)):(en=t,t=n)):(en=t,t=n)):(en=t,t=n)),t}function Vn(){let e,t,r,a;return e=en,t=function(){let e,t,r,a,i;return e=en,t=kn(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=qn(),a!==n?(Gr(),i=Br(),i!==n?(tn=e,e=function(e,t){return{type:"interval-period",location:un(),period:e.value,precision:t,secondary:null}}(t,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kn(),t!==n&&(tn=e,t=function(e){return{type:"interval-period",location:un(),period:e.value,precision:null,secondary:null}}(t)),e=t),e}(),t!==n?(Gr(),r=Dr(),r!==n?(Gr(),a=function(){let e,t,r,a,i,o,s;return e=en,t=kn(),t!==n&&(tn=e,t=function(e){return{type:"interval-period",location:un(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=en,t=kr(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=qn(),a!==n?(Gr(),i=jr(),i!==n?(Gr(),o=zn(),o!==n?(Gr(),s=Br(),s!==n?(tn=e,e=function(e,t){return{type:"interval-period",location:un(),period:"second",precision:e,secondary:t}}(a,o)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kr(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=qn(),a!==n?(Gr(),i=Br(),i!==n?(tn=e,e=function(e){return{type:"interval-period",location:un(),period:"second",precision:e,secondary:null}}(a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kr(),t!==n&&(tn=e,t={type:"interval-period",location:un(),period:"second",precision:null,secondary:null}),e=t))),e}(),a!==n?(tn=e,e=function(e,t){return{type:"interval-qualifier",location:un(),start:e,end:t}}(t,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=function(){let e,t,r,a,i,o,s;return e=en,t=kn(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=zn(),a!==n?(Gr(),i=Br(),i!==n?(tn=e,e=function(e,t){return{type:"interval-period",location:un(),period:e.value,precision:t,secondary:null}}(t,a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kn(),t!==n&&(tn=e,t=function(e){return{type:"interval-period",location:un(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=en,t=kr(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=qn(),a!==n?(Gr(),i=jr(),i!==n?(Gr(),o=zn(),o!==n?(Gr(),s=Br(),s!==n?(tn=e,e=function(e,t){return{type:"interval-period",location:un(),period:"second",precision:e,secondary:t}}(a,o)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kr(),t!==n?(Gr(),r=Qr(),r!==n?(Gr(),a=zn(),a!==n?(Gr(),i=Br(),i!==n?(tn=e,e=function(e){return{type:"interval-period",location:un(),period:"second",precision:e,secondary:null}}(a)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e===n&&(e=en,t=kr(),t!==n&&(tn=e,t={type:"interval-period",location:un(),period:"second",precision:null,secondary:null}),e=t)))),e}()),e}function kn(){let e,t;return e=en,t=$r(),t!==n&&(tn=e,t={type:"string",location:un(),value:"day"}),e=t,e===n&&(e=en,t=Ur(),t!==n&&(tn=e,t={type:"string",location:un(),value:"hour"}),e=t,e===n&&(e=en,t=Vr(),t!==n&&(tn=e,t={type:"string",location:un(),value:"minute"}),e=t,e===n&&(e=en,t=Rr(),t!==n&&(tn=e,t={type:"string",location:un(),value:"month"}),e=t,e===n&&(e=en,t=br(),t!==n&&(tn=e,t={type:"string",location:un(),value:"year"}),e=t)))),e}function zn(){let e,t;return e=en,t=Wn(),t!==n&&(tn=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function qn(){let e,t;return e=en,t=Wn(),t!==n&&(tn=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function Hn(){let e;return e=Kn(),e===n&&(e=Fn()),e}function Kn(){let t,r,a,i,o;if(t=en,39===e.charCodeAt(en)?(r=h,en++):(r=n,0===sn&&mn(He)),r===n&&(e.substr(en,2)===v?(r=v,en+=2):(r=n,0===sn&&mn(Ke))),r!==n){for(a=[],i=en,e.substr(en,2)===w?(o=w,en+=2):(o=n,0===sn&&mn(Ye)),o!==n&&(tn=i,o="'"),i=o,i===n&&(i=e.charAt(en),Ne.test(i)?en++:(i=n,0===sn&&mn(je)));i!==n;)a.push(i),i=en,e.substr(en,2)===w?(o=w,en+=2):(o=n,0===sn&&mn(Ye)),o!==n&&(tn=i,o="'"),i=o,i===n&&(i=e.charAt(en),Ne.test(i)?en++:(i=n,0===sn&&mn(je)));39===e.charCodeAt(en)?(i=h,en++):(i=n,0===sn&&mn(He)),i!==n?(tn=t,t=function(e){return{type:"string",location:un(),value:e.join("")}}(a)):(en=t,t=n)}else en=t,t=n;return t}function Yn(){let e,t,r,a,i;return e=en,t=Hr(),t!==n?(Gr(),r=In(),r!==n?(Gr(),a=Kr(),a!==n?(Gr(),i=In(),i!==n?(tn=e,e=function(e,t){return{type:"when-clause",location:un(),operand:e,value:t}}(r,i)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e}function jn(){let e,t,r,a,i;return e=en,t=Hr(),t!==n?(Gr(),r=In(),r!==n?(Gr(),a=Kr(),a!==n?(Gr(),i=In(),i!==n?(tn=e,e=function(e,t){return{type:"when-clause",location:un(),operand:e,value:t}}(r,i)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n)):(en=e,e=n),e}function Qn(){let e,t,r;return e=en,t=Yr(),t!==n?(Gr(),r=In(),r!==n?(tn=e,e=function(e){return{type:"else-clause",location:un(),value:e}}(r)):(en=e,e=n)):(en=e,e=n),e}function Bn(){let t,r,a;return t=Wn(),t===n&&(t=en,r=e.charAt(en),we.test(r)?en++:(r=n,0===sn&&mn(Ae)),r!==n?(a=Wn(),a!==n?(tn=t,t=function(e,t){return e[0]+t}(r,a)):(en=t,t=n)):(en=t,t=n)),t}function Gn(){let t,r,a;return t=en,46===e.charCodeAt(en)?(r=I,en++):(r=n,0===sn&&mn(Qe)),r!==n?(a=Wn(),a===n&&(a=null),tn=t,t=function(e){return"."+(null!=e?e:"")}(a)):(en=t,t=n),t}function Jn(){let e,t,r;return e=en,t=er(),t!==n?(r=Wn(),r!==n?(tn=e,e=function(e,t){return e+t}(t,r)):(en=e,e=n)):(en=e,e=n),e}function Wn(){let e,t,r;if(e=en,t=[],r=Xn(),r!==n)for(;r!==n;)t.push(r),r=Xn();else t=n;return t!==n&&(tn=e,t=function(e){return e.join("")}(t)),e=t,e}function Xn(){let t;return t=e.charAt(en),Oe.test(t)?en++:(t=n,0===sn&&mn(Be)),t}function er(){let t,r,a;return t=en,r=e.charAt(en),Se.test(r)?en++:(r=n,0===sn&&mn(Ge)),r!==n?(a=e.charAt(en),we.test(a)?en++:(a=n,0===sn&&mn(Ae)),a===n&&(a=null),tn=t,t=function(e,t){return"e"+(null===t?"":t)}(0,a)):(en=t,t=n),t}function tr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===g?en+=4:(r=n,0===sn&&mn(Je)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(r=[r,a],t=r):(en=t,t=n)):(en=t,t=n),t}function nr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===y?en+=4:(r=n,0===sn&&mn(We)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(r=[r,a],t=r):(en=t,t=n)):(en=t,t=n),t}function rr(){let t,r,a,i;return t=en,r=e.substr(en,5),r.toLowerCase()===L?en+=5:(r=n,0===sn&&mn(Xe)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(r=[r,a],t=r):(en=t,t=n)):(en=t,t=n),t}function ar(){let t,r,a,i;return t=en,r=e.substr(en,2),r.toLowerCase()===T?en+=2:(r=n,0===sn&&mn(et)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="IN"):(en=t,t=n)):(en=t,t=n),t}function ir(){let t,r,a,i;return t=en,r=e.substr(en,2),r.toLowerCase()===N?en+=2:(r=n,0===sn&&mn(tt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="IS"):(en=t,t=n)):(en=t,t=n),t}function or(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===O?en+=4:(r=n,0===sn&&mn(nt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="LIKE"):(en=t,t=n)):(en=t,t=n),t}function sr(){let t,r,a,i;return t=en,r=e.substr(en,6),r.toLowerCase()===S?en+=6:(r=n,0===sn&&mn(rt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="ESCAPE"):(en=t,t=n)):(en=t,t=n),t}function ur(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===E?en+=3:(r=n,0===sn&&mn(at)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="NOT"):(en=t,t=n)):(en=t,t=n),t}function lr(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===x?en+=3:(r=n,0===sn&&mn(it)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="AND"):(en=t,t=n)):(en=t,t=n),t}function cr(){let t,r,a,i;return t=en,r=e.substr(en,2),r.toLowerCase()===C?en+=2:(r=n,0===sn&&mn(ot)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="OR"):(en=t,t=n)):(en=t,t=n),t}function fr(){let t,r,a,i;return t=en,r=e.substr(en,7),r.toLowerCase()===Z?en+=7:(r=n,0===sn&&mn(st)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="BETWEEN"):(en=t,t=n)):(en=t,t=n),t}function dr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===M?en+=4:(r=n,0===sn&&mn(ut)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="FROM"):(en=t,t=n)):(en=t,t=n),t}function pr(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===_?en+=3:(r=n,0===sn&&mn(lt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="FOR"):(en=t,t=n)):(en=t,t=n),t}function mr(){let t,r,a,i;return t=en,r=e.substr(en,9),r.toLowerCase()===D?en+=9:(r=n,0===sn&&mn(ct)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="SUBSTRING"):(en=t,t=n)):(en=t,t=n),t}function hr(){let t,r,a,i;return t=en,r=e.substr(en,7),r.toLowerCase()===P?en+=7:(r=n,0===sn&&mn(ft)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="EXTRACT"):(en=t,t=n)):(en=t,t=n),t}function vr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===b?en+=4:(r=n,0===sn&&mn(dt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TRIM"):(en=t,t=n)):(en=t,t=n),t}function wr(){let t,r,a,i;return t=en,r=e.substr(en,8),r.toLowerCase()===F?en+=8:(r=n,0===sn&&mn(pt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="POSITION"):(en=t,t=n)):(en=t,t=n),t}function Ir(){let t,r,a,i;return t=en,r=e.substr(en,9),r.toLowerCase()===A?en+=9:(r=n,0===sn&&mn(mt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TIMESTAMP"):(en=t,t=n)):(en=t,t=n),t}function gr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===R?en+=4:(r=n,0===sn&&mn(ht)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="DATE"):(en=t,t=n)):(en=t,t=n),t}function yr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===$?en+=4:(r=n,0===sn&&mn(vt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TIME"):(en=t,t=n)):(en=t,t=n),t}function Lr(){let t,r,a,i;return t=en,r=e.substr(en,7),r.toLowerCase()===U?en+=7:(r=n,0===sn&&mn(wt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="LEADING"):(en=t,t=n)):(en=t,t=n),t}function Tr(){let t,r,a,i;return t=en,r=e.substr(en,8),r.toLowerCase()===V?en+=8:(r=n,0===sn&&mn(It)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TRAILING"):(en=t,t=n)):(en=t,t=n),t}function Nr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===k?en+=4:(r=n,0===sn&&mn(gt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="BOTH"):(en=t,t=n)):(en=t,t=n),t}function Or(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===z?en+=4:(r=n,0===sn&&mn(yt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="CAST"):(en=t,t=n)):(en=t,t=n),t}function Sr(){let t,r,a,i;return t=en,r=e.substr(en,2),r.toLowerCase()===q?en+=2:(r=n,0===sn&&mn(Lt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="AS"):(en=t,t=n)):(en=t,t=n),t}function Er(){let t,r,a,i;return t=en,r=e.substr(en,7),r.toLowerCase()===H?en+=7:(r=n,0===sn&&mn(Tt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="INTEGER"):(en=t,t=n)):(en=t,t=n),t}function xr(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===K?en+=3:(r=n,0===sn&&mn(Nt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="INT"):(en=t,t=n)):(en=t,t=n),t}function Cr(){let t,r,a,i;return t=en,r=e.substr(en,8),r.toLowerCase()===Y?en+=8:(r=n,0===sn&&mn(Ot)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="SMALLINT"):(en=t,t=n)):(en=t,t=n),t}function Zr(){let t,r,a,i;return t=en,r=e.substr(en,5),r.toLowerCase()===j?en+=5:(r=n,0===sn&&mn(St)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="FLOAT"):(en=t,t=n)):(en=t,t=n),t}function Mr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===B?en+=4:(r=n,0===sn&&mn(Et)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="REAL"):(en=t,t=n)):(en=t,t=n),t}function _r(){let t,r,a,i;return t=en,r=e.substr(en,7),r.toLowerCase()===G?en+=7:(r=n,0===sn&&mn(xt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="VARCHAR"):(en=t,t=n)):(en=t,t=n),t}function Dr(){let t,r,a,i;return t=en,r=e.substr(en,2),r.toLowerCase()===J?en+=2:(r=n,0===sn&&mn(Ct)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TO"):(en=t,t=n)):(en=t,t=n),t}function Pr(){let t,r,a,i;return t=en,r=e.substr(en,8),r.toLowerCase()===W?en+=8:(r=n,0===sn&&mn(Zt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="INTERVAL"):(en=t,t=n)):(en=t,t=n),t}function br(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===X?en+=4:(r=n,0===sn&&mn(Mt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="YEAR"):(en=t,t=n)):(en=t,t=n),t}function Fr(){let t,r,a,i;return t=en,r=e.substr(en,13),r.toLowerCase()===ee?en+=13:(r=n,0===sn&&mn(_t)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TIMEZONE_HOUR"):(en=t,t=n)):(en=t,t=n),t}function Ar(){let t,r,a,i;return t=en,r=e.substr(en,15),r.toLowerCase()===te?en+=15:(r=n,0===sn&&mn(Dt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="TIMEZONE_MINUTE"):(en=t,t=n)):(en=t,t=n),t}function Rr(){let t,r,a,i;return t=en,r=e.substr(en,5),r.toLowerCase()===ne?en+=5:(r=n,0===sn&&mn(Pt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="MONTH"):(en=t,t=n)):(en=t,t=n),t}function $r(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===re?en+=3:(r=n,0===sn&&mn(bt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="DAY"):(en=t,t=n)):(en=t,t=n),t}function Ur(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===ae?en+=4:(r=n,0===sn&&mn(Ft)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="HOUR"):(en=t,t=n)):(en=t,t=n),t}function Vr(){let t,r,a,i;return t=en,r=e.substr(en,6),r.toLowerCase()===ie?en+=6:(r=n,0===sn&&mn(At)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="MINUTE"):(en=t,t=n)):(en=t,t=n),t}function kr(){let t,r,a,i;return t=en,r=e.substr(en,6),r.toLowerCase()===oe?en+=6:(r=n,0===sn&&mn(Rt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="SECOND"):(en=t,t=n)):(en=t,t=n),t}function zr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===se?en+=4:(r=n,0===sn&&mn($t)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="CASE"):(en=t,t=n)):(en=t,t=n),t}function qr(){let t,r,a,i;return t=en,r=e.substr(en,3),r.toLowerCase()===ue?en+=3:(r=n,0===sn&&mn(Ut)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="END"):(en=t,t=n)):(en=t,t=n),t}function Hr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===le?en+=4:(r=n,0===sn&&mn(Vt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="WHEN"):(en=t,t=n)):(en=t,t=n),t}function Kr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===ce?en+=4:(r=n,0===sn&&mn(kt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="THEN"):(en=t,t=n)):(en=t,t=n),t}function Yr(){let t,r,a,i;return t=en,r=e.substr(en,4),r.toLowerCase()===fe?en+=4:(r=n,0===sn&&mn(zt)),r!==n?(a=en,sn++,i=_n(),sn--,i===n?a=void 0:(en=a,a=n),a!==n?(tn=t,t="ELSE"):(en=t,t=n)):(en=t,t=n),t}function jr(){let t;return 44===e.charCodeAt(en)?(t=de,en++):(t=n,0===sn&&mn(qt)),t}function Qr(){let t;return 40===e.charCodeAt(en)?(t=pe,en++):(t=n,0===sn&&mn(Ht)),t}function Br(){let t;return 41===e.charCodeAt(en)?(t=me,en++):(t=n,0===sn&&mn(Kt)),t}function Gr(){let e,t;for(e=[],t=Jr();t!==n;)e.push(t),t=Jr();return e}function Jr(){let t;return t=e.charAt(en),Ee.test(t)?en++:(t=n,0===sn&&mn(Yt)),t}function Wr(){let t,r,a,i;if(t=en,r=Zn(),r!==n&&(tn=t),t=r,t===n)if(t=en,96===e.charCodeAt(en)?(r=he,en++):(r=n,0===sn&&mn(jt)),r!==n){if(a=[],i=e.charAt(en),xe.test(i)?en++:(i=n,0===sn&&mn(Qt)),i!==n)for(;i!==n;)a.push(i),i=e.charAt(en),xe.test(i)?en++:(i=n,0===sn&&mn(Qt));else a=n;a!==n?(96===e.charCodeAt(en)?(i=he,en++):(i=n,0===sn&&mn(jt)),i!==n?(tn=t,t=function(e){return e.join("")}(a)):(en=t,t=n)):(en=t,t=n)}else en=t,t=n;return t}function Xr(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 ea(e,...t){return{type:"expression-list",location:e,value:t}}function ta(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Xr(e,n,r,void 0,{...n.location,end:a});return n}rn=i();const na=rn!==n&&en===e.length;function ra(){throw rn!==n&&en<e.length&&mn({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(on,an<e.length?function(t=en){const n=e.codePointAt(t);return void 0===n?"":String.fromCodePoint(n)}(an):null,an<e.length?pn(an,an+1):pn(an,an))}return t.peg$library?{peg$result:rn,peg$currPos:en,peg$FAILED:n,peg$maxFailExpected:on,peg$maxFailPos:an,peg$success:na,peg$throw:na?void 0:ra}:na?rn:void ra()}class G{static parse(e){return B(e)}}function J(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":J(e.operand,t),J(e.value,t);break;case"case-expression":for(const n of e.clauses)J(n,t);"simple"===e.format&&J(e.operand,t),null!==e.else&&J(e.else,t);break;case"expression-list":for(const n of e.value)J(n,t);break;case"unary-expression":J(e.expr,t);break;case"binary-expression":J(e.left,t),J(e.right,t);break;case"function":J(e.args,t);break;case"interval":J(e.value,t),J(e.qualifier,t);break;case"interval-qualifier":J(e.start,t),J(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 Oe(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Ne(e,t,n)}ensureArray(e){return de(e)}applyIn(e,t){return ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return Ie(e)}currentTime(e){return ge(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 $(t,n,e)}calculate(e,t,n,r){return Y(e,t,n,r)}evaluateTime(e){return Z(e)}evaluateTimestamp(e,t,n){return M(e,t,n)}evaluateDate(e,t){return _(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:$(e,t[0],">=")&&$(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:$(e,t[0],"<")||$(e,t[1],">")}ternaryNot(e){return pe(e)}ternaryAnd(e,t){return me(e,t)}ternaryOr(e,t){return he(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(Z(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(_(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=G.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():S(e)?e.toMillis():C(e)?e.toStorageFormat():x(e)?e.toStorageString():E(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():S(e)?e.toMillis():C(e)?e.toMilliseconds():E(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():C(e)?i.n.fromSqlTimeStampOffset(e).toString():S(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?d.k.fromDateJS(e).toStorageString():S(e)?d.k.fromDateTime(e).toStorageString():C(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():x(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(S(e))return f.g.fromDateTime(e).toStorageFormat();if(C(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Se,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Se,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=Se,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=Se,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Se,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,J(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 J(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return J(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 J(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 J(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=K[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($(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)?m.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 pe(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return me(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return he(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 pe(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:$(a,o[0],">=")&&$(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:$(a,o[0],"<")||$(a,o[1],">")}case"LIKE":return Ne(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return pe(Ne(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 $(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return Y(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??=_(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return Z(e.value);case"current-time":return"date"===e.mode?Ie(this.timeZone):"time"===e.mode?ge(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Oe(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 pe(e){return null!==e?!0!==e:null}function me(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function he(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(A(e)&&A(r)&&(n=$(e,r,"="),n))break}return n}function we(e){return N(new Date,e)}function Ie(e){return i.n.fromNow(e)}function ge(e){const t=N(new Date,e);return d.k.fromDateTime(t)}const ye="-[]/{}()*+?.\\^$|";var Le,Te;function Ne(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Le.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Le.Normal:i===n?a=Le.Escaped:ye.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Le.Escaped:ye.includes(i)?r+="\\"+i:r+=i,a=Le.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Oe(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t);if(null==a)return a;const o=n?.get(t);switch(o?.type){case"esriFieldTypeDate":case"date":return N(new Date(a),n?.getLuxonTimeZone(o.name)??m.mQ.utcInstance);case"esriFieldTypeDateOnly":case"date-only":return i.n.fromReader(a);case"esriFieldTypeTimeOnly":case"time-only":return d.k.fromReader(a);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return new f.g(a)}return a}(Te=Le||(Le={}))[Te.Normal=0]="Normal",Te[Te.Escaped=1]="Escaped";const Se={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1384],{31384:(e,s,t)=>{t.d(s,{uploadAssets:()=>R});var o=t(78888),r=t(44208),n=t(53966),a=t(74887),i=t(78659),c=t(84952),l=t(13069),u=t(16930),p=t(63579),d=t(55726);const f={upload:{createFromFiles:.8,loadMesh:.2},uploadAssetBlobs:{prepareAssetItems:.9,uploadAssetItems:.1},uploadConvertibleSource:{uploadEditSource:.5,serviceAssetsToGlb:.5},uploadLocalMesh:{meshToAssetBlob:.5,uploadAssetBlobs:.5}};var m=t(60694),g=t(36563),h=t(91869);function w(e,s=e=>{},t){return new y(e,s,t)}class y{constructor(e,s=e=>{},t){if(this.onProgress=s,this.taskName=t,this._progressMap=new Map,this._startTime=void 0,this._timingsMap=new Map,"number"==typeof e){this._weights={};for(let s=0;s<e;s++){const t=s,o=1/e;this._weights[t]=o,this._progressMap.set(t,0)}}else this._weights=e;this.emitProgress()}emitProgress(){let e=0;for(const[s,t]of this._progressMap.entries())e+=t*this._weights[s];if(1===e&&(0,r.A)("enable-feature:esri-3dofl-upload-timings")){const e=Math.round(performance.now()-(this._startTime??0))/1e3;console.log(`${this.taskName} done in ${e} sec`);for(const[s,t]of this._timingsMap){const o=Math.round(t.end-t.start)/1e3,r=Math.round(o/e*100);console.log(this.taskName??"Task",{stepKey:s,stepTime:o,relativeTime:r})}}this.onProgress(e)}setProgress(e,s){if(this._progressMap.set(e,s),(0,r.A)("enable-feature:esri-3dofl-upload-timings")){const t=performance.now();this._startTime??=t;const o=(0,h.tE)(this._timingsMap,e,(()=>({start:t,end:0})));1===s&&(o.end=t)}this.emitProgress()}simulate(e,s){return A((s=>this.setProgress(e,s)),s)}makeOnProgress(e){return s=>this.setProgress(e,s)}}function A(e=e=>{},s=j){const t=performance.now();e(0);const o=setInterval((()=>{const o=performance.now()-t,r=1-Math.exp(-o/s);e(r)}),x);return(0,g.hA)((()=>{clearInterval(o),e(1)}))}function T(e,s=b){return(0,i.gr)((0,i.Kp)(e*v/s))}const b=10,P=10,v=8e-6,x=(0,i.l5)(50),j=(0,i.l5)(1e3),F=1e6,$=20*F,D=2e9,M=3;async function N({data:e,name:s,description:t},r,n){let i=null;try{const u=(0,c.fj)(r,"uploads"),p=(0,c.fj)(u,"info"),{data:d}=await(0,o.A)(p,{query:{f:"json"},responseType:"json"});(0,a.Te)(n);const f=(0,m.Wo)(r),g=d.maxUploadFileSize*F,h=f?D:g,y=f?Math.min($,g):$;if(e.size>h)throw new Error("Data too large");const A=(0,c.fj)(u,"register"),{data:b}=await(0,o.A)(A,{query:{f:"json",itemName:(l=s,l.replaceAll("/","_").replaceAll("\\","_")),description:t},responseType:"json",method:"post"});if((0,a.Te)(n),!b.success)throw new Error("Registration failed");const{itemID:P}=b.item;i=(0,c.fj)(u,P);const v=(0,c.fj)(i,"uploadPart"),x=Math.ceil(e.size/y),j=new Array;for(let s=0;s<x;++s)j.push(e.slice(s*y,Math.min((s+1)*y,e.size)));const N=j.slice().reverse(),S=new Array,E=w(x,n?.onProgress,"uploadItem"),k=async()=>{for(;0!==N.length;){const e=j.length-N.length,s=N.pop(),t=new FormData,r=E.simulate(e,T(s.size));try{t.append("f","json"),t.append("file",s),t.append("partId",`${e}`);const{data:r}=await(0,o.A)(v,{timeout:0,body:t,responseType:"json",method:"post"});if((0,a.Te)(n),!r.success)throw new Error("Part upload failed")}finally{r.remove()}}};for(let e=0;e<M&&0!==N.length;++e)S.push(k());await Promise.all(S);const R=(0,c.fj)(i,"commit"),{data:C}=await(0,o.A)(R,{query:{f:"json",parts:j.map(((e,s)=>s)).join(",")},responseType:"json",method:"post"});if((0,a.Te)(n),!C.success)throw new Error("Commit failed");return C.item}catch(e){if(null!=i){const e=(0,c.fj)(i,"delete");await(0,o.A)(e,{query:{f:"json"},responseType:"json",method:"post"})}throw e}var l}var S=t(20557),E=t(86390),k=t(77793);async function R(e,s,t){const o=e.length;if(!o)return t?.onProgress?.(1),[];const n=w(o,t?.onProgress,"uploadAssets");return Promise.all(e.map(((e,o)=>async function(e,{layer:s,ongoingUploads:t},o){const n=t.get(e);if(n)return n;if(!function(e){return!!e.infoFor3D&&!!e.url}(s))throw new d.Wt;if(function(e,s){const{parsedUrl:t}=s;return null!=t&&e.metadata.externalSources.some((e=>(0,p.eN)(e,t)))}(e,s))return o?.onProgress?.(1),e;const m=async function(e,s,t){const{metadata:o}=e,{displaySource:n}=o,m=C(n?.source,s,{checkForConversionRequired:(0,r.A)("enable-feature:georeferenced-uploads")}),g=null!=m?async function(e,s,t){return{source:await I(e,s,t),original:!0,unitConversionDisabled:!0}}(m,s,t):o.externalSources.length>0?async function(e,s,t){const o=q(s),{externalSources:n}=e.metadata,a=function(e,s){for(const t of e){const e=C(t.source,s);if(e)return e}return null}(n,s);if(!a)throw new d.xY;const l=w(f.uploadConvertibleSource,t?.onProgress,"uploadConvertibleSource"),m=await I(a,s,{onProgress:l.makeOnProgress("uploadEditSource")});e.addExternalSources([{source:m,original:!0}]);const g=a.reduce(((e,{asset:s})=>s instanceof File?e+s.size:e),0),h=l.simulate("serviceAssetsToGlb",function(e,s=P){return(0,i.gr)((0,i.Kp)(e*v/s))}(g));try{const{source:n,transform:a,origin:i}=await async function(e,s,t){const o=e.map((({assetName:e,parts:s})=>({assetName:e,assetHash:s[0].partHash})));let n;try{const e=(0,c.fj)(s.parsedUrl.path,"convert3D"),r=s.capabilities?.operations.supportsAsyncConvert3D;n=(await(r?Z:Y)(e,{query:{f:"json",assets:JSON.stringify(o),transportType:"esriTransportTypeUrl",targetFormat:t,async:r},responseType:"json",timeout:0})).data}catch(e){throw new d.MT}return function(e,s){const t={source:s.assets.map((s=>{const t=(0,S.R_)(s.contentType,e.infoFor3D.supportedFormats);if(!t)throw new d.H2(t);return new p.Qp(s.assetName,s.contentType,[new p.Bq(s.assetURL,s.assetHash)])})),origin:void 0,transform:void 0};if((0,r.A)("enable-feature:georeferenced-uploads")&&s.transform){if(t.transform=(0,k.f)(s.transform),s.spatialReference){const e=u.A.fromJSON(s.spatialReference);t.origin=(0,k.V)(s.transform,e)}}else t.transform=(0,E.Z)(e.spatialReference);return t}(s,n)}(m,s,o);return e.transform=a,i&&(e.metadata.georeferenced=!0,t?.useAssetOrigin&&(e.vertexSpace.origin=[i.x,i.y,i.z??0],e.spatialReference=i.spatialReference)),{source:n,unitConversionDisabled:!0}}finally{h.remove()}}(e,s,t):async function(e,s,t){const o=w(f.uploadLocalMesh,t?.onProgress,"uploadLocalMesh"),r=async function(e,s,t){const o=q(s),r=await e.load(t),n=await r.toBinaryGLTF({origin:r.origin,signal:t?.signal,ignoreLocalTransform:!0,unitConversionDisabled:!0});return(0,a.Te)(t),{blob:new Blob([n],{type:"model/gltf-binary"}),assetName:`${(0,l.yS)()}.glb`,assetType:o}}(e,s,{...t,onProgress:o.makeOnProgress("meshToAssetBlob")});return{source:await U([r],s,{...t,onProgress:o.makeOnProgress("uploadAssetBlobs")}),extent:e.extent.clone(),original:!0}}(e,s,t),h=await g;return(0,a.Te)(t),e.addExternalSources([h]),e}(e,s,o);t.set(e,m);try{await m}finally{t.delete(e)}return e}(e,s,{...t,onProgress:n.makeOnProgress(o)}))))}function C(e,{infoFor3D:s},t={}){if(!e)return null;const{supportedFormats:o,editFormats:r}=s,n=(0,p.WN)(e),a=new Array,i=(0,S.ND)(s),c=(0,S.nr)(s);let l=!1;for(const e of n){const s=_(e,o);if(!s)return null;const{assetType:n}=s;if(t.checkForConversionRequired&&(n===i||n===c))return null;r.includes(n)&&(l=!0),a.push(s)}return l?a:null}function _(e,s){const t=(0,p.fH)(e,s);return t?{asset:e,assetType:t}:null}async function I(e,s,t){return U(e.map((e=>async function(e,s){const{asset:t,assetType:o}=e;if(t instanceof File)return{blob:t,assetName:t.name,assetType:o};const r=await t.toBlob(s);return(0,a.Te)(s),{blob:r,assetName:t.assetName,assetType:o}}(e,t))),s,t)}async function U(e,s,t){const o=w(f.uploadAssetBlobs,t?.onProgress,"uploadAssetBlobs"),r=await function(e,s,t){const o=w(e.length,t?.onProgress,"prepareAssetItems");return Promise.all(e.map((async(e,r)=>{const i=async function(e,s,t){const{blob:o,assetType:r,assetName:i}=e;let l=null;try{const e=await N({data:o,name:i},s.url,t);(0,a.Te)(t),l={assetType:r,assetUploadId:e.itemID}}catch(e){(0,a.QP)(e),n.A.getLogger("esri.layers.graphics.sources.support.uploadAssets").warnOnce(`Service ${s.url} does not support the REST Uploads API.`)}if(!l){const e=await(0,c._0)(o);if((0,a.Te)(t),!e.isBase64)throw new d.$1;l={assetType:r,assetData:e.data}}if(!l)throw new d.WF;return{item:l,assetName:i}}(await e,s,{...t,onProgress:o.makeOnProgress(r)});return(0,a.Te)(t),i})))}(e,s,{...t,onProgress:o.makeOnProgress("prepareAssetItems")});(0,a.Te)(t);const i=r.map((({item:e})=>e)),{uploadResults:l}=await B(i,s,{...t,onProgress:o.makeOnProgress("uploadAssetItems")});return(0,a.Te)(t),e.map(((e,t)=>function(e,s,t){const{success:o}=s;if(!o){const{error:t}=s;throw new d.hK(e.assetName,t)}const{assetHash:r}=s,{assetName:n,item:{assetType:a}}=e,{infoFor3D:{supportedFormats:i}}=t,c=(0,S.Fm)(a,i);if(!c)throw new d.H2(a);return new p.Qp(n,c,[new p.Bq(`${t.parsedUrl.path}/assets/${r}`,r)])}(r[t],l[t],s)))}async function B(e,s,t){const r=A(t?.onProgress);try{const r=await(0,o.A)((0,c.fj)(s.parsedUrl.path,"uploadAssets"),{timeout:0,query:{f:"json",assets:JSON.stringify(e)},method:"post",responseType:"json"});if((0,a.Te)(t),r.data.uploadResults.length!==e.length)throw new d.nS(e.length,r.data.uploadResults.length);return r.data}finally{r.remove()}}function Y(e,s){return(0,o.A)(e,s)}async function Z(e,s){const t=(await(0,o.A)(e,s)).data.statusUrl;for(;;){const e=(await(0,o.A)(t,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,o.A)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new Error(e.status);case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new Error}await(0,a.Pl)(O)}}function q({infoFor3D:e}){const s=(0,S.U9)(e);if(!s)throw new d.uh;return s}const O=(0,i.l5)(1e3)},55726:(e,s,t)=>{t.d(s,{$1:()=>l,H2:()=>f,MT:()=>m,VP:()=>g,WF:()=>u,Wt:()=>a,XQ:()=>h,hK:()=>d,nS:()=>p,uh:()=>i,xY:()=>c});var o=t(49186);const r="upload-assets",n=()=>new Error;class a extends o.A{constructor(){super(`${r}:unsupported`,"Layer does not support asset uploads.",n())}}class i extends o.A{constructor(){super(`${r}:no-glb-support`,"Layer does not support glb.",n())}}class c extends o.A{constructor(){super(`${r}:no-supported-source`,"No supported external source found",n())}}class l extends o.A{constructor(){super(`${r}:not-base-64`,"Expected gltf data in base64 format after conversion.",n())}}class u extends o.A{constructor(){super(`${r}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",n())}}class p extends o.A{constructor(e,s){super(`${r}:bad-response`,`Bad response. Uploaded ${e} items and received ${s} results.`,n())}}class d extends o.A{constructor(e,s){super(`${r}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${s?.code??"-1"}. Error message: ${s?.messages??"unknown"}`,n())}}class f extends o.A{constructor(e){super(`${r}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,n())}}class m extends o.A{constructor(){super(`${r}:convert3D-failed`,"convert3D failed.")}}class g extends o.A{constructor(){super("invalid-input:no-model","No supported model found")}}class h extends o.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},77793:(e,s,t)=>{t.d(s,{V:()=>n,f:()=>a});var o=t(86738),r=t(73836);function n(e,s,t=i){return new o.A({x:e[t.originX],y:e[t.originY],z:e[t.originZ],spatialReference:s})}function a(e,s=i){return new r.A({translation:[e[s.translationX],-e[s.translationZ],e[s.translationY]],rotationAxis:[e[s.rotationX],-e[s.rotationZ],e[s.rotationY]],rotationAngle:e[s.rotationDeg],scale:[e[s.scaleX],e[s.scaleZ],e[s.scaleY]]})}const i={originX:"originX",originY:"originY",originZ:"originZ",translationX:"translationX",translationY:"translationY",translationZ:"translationZ",scaleX:"scaleX",scaleY:"scaleY",scaleZ:"scaleZ",rotationX:"rotationX",rotationY:"rotationY",rotationZ:"rotationZ",rotationDeg:"rotationDeg"}},86390:(e,s,t)=>{t.d(s,{Z:()=>n});var o=t(83047),r=t(73836);function n(e){const s=1/(0,o.GA)(e,1);return 1!==s?new r.A({scale:[s,s,s]}):void 0}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1737,3513],{4146:(e,t,r)=>{r.d(t,{A:()=>w});var i=r(90237),s=r(78888),o=r(49186),n=r(65529),a=r(4902),l=r(92474),d=r(53966),u=r(74887),p=r(84952),c=r(10107),y=(r(44208),r(87811),r(40608)),h=r(5443),f=r(16930),m=r(92602),g=r(64272);let v=0,w=class extends(n.A.EventedMixin(a.A.IdentifiableMixin(l.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new h.A(-180,-90,180,90,f.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=f.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",s=r?.portal?.url||m.A.portalUrl;throw d.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.zf)(e)||d.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}createLayerView(e,t){return Promise.reject(new o.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new o.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,c.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,i._)([(0,c.MZ)({type:h.A})],w.prototype,"fullExtent",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,i._)([(0,c.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,i._)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,i._)([(0,c.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,i._)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,i._)([(0,c.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,i._)([(0,c.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,i._)([(0,c.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,i._)([(0,c.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,i._)([(0,c.MZ)({type:f.A})],w.prototype,"spatialReference",void 0),(0,i._)([(0,c.MZ)({type:String})],w.prototype,"title",void 0),(0,i._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,i._)([(0,c.MZ)()],w.prototype,"url",void 0),(0,i._)([(0,c.MZ)({type:g.T})],w.prototype,"visibilityTimeExtent",void 0),(0,i._)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,i._)([(0,y.$)("esri.layers.Layer")],w)},8303:(e,t,r)=>{r.d(t,{A:()=>I});var i=r(90237),s=r(92602),o=r(70333),n=r(78888),a=r(60999),l=r(49186),d=r(53966),u=r(97768),p=r(74887),c=r(84952),y=r(10107),h=(r(44208),r(87811),r(36005)),f=r(40608),m=r(43937),g=r(77548),v=r(20655),w=r(80812),_=r(41318),b=r(10407);const I=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.QP)(e),!0))))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!o.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let n,a;if(s)n=r.portal.url;else try{n=await(0,g.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!n||!(0,c.b8)(n,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(o.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const l=!0,d=!1,u=!1;if(!a)return{features:{edit:l,fullEdit:d},content:{updateItem:u}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:n}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,p.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:u}}}_getUserPrivileges(e,t){const r=(0,b.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(i))return s.user;const l=`${i}/community/self`,d=null!=e?e.signal:null,u=await(0,a.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?_.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,c.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,y.MZ)({type:w.default})],t.prototype,"portalItem",null),(0,i._)([(0,h.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,y.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,y.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},M={credential:null,user:null}},8947:(e,t,r)=>{r.d(t,{L:()=>n});var i=r(60999),s=r(74887),o=r(67076);async function n(e,t,r){const n=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(n&&"unique-value"===n.type&&n.styleOrigin){const a=await(0,i.Ke)(n.populateFromStyle());if((0,s.Te)(r),!1===a.ok){const r=a.error;t?.messages&&t.messages.push(new o.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:t})),e.clear("renderer",t?.origin)}}}},13899:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ee});var i=r(90237),s=r(52106),o=r(13874),n=r(69540),a=r(5503),l=r(49186),d=r(36563),u=r(53966),p=r(97768),c=r(92071),y=r(74887),h=r(36708),f=r(10107),m=(r(44208),r(87811),r(88620)),g=r(36005),v=r(40608),w=r(35666),_=r(86738),b=r(4146),I=r(55726),M=r(52136),S=r(18768),A=r(69208),x=r(47685),F=r(16131),L=r(8303),T=r(25036),Z=r(58947),O=r(82935),E=r(25482),j=r(30524);function U({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,i=e?.serverGens,s=null!=r,o=null!=t,n=s&&o&&t.lastUpdate!==r.getTime();return s&&(n||!o&&i?.minServerGen!==i?.serverGen)}var P=r(96184),R=r(64272),$=r(26253);const N=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return(0,j.sv)(t,this.fieldsIndex),t}set timeInfo(e){(0,j.sv)(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:r,endTimeField:i}=t;if(null==r&&null==i)return;if(U({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let i=null;try{const r=await(this.fetchStatistics?.(t,e));i=r?.stats}catch{}if(null==i)return null;const{minTimeStr:s,min:o,maxTimeStr:n,max:a}=i,l=t===r?s??o:n??a;return null!=l?new Date(l):null},[o,n]=await Promise.all([s(r),s(i)]);if(null!=r&&null==o||null!=i&&null==n)return;const a=new R.T({start:o,end:n});this.setAtOrigin("timeInfo",new P.A({endField:i,startField:r,fullTimeExtent:a}),"service")}};return(0,i._)([(0,f.MZ)({type:P.A,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),(0,i._)([(0,f.MZ)({type:R.T,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),(0,i._)([(0,f.MZ)({type:$.T,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),(0,i._)([(0,f.MZ)({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),(0,i._)([(0,f.MZ)({type:D,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=(0,i._)([(0,v.$)("esri.layers.mixins.TemporalSceneLayer")],t),t};let D=class extends E.A{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};(0,i._)([(0,f.MZ)({type:String})],D.prototype,"endTimeField",void 0),(0,i._)([(0,f.MZ)({type:String})],D.prototype,"startTimeField",void 0),D=(0,i._)([(0,v.$)("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],D);var C=r(60694),k=r(92009),q=r(4071),H=r(10873),V=r(15426),G=r(40530),B=r(67202),J=r(17036),K=r(95466),Q=r(50805),W=r(20557),z=r(46499),X=r(39383),Y=r(37352),ee=r(4513),te=r(86390);let re=class extends E.A{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,f.MZ)({type:String,json:{read:!0,write:{isRequired:!0}}})],re.prototype,"name",void 0),(0,i._)([(0,f.MZ)({type:String,json:{read:!0,write:{isRequired:!0}}})],re.prototype,"field",void 0),(0,i._)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],re.prototype,"currentRangeExtent",void 0),(0,i._)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],re.prototype,"fullRangeExtent",void 0),(0,i._)([(0,f.MZ)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],re.prototype,"type",void 0),re=(0,i._)([(0,v.$)("esri.layers.support.RangeInfo")],re);var ie,se=r(78888),oe=r(4718),ne=r(87024),ae=r(67076),le=r(39829),de=r(80586);let ue=ie=class extends(E.A.JSONSupportMixin(a.A.ofType(le.A))){constructor(e){super(e)}clone(){return new ie(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,de.canProjectWithoutEngine)(r.spatialReference,t))return e?.messages?.push(new ae.A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new le.A;(0,de.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages?.push(new ae.A("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new ie;return e.forEach((e=>r.add(le.A.fromJSON(e,t)))),r}};ue=ie=(0,i._)([(0,v.$)("esri.layers.support.PolygonCollection")],ue);const pe=ue;var ce,ye=r(97159);let he=ce=class extends E.A{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new pe,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.OH))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=pe.fromJSON(e,r):this._geometriesSource={url:(0,ye.f)(e,r),context:r}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,se.A)(r,{responseType:"json",signal:t?.signal}),o=e.toJSON(),n=s.data.map((e=>({...e,spatialReference:o})));this.geometries=pe.fromJSON(n,i),this._geometriesSource=null}clone(){const e=new ce({geometries:(0,oe.o8)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i._)([(0,f.MZ)({type:["disjoint","contains"],nonNullable:!0,json:{write:{isRequired:!0}}})],he.prototype,"spatialRelationship",void 0),(0,i._)([(0,f.MZ)({type:pe,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}}),(0,ne.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],he.prototype,"geometries",void 0),(0,i._)([(0,g.w)(["web-scene","portal-item"],"geometries")],he.prototype,"readGeometries",null),he=ce=(0,i._)([(0,v.$)("esri.layers.support.SceneFilter")],he);const fe=he;var me=r(84952),ge=r(8947),ve=r(41214),we=r(61956),_e=r(24212),be=r(30291);async function Ie(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(Me(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function Me(e){const{BlobReader:t,ZipReader:i,BlobWriter:s}=await Promise.all([r.e(8392),r.e(9588)]).then(r.bind(r,9588)),o=[],n=new i(new t(e));return(await n.getEntries()).forEach((e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new s,r=e.getData?.(t).then((t=>new File([t],e.filename)));r&&o.push(r)})),Promise.all(o)}var Se=r(4654),Ae=r(45671),xe=r(78553);const Fe=new Set(["3DObject","Point"]),Le=(0,J.p)();let Te=class extends(N((0,x.w6)((0,Z.w6)((0,S.b)((0,F.q)((0,L.A)((0,T.j)((0,c.P)((0,A.d)((0,M.p)(n.A.ClonableMixin(b.A)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new a.A,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=(0,p.pR)(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?(0,V.Vq)(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new K.A(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:Q.W4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,V.C$)(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){(0,j.yp)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q.P;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:n,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:p},operations:{supportsEditing:c,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,_=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:_&&n,supportsUploadWithItemId:o},data:{supportsAttachment:p,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:c&&w,supportsAdd:_&&y&&w,supportsDelete:_&&f&&w,supportsUpdate:h&&w,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Ze[r]?Ze[r]:(u.A.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.QP),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await(0,ge.L)(this,{origin:"service"},t),(0,j.yp)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){u.A.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new we.A;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new l.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new l.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=(0,j.hL)(this.fieldsIndex,await(0,Ae.TO)(this,(0,Ae.D8)(this)));return(0,Se.s1)(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new l.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.A;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(u.A.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,be.tn)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new l.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new l.A("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(Z.Xh.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(Z.Xh.SAVE,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(8628).then(r.bind(r,78628));let s=t;await this.load();const o=this.associatedLayer;if(!o)throw new l.A(`${this.type}-layer:not-editable`,"Service is not editable");await o.load();const{globalIdField:n}=o,a=!!o.infoFor3D,d=s?.globalIdUsed??!0;if(a&&null==n)throw new l.A(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!d)throw new l.A(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,C.Wo)(o.url)&&a&&null!=e.deleteFeatures&&null!=n&&(s={...s,globalIdToObjectId:await(0,V.GA)(o,e.deleteFeatures,n)}),i(this,o.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new l.A(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const i=e=>{throw u.A.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||i(new l.A("invalid:layer","SceneLayer has no capability for mesh conversion"));const s=await this.extractAndFilterFiles(e),o=s.reduce(((e,t)=>(0,W.oF)(this.infoFor3D,t)?e+1:e),0);0===o&&i(new I.VP),o>1&&i(new I.XQ);const n=this.spatialReference,a=t.location??new _.A({x:0,y:0,z:0,spatialReference:n}),d=a.spatialReference.isGeographic?"local":"georeferenced",{default:p}=await Promise.all([r.e(3030),r.e(36)]).then(r.bind(r,40036)),c=p.createWithExternalSource(a,s,{vertexSpace:d,transform:(0,te.Z)(a.spatialReference),unitConversionDisabled:!0}),[y]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return y}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await Ie(e)).filter((e=>(0,W.fu)(t,e))):e}validateLayer(e){if(e.layerType&&!Fe.has(e.layerType))throw new l.A("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l.A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new l.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new l.A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new l.A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new l.A("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some((t=>t.name===e.name)),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=(0,m.oY)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===w.Gr.SERVICE||o===w.Gr.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");null!=this.associatedLayer?.infoFor3D&&e&&(0,C.Wo)(this.associatedLayer?.url)&&U(this)&&(0,m.oY)(this).setAtOrigin("fullExtent",e.clone(),w.Gr.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await(0,k.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ee.S.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(e){(0,y.zf)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles((0,d.rE)(e));try{await(0,h.C_)((()=>this.popupEnabled&&null!=this.popupTemplate),e.signal)}catch(e){return void(0,y.jH)(e)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?u.A.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):u.A.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,_e.XF)(u.A.getLogger(this),(0,_e.$7)("Mesh scene layers","relative-to-scene",e)),(0,_e.XF)(u.A.getLogger(this),(0,_e.tW)("Scene layers",e))}async fetchStatistics(e,t){return await async function({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:i,path:s,customParameters:o,apiKey:n,signal:a}){if(null==t)throw new l.A(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const d=i.get(e);if(null==d)throw new l.A(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const u=t.find((e=>e.name===d.name));if(null==u)throw new l.A(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const p=(0,me.fj)(s,u.href),{data:c}=await(0,se.A)(p,{query:{f:"json",...o,token:n},responseType:"json",signal:a});return c}({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};(0,i._)([(0,f.MZ)({types:{key:"type",base:G.c,typeMap:{selection:B.A}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Te.prototype,"featureReduction",void 0),(0,i._)([(0,f.MZ)({type:[re],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Te.prototype,"rangeInfos",void 0),(0,i._)([(0,f.MZ)({json:{read:!1}})],Te.prototype,"associatedLayer",void 0),(0,i._)([(0,f.MZ)({type:["show","hide"]})],Te.prototype,"listMode",void 0),(0,i._)([(0,f.MZ)({type:["ArcGISSceneServiceLayer"]})],Te.prototype,"operationalLayerType",void 0),(0,i._)([(0,f.MZ)({json:{read:!1},readOnly:!0})],Te.prototype,"type",void 0),(0,i._)([(0,f.MZ)({...Le.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"fields",void 0),(0,i._)([(0,f.MZ)()],Te.prototype,"types",null),(0,i._)([(0,f.MZ)()],Te.prototype,"typeIdField",null),(0,i._)([(0,f.MZ)()],Te.prototype,"templates",null),(0,i._)([(0,f.MZ)()],Te.prototype,"formTemplate",null),(0,i._)([(0,f.MZ)({readOnly:!0,clonable:!1})],Te.prototype,"fieldsIndex",null),(0,i._)([(0,f.MZ)({type:Y.A,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Te.prototype,"floorInfo",void 0),(0,i._)([(0,f.MZ)(Le.outFields)],Te.prototype,"outFields",void 0),(0,i._)([(0,f.MZ)({type:Q.W4,readOnly:!0,json:{read:!1}})],Te.prototype,"nodePages",void 0),(0,i._)([(0,g.w)("service","nodePages",["nodePages","pointNodePages"])],Te.prototype,"readNodePages",null),(0,i._)([(0,f.MZ)({type:[Q.uV],readOnly:!0})],Te.prototype,"materialDefinitions",void 0),(0,i._)([(0,f.MZ)({type:[Q.Ot],readOnly:!0})],Te.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,f.MZ)({type:[Q.L0],readOnly:!0})],Te.prototype,"geometryDefinitions",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Te.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Te.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Te.prototype,"statisticsInfo",void 0),(0,i._)([(0,f.MZ)({type:a.A.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Te.prototype,"excludeObjectIds",void 0),(0,i._)([(0,f.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Te.prototype,"definitionExpression",void 0),(0,i._)([(0,f.MZ)({type:fe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Te.prototype,"filter",void 0),(0,i._)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Te.prototype,"path",void 0),(0,i._)([(0,f.MZ)(H.Yj)],Te.prototype,"elevationInfo",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Te.prototype,"effectiveCapabilities",null),(0,i._)([(0,f.MZ)({readOnly:!0})],Te.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,f.MZ)({type:String})],Te.prototype,"geometryType",null),(0,i._)([(0,f.MZ)(H.kF)],Te.prototype,"labelsVisible",void 0),(0,i._)([(0,f.MZ)({type:[z.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:X.w},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:X.w},write:!0}})],Te.prototype,"labelingInfo",void 0),(0,i._)([(0,f.MZ)(H.fV)],Te.prototype,"legendEnabled",void 0),(0,i._)([(0,f.MZ)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,xe.D)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Te.prototype,"opacity",void 0),(0,i._)([(0,f.MZ)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"priority",void 0),(0,i._)([(0,f.MZ)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"semantic",void 0),(0,i._)([(0,f.MZ)({types:ve.XJ,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Te.prototype,"renderer",null),(0,i._)([(0,f.MZ)({json:{read:!1}})],Te.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,g.w)("service","cachedDrawingInfo")],Te.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Te.prototype,"capabilities",null),(0,i._)([(0,f.MZ)({type:Boolean,json:{read:!1}})],Te.prototype,"editingEnabled",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"infoFor3D",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"relationships",null),(0,i._)([(0,f.MZ)(H.M6)],Te.prototype,"popupEnabled",void 0),(0,i._)([(0,f.MZ)({type:o.A,json:{name:"popupInfo",write:!0}})],Te.prototype,"popupTemplate",void 0),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Te.prototype,"defaultPopupTemplate",null),(0,i._)([(0,f.MZ)(H.zQ)],Te.prototype,"attributeTableTemplate",void 0),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Te.prototype,"objectIdField",void 0),(0,i._)([(0,g.w)("service","objectIdField",["objectIdField","fields"])],Te.prototype,"readObjectIdField",null),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Te.prototype,"globalIdField",void 0),(0,i._)([(0,g.w)("service","globalIdField",["globalIdField","fields"])],Te.prototype,"readGlobalIdField",null),(0,i._)([(0,f.MZ)({readOnly:!0,type:String,json:{read:!1}})],Te.prototype,"displayField",null),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Te.prototype,"profile",void 0),(0,i._)([(0,g.w)("service","profile",["store.profile"])],Te.prototype,"readProfile",null),(0,i._)([(0,f.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Te.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,f.MZ)(H.PY)],Te.prototype,"screenSizePerspectiveEnabled",void 0),(0,i._)([(0,f.MZ)({json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"serviceItemId",void 0),(0,i._)([(0,f.MZ)(O.B)],Te.prototype,"useViewTime",null),Te=(0,i._)([(0,v.$)("esri.layers.SceneLayer")],Te);const Ze={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Oe={"mesh-pyramids":"mesh",points:"point"},Ee=Te},17036:(e,t,r)=>{r.d(t,{p:()=>l});var i=r(44208),s=r(53966),o=r(20437),n=r(95466),a=r(30524);function l(){return{fields:{type:[o.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return n.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},18768:(e,t,r)=>{r.d(t,{b:()=>l});var i=r(90237),s=r(53966),o=r(10107),n=(r(44208),r(87811),r(40608)),a=r(60694);const l=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,a.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,s.A.getLogger(this)))}};return(0,i._)([(0,o.MZ)()],t.prototype,"title",null),(0,i._)([(0,o.MZ)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,n.$)("esri.layers.mixins.ArcGISService")],t),t}},20557:(e,t,r)=>{r.d(t,{Fm:()=>l,Hz:()=>y,JQ:()=>c,JZ:()=>_,ND:()=>f,R_:()=>n,U9:()=>p,fu:()=>s,nr:()=>h,oF:()=>o,rq:()=>d,z$:()=>u});const i=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=g(t.name,e?.supportedFormats??[])}function o(e,t){if(!e)return!1;const r=d(t,e.supportedFormats??[]);return null!=r&&e.editFormats.includes(r)}function n(e,t){return v(function(e,t){const r=e.toLowerCase();return m(t).find((e=>w(e)===r))}(e,t))}function a(e,t){return v(g(e,t))}function l(e,t){return w(function(e,t){return m(t).find((t=>v(t)===e))}(e,t))}function d(e,t){return a(e.name,t)??n(e.type,t)}function u(e,t,r){return n(e,r)??a(t,r)}function p({supportedFormats:e}){return u("model/gltf-binary","glb",e)}function c(e){const t=p(e);return null!=t&&e.editFormats.includes(t)}function y(e){if(!e)return null;const t=p(e),r=function({supportedFormats:e}){return u("model/gltf+json","gltf",e)}(e);let i=null;for(const s of e.queryFormats){if(s===t)return s;s===r&&(i=s)}return i}function h({supportedFormats:e}){return u("application/esri3do-SR_world","wld",e)}function f({supportedFormats:e}){return u("application/esri3do-SR_prj","prj",e)}function m(e){return[...i,...e]}function g(e,t){const r=e.toLowerCase();return m(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>r.endsWith(e)))))}function v(e){return e?.[0]}function w(e){return e?.[1].toLowerCase()}function _(e){return e.tables?.find((e=>"assetMaps"===e.role))}},20816:(e,t,r)=>{r.d(t,{TA:()=>s,We:()=>a,Z3:()=>o,ZJ:()=>l,w5:()=>d});var i=r(78888);const s=(0,r(13069).vD)(),o=new Map,n=new Map;async function a(e,t,r){if(!e||!r)return!1;if(!t)return!0;const s=new URL(e).host;let n=o.get(s);if(!n){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===t}async function l(e,t,i=!1){if(!e||!t)return!0;const o=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=n.get(o)?.entries();if(a)for(const[e,n]of a)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([r.e(2186).then(r.bind(r,32186)),r.e(2558).then(r.bind(r,32558))]),a=await t(o,e,new i({sessionId:s,moment:n.moment}));return a.success&&n.stack?.clearForwardEdits(),a.success}return t}return!0}function d(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=n.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map},24212:(e,t,r)=>{function i(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?l:d}(e).mode}(null==e||(e.hasZ??!1),t)}function s(e,t,r){return r&&r.mode!==t?`${e} only support ${t} elevation mode`:null}function o(e,t,r){return r?.mode===t?`${e} do not support ${t} elevation mode`:null}function n(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function a(e,t){t&&e.warn(".elevationInfo=",t)}r.d(t,{$7:()=>o,B:()=>s,XF:()=>a,tW:()=>n,w7:()=>i}),r(83047),r(16271);const l={mode:"absolute-height",offset:0},d={mode:"on-the-ground",offset:null}},24770:(e,t,r)=>{r.d(t,{$I:()=>m,AU:()=>y,g7:()=>f,i4:()=>u,ui:()=>p,up:()=>v,vt:()=>d,yo:()=>h});var i=r(34727),s=r(58083),o=r(67026),n=r(82534),a=r(38954),l=r(51850);function d(e=v){return[e[0],e[1],e[2],e[3]]}function u(e,t,r=d()){return(0,a.c)(r,e),r[3]=t,r}function p(e,t=d()){const r=(0,s.l)(w,e);return g(t,(0,i.KJ)((0,o.Xd)(t,r))),t}function c(e,t,r=d()){return(0,o.x8)(w,e,m(e)),(0,o.x8)(_,t,m(t)),(0,o.lw)(w,_,w),g(r,(0,i.KJ)((0,o.Xd)(r,w)))}function y(e,t,r,i=d()){return u(l.Cw,e,b),u(l.JP,t,I),u(l.Cb,r,M),c(b,I,b),c(b,M,i),i}function h(e){return e}function f(e){return e[3]}function m(e){return(0,i.kU)(e[3])}function g(e,t){return e[3]=t,e}const v=[0,0,1,0],w=(0,n.vt)(),_=(0,n.vt)(),b=(d(),d()),I=d(),M=d()},25036:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(90237),s=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.MZ)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,o.$)("esri.layers.mixins.ScaleRangeLayer")],t),t}},26253:(e,t,r)=>{r.d(t,{T:()=>p});var i=r(90237),s=r(69540),o=r(25482),n=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),d=r(40608),u=r(73133);let p=class extends(s.A.ClonableMixin(o.A)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,n.t)(this.value,this.unit,"milliseconds")}};(0,i._)([(0,l.e)(u.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,i._)([(0,d.$)("esri.time.TimeInterval")],p)},37352:(e,t,r)=>{r.d(t,{A:()=>d});var i,s=r(90237),o=r(5503),n=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));let d=i=class extends n.A{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],d.prototype,"floorField",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllMode",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllLevelIds",void 0),d=i=(0,s._)([(0,l.$)("esri.layers.support.LayerFloorInfo")],d)},40530:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(90237),s=r(25482),o=r(10107),n=(r(44208),r(53966),r(87811),r(40608));let a=class extends s.A{constructor(){super(...arguments),this.type=null}};(0,i._)([(0,o.MZ)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,n.$)("esri.layers.support.FeatureReduction")],a)},45671:(e,t,r)=>{r.d(t,{D8:()=>o,TO:()=>s});var i=r(30524);async function s(e,t=e.popupTemplate){if(null==t)return[];const r=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:s}=t,{objectIdField:o,typeIdField:n,globalIdField:a,relationships:l}=e;if(r.includes("*"))return["*"];const d=s?(0,i.eX)(e):[],u=(0,i.DB)(e.fieldsIndex,[...r,...d]);return n&&u.push(n),u&&o&&e.fieldsIndex?.has(o)&&!u.includes(o)&&u.push(o),u&&a&&e.fieldsIndex?.has(a)&&!u.includes(a)&&u.push(a),l&&l.forEach((t=>{const{keyField:r}=t;u&&r&&e.fieldsIndex?.has(r)&&!u.includes(r)&&u.push(r)})),u}function o(e,t){return e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&null!=e.defaultPopupTemplate?e.defaultPopupTemplate:null}},47685:(e,t,r)=>{r.d(t,{Mk:()=>y,Zk:()=>p,w6:()=>m});var i=r(90237),s=r(65529),o=r(4718),n=r(74887),a=r(10107),l=(r(44208),r(53966),r(40608)),d=r(20816);const u=new s.A.EventEmitter;function p(e,t,r=null,i=!1){const s=(0,n.Tw)();return i=null==t||i,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:s.promise}),s}const c=Symbol();function y(e){return null!=e&&"object"==typeof e&&c in e}function h(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,s=d.Z3.get(i),o=e=>!e||e===s;return o(t)&&o(r)||t===r}const m=e=>{var t;let r=class extends e{static{t=c}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:s,result:n}=e,a=t===this.url,l=null!=r&&null!=this.layerId&&r===this.layerId,d=h(this),u=h(this)&&f(t,i,this.gdbVersion);if(!a||d&&!u||!l&&!s)return;const p=n.then((e=>{if(this.lastEditsEventDate=new Date,l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,o.o8)(e)),e;const r=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(r){const{adds:t,updates:i,deletes:s}=r.editedFeatures,n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:i?i.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,o.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,o.o8)(e.historicMoment)};return this.emit("edits",n),n}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,o.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,o.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,s.historicMoment)&&this.emit("edits",s),s})).then((e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,s=t===this.url,o=h(this),n=h(this)&&f(t,r,this.gdbVersion),a=h(this)&&!f(t,this.gdbVersion,null);s&&o&&n&&a&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then((()=>{this.addHandles(function(e){return u.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return u.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(e,t,r){return"historicMoment"in this&&this.historicMoment!==r&&(0,d.w5)(e,t)}};return(0,i._)([(0,a.MZ)()],r.prototype,"lastEditsEventDate",void 0),r=(0,i._)([(0,l.$)("esri.layers.mixins.EditBusLayer")],r),r}},50805:(e,t,r)=>{r.d(t,{L0:()=>g,Ot:()=>y,W4:()=>l,uV:()=>p});var i=r(90237),s=r(25482),o=r(10107),n=(r(44208),r(53966),r(87811),r(93223)),a=r(40608);let l=class extends s.A{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,i._)([(0,o.MZ)({type:Number})],l.prototype,"nodesPerPage",void 0),(0,i._)([(0,o.MZ)({type:Number})],l.prototype,"rootIndex",void 0),(0,i._)([(0,o.MZ)({type:String})],l.prototype,"lodSelectionMetricType",void 0),l=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],l);let d=class extends s.A{constructor(){super(...arguments),this.factor=1}};(0,i._)([(0,o.MZ)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],d.prototype,"id",void 0),(0,i._)([(0,o.MZ)({type:Number})],d.prototype,"factor",void 0),d=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],d);let u=class extends s.A{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,i._)([(0,o.MZ)({type:[Number]})],u.prototype,"baseColorFactor",void 0),(0,i._)([(0,o.MZ)({type:d})],u.prototype,"baseColorTexture",void 0),(0,i._)([(0,o.MZ)({type:d})],u.prototype,"metallicRoughnessTexture",void 0),(0,i._)([(0,o.MZ)({type:Number})],u.prototype,"metallicFactor",void 0),(0,i._)([(0,o.MZ)({type:Number})],u.prototype,"roughnessFactor",void 0),u=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],u);let p=class extends s.A{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,i._)([(0,n.e)({opaque:"opaque",mask:"mask",blend:"blend"})],p.prototype,"alphaMode",void 0),(0,i._)([(0,o.MZ)({type:Number})],p.prototype,"alphaCutoff",void 0),(0,i._)([(0,o.MZ)({type:Boolean})],p.prototype,"doubleSided",void 0),(0,i._)([(0,n.e)({none:"none",back:"back",front:"front"})],p.prototype,"cullFace",void 0),(0,i._)([(0,o.MZ)({type:d})],p.prototype,"normalTexture",void 0),(0,i._)([(0,o.MZ)({type:d})],p.prototype,"occlusionTexture",void 0),(0,i._)([(0,o.MZ)({type:d})],p.prototype,"emissiveTexture",void 0),(0,i._)([(0,o.MZ)({type:[Number]})],p.prototype,"emissiveFactor",void 0),(0,i._)([(0,o.MZ)({type:u})],p.prototype,"pbrMetallicRoughness",void 0),p=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],p);let c=class extends s.A{};(0,i._)([(0,o.MZ)({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:`${t.index}`}}})],c.prototype,"name",void 0),(0,i._)([(0,n.e)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],c.prototype,"format",void 0),c=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],c);let y=class extends s.A{constructor(){super(...arguments),this.atlas=!1}};(0,i._)([(0,o.MZ)({type:[c]})],y.prototype,"formats",void 0),(0,i._)([(0,o.MZ)({type:Boolean})],y.prototype,"atlas",void 0),y=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],y);let h=class extends s.A{};(0,i._)([(0,n.e)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],h.prototype,"type",void 0),(0,i._)([(0,o.MZ)({type:Number})],h.prototype,"component",void 0),h=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],h);let f=class extends s.A{};(0,i._)([(0,n.e)({draco:"draco"})],f.prototype,"encoding",void 0),(0,i._)([(0,o.MZ)({type:[String]})],f.prototype,"attributes",void 0),f=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],f);let m=class extends s.A{constructor(){super(...arguments),this.offset=0}};(0,i._)([(0,o.MZ)({type:Number})],m.prototype,"offset",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"position",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"normal",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"uv0",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"color",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"uvRegion",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"featureId",void 0),(0,i._)([(0,o.MZ)({type:h})],m.prototype,"faceRange",void 0),(0,i._)([(0,o.MZ)({type:f})],m.prototype,"compressedAttributes",void 0),m=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],m);let g=class extends s.A{};(0,i._)([(0,n.e)({triangle:"triangle"})],g.prototype,"topology",void 0),(0,i._)([(0,o.MZ)()],g.prototype,"geometryBuffers",void 0),g=(0,i._)([(0,a.$)("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],g)},52136:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(90237),s=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const n=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.MZ)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,o.$)("esri.layers.mixins.APIKeyMixin")],t),t}},54239:(e,t,r)=>{r.d(t,{A:()=>g});var i,s=r(90237),o=r(4576),n=r(66552),a=r(25482),l=r(83047),d=r(67076),u=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),y=r(43937);const h=(0,n.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=h.jsonValues.slice();(0,o.Xy)(f,"orthometric");const m=(0,n.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=i=class extends a.A{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return h.write(e,t,r)}readHeightModel(e,t,r){return h.read(e)||(r?.messages&&r.messages.push(function(e,t){return new d.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.LA)(e)||m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.k1)(t);return new i({heightModel:e.heightModel,heightUnit:r??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new d.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.MZ)({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal",write:{isRequired:!0}}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,y.K)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,p.w)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.MZ)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:{writer:m.write,isRequired:!0}}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,p.w)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,p.w)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=i=(0,s._)([(0,c.$)("esri.geometry.HeightModelInfo")],g)},55726:(e,t,r)=>{r.d(t,{$1:()=>d,H2:()=>y,MT:()=>h,VP:()=>f,WF:()=>u,Wt:()=>n,XQ:()=>m,hK:()=>c,nS:()=>p,uh:()=>a,xY:()=>l});var i=r(49186);const s="upload-assets",o=()=>new Error;class n extends i.A{constructor(){super(`${s}:unsupported`,"Layer does not support asset uploads.",o())}}class a extends i.A{constructor(){super(`${s}:no-glb-support`,"Layer does not support glb.",o())}}class l extends i.A{constructor(){super(`${s}:no-supported-source`,"No supported external source found",o())}}class d extends i.A{constructor(){super(`${s}:not-base-64`,"Expected gltf data in base64 format after conversion.",o())}}class u extends i.A{constructor(){super(`${s}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",o())}}class p extends i.A{constructor(e,t){super(`${s}:bad-response`,`Bad response. Uploaded ${e} items and received ${t} results.`,o())}}class c extends i.A{constructor(e,t){super(`${s}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${t?.code??"-1"}. Error message: ${t?.messages??"unknown"}`,o())}}class y extends i.A{constructor(e){super(`${s}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,o())}}class h extends i.A{constructor(){super(`${s}:convert3D-failed`,"convert3D failed.")}}class f extends i.A{constructor(){super("invalid-input:no-model","No supported model found")}}class m extends i.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},67202:(e,t,r)=>{r.d(t,{A:()=>l});var i,s=r(90237),o=r(10107),n=(r(44208),r(53966),r(87811),r(40608)),a=r(40530);let l=i=class extends a.c{constructor(e){super(e),this.type="selection"}clone(){return new i}};(0,s._)([(0,o.MZ)({type:["selection"]})],l.prototype,"type",void 0),l=i=(0,s._)([(0,n.$)("esri.layers.support.FeatureReductionSelection")],l)},69208:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(90237),s=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,o.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},73133:(e,t,r)=>{r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},73836:(e,t,r)=>{r.d(t,{A:()=>h});var i,s=r(90237),o=r(25482),n=r(10107),a=(r(44208),r(53966),r(87811),r(40608)),l=r(58083),d=r(9093),u=r(67026),p=r(82534),c=r(51850),y=r(24770);let h=class extends o.A{static{i=this}constructor(e){super(e),this.translation=(0,c.vt)(),this.rotationAxis=(0,c.ci)(y.up),this.rotationAngle=0,this.scale=(0,c.fA)(1,1,1)}get rotation(){return(0,y.i4)(this.rotationAxis,this.rotationAngle)}set rotation(e){this.rotationAxis=(0,c.o8)((0,y.yo)(e)),this.rotationAngle=(0,y.g7)(e)}get localMatrix(){const e=(0,d.vt)();return(0,u.x8)(f,(0,y.yo)(this.rotation),(0,y.$I)(this.rotation)),(0,l.o1)(e,f,this.translation,this.scale),e}get localMatrixInverse(){return(0,l.B8)((0,d.vt)(),this.localMatrix)}equals(e){return this===e||null!=e&&(0,l.t2)(this.localMatrix,e.localMatrix)}clone(){const e={translation:(0,c.o8)(this.translation),rotationAxis:(0,c.o8)(this.rotationAxis),rotationAngle:this.rotationAngle,scale:(0,c.o8)(this.scale)};return new i(e)}};(0,s._)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"translation",void 0),(0,s._)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"rotationAxis",void 0),(0,s._)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],h.prototype,"rotationAngle",void 0),(0,s._)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"scale",void 0),(0,s._)([(0,n.MZ)()],h.prototype,"rotation",null),(0,s._)([(0,n.MZ)()],h.prototype,"localMatrix",null),(0,s._)([(0,n.MZ)()],h.prototype,"localMatrixInverse",null),h=i=(0,s._)([(0,a.$)("esri.geometry.support.MeshTransform")],h);const f=(0,p.vt)()},80200:(e,t,r)=>{r.d(t,{T:()=>i,d:()=>f});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,o=(1<<s)-1;function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e){const t=[];for(let r=0,i=e.length*s;r<i;r+=s)t[r>>5]|=(e.charCodeAt(r/s)&o)<<r%32;return t}function l(e){const t=[];for(let r=0,i=32*e.length;r<i;r+=s)t.push(String.fromCharCode(e[r>>5]>>>r%32&o));return t.join("")}function d(e,t,r,i,s,o){return n(function(e,t){return e<<t|e>>>32-t}(n(n(t,e),n(i,o)),s),r)}function u(e,t,r,i,s,o,n){return d(t&r|~t&i,e,t,s,o,n)}function p(e,t,r,i,s,o,n){return d(t&i|r&~i,e,t,s,o,n)}function c(e,t,r,i,s,o,n){return d(t^r^i,e,t,s,o,n)}function y(e,t,r,i,s,o,n){return d(r^(t|~i),e,t,s,o,n)}function h(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let r=1732584193,i=-271733879,s=-1732584194,o=271733878;for(let t=0;t<e.length;t+=16){const a=r,l=i,d=s,h=o;r=u(r,i,s,o,e[t],7,-680876936),o=u(o,r,i,s,e[t+1],12,-389564586),s=u(s,o,r,i,e[t+2],17,606105819),i=u(i,s,o,r,e[t+3],22,-1044525330),r=u(r,i,s,o,e[t+4],7,-176418897),o=u(o,r,i,s,e[t+5],12,1200080426),s=u(s,o,r,i,e[t+6],17,-1473231341),i=u(i,s,o,r,e[t+7],22,-45705983),r=u(r,i,s,o,e[t+8],7,1770035416),o=u(o,r,i,s,e[t+9],12,-1958414417),s=u(s,o,r,i,e[t+10],17,-42063),i=u(i,s,o,r,e[t+11],22,-1990404162),r=u(r,i,s,o,e[t+12],7,1804603682),o=u(o,r,i,s,e[t+13],12,-40341101),s=u(s,o,r,i,e[t+14],17,-1502002290),i=u(i,s,o,r,e[t+15],22,1236535329),r=p(r,i,s,o,e[t+1],5,-165796510),o=p(o,r,i,s,e[t+6],9,-1069501632),s=p(s,o,r,i,e[t+11],14,643717713),i=p(i,s,o,r,e[t],20,-373897302),r=p(r,i,s,o,e[t+5],5,-701558691),o=p(o,r,i,s,e[t+10],9,38016083),s=p(s,o,r,i,e[t+15],14,-660478335),i=p(i,s,o,r,e[t+4],20,-405537848),r=p(r,i,s,o,e[t+9],5,568446438),o=p(o,r,i,s,e[t+14],9,-1019803690),s=p(s,o,r,i,e[t+3],14,-187363961),i=p(i,s,o,r,e[t+8],20,1163531501),r=p(r,i,s,o,e[t+13],5,-1444681467),o=p(o,r,i,s,e[t+2],9,-51403784),s=p(s,o,r,i,e[t+7],14,1735328473),i=p(i,s,o,r,e[t+12],20,-1926607734),r=c(r,i,s,o,e[t+5],4,-378558),o=c(o,r,i,s,e[t+8],11,-2022574463),s=c(s,o,r,i,e[t+11],16,1839030562),i=c(i,s,o,r,e[t+14],23,-35309556),r=c(r,i,s,o,e[t+1],4,-1530992060),o=c(o,r,i,s,e[t+4],11,1272893353),s=c(s,o,r,i,e[t+7],16,-155497632),i=c(i,s,o,r,e[t+10],23,-1094730640),r=c(r,i,s,o,e[t+13],4,681279174),o=c(o,r,i,s,e[t],11,-358537222),s=c(s,o,r,i,e[t+3],16,-722521979),i=c(i,s,o,r,e[t+6],23,76029189),r=c(r,i,s,o,e[t+9],4,-640364487),o=c(o,r,i,s,e[t+12],11,-421815835),s=c(s,o,r,i,e[t+15],16,530742520),i=c(i,s,o,r,e[t+2],23,-995338651),r=y(r,i,s,o,e[t],6,-198630844),o=y(o,r,i,s,e[t+7],10,1126891415),s=y(s,o,r,i,e[t+14],15,-1416354905),i=y(i,s,o,r,e[t+5],21,-57434055),r=y(r,i,s,o,e[t+12],6,1700485571),o=y(o,r,i,s,e[t+3],10,-1894986606),s=y(s,o,r,i,e[t+10],15,-1051523),i=y(i,s,o,r,e[t+1],21,-2054922799),r=y(r,i,s,o,e[t+8],6,1873313359),o=y(o,r,i,s,e[t+15],10,-30611744),s=y(s,o,r,i,e[t+6],15,-1560198380),i=y(i,s,o,r,e[t+13],21,1309151649),r=y(r,i,s,o,e[t+4],6,-145523070),o=y(o,r,i,s,e[t+11],10,-1120210379),s=y(s,o,r,i,e[t+2],15,718787259),i=y(i,s,o,r,e[t+9],21,-343485551),r=n(r,a),i=n(i,l),s=n(s,d),o=n(o,h)}return[r,i,s,o]}function f(e,t=i.Hex){const r=t||i.Base64,o=h(a(e),e.length*s);switch(r){case i.Raw:return o;case i.Hex:return function(e){const t="0123456789abcdef",r=[];for(let i=0,s=4*e.length;i<s;i++)r.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return r.join("")}(o);case i.String:return l(o);case i.Base64:return function(e){const t=[];for(let r=0,i=4*e.length;r<i;r+=3){const i=(e[r>>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return t.join("")}(o)}}},82935:(e,t,r)=>{r.d(t,{B:()=>y,e:()=>h});var i=r(90237),s=r(10107),o=(r(44208),r(53966),r(87811),r(36005)),n=r(40608),a=r(89317),l=r(30524),d=r(96184),u=r(73133),p=r(64272),c=r(26253);const y={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:a.K}}},h=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const i=r.timeOffset,s=u.j.fromJSON(r.timeOffsetUnits);return i&&s?new c.T({value:i,unit:s}):null}set timeInfo(e){(0,l.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i._)([(0,s.MZ)({type:p.T,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,i._)([(0,s.MZ)({type:c.T})],t.prototype,"timeOffset",void 0),(0,i._)([(0,o.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,i._)([(0,s.MZ)({value:null,type:d.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,i._)([(0,s.MZ)(y)],t.prototype,"useViewTime",void 0),t=(0,i._)([(0,n.$)("esri.layers.mixins.TemporalLayer")],t),t}},85648:(e,t,r)=>{r.d(t,{n:()=>s});var i=r(84952);function s(e){return o[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return l[t]||n}(e.url)}(e)]||a}const o={},n="text/plain",a=o[n],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)o[l[e]]=e},86390:(e,t,r)=>{r.d(t,{Z:()=>o});var i=r(83047),s=r(73836);function o(e){const t=1/(0,i.GA)(e,1);return 1!==t?new s.A({scale:[t,t,t]}):void 0}},87024:(e,t,r)=>{r.d(t,{P:()=>y});var i=r(49186),s=r(80200),o=r(76553),n=r(84952),a=r(13069),l=r(96156),d=r(35666),u=r(10107),p=r(85648),c=r(97159);function y(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.z4)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,c.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{isRequired:i.json?.write?.isRequired,writer(t,s,a,l){if(!l?.resources)return"string"==typeof t?void(s[a]=(0,c.t)(t,l)):void(s[a]=t.write({},l));const u=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),y=(0,c.t)(u,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},c.M.NO),g=i.type!==String&&(!(0,o.H)(this)||l?.origin&&this.originIdOf(r)>(0,d.aB)(l.origin)),v={object:this,propertyName:r,value:t,targetUrl:y,dest:s,targetPropertyName:a,context:l,params:e};l?.portalItem&&y&&!(0,n.oP)(y)?g&&e?.contentAddressed?h(v):g?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:o,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=m(s,r,t),u=(0,p.n)(d),c=(0,n.Zo)(l.path),y=i?.compress??!1;u===c?(t.resources&&f({...e,resource:l,content:d,compress:y,updates:t.resources.toUpdate}),o[a]=r):h(e)}(v):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(v):l?.portalItem&&(null==y||null!=(0,c.i)(y)||(0,n.w8)(y)||g)?h(v):s[a]=y}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=c.p;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,u.rM)(r,e,i);for(const e in s)t[e]=s[e]}}}function h(e){const{targetUrl:t,params:r,value:o,context:l,dest:d,targetPropertyName:u}=e;if(!l.portalItem)return;const y=(0,c.b)(t),h=m(o,t,l);if(r?.contentAddressed&&"json"!==h.type)return void l.messages?.push(new i.A("persistable:contentAddressingUnsupported",`Property "${u}" is trying to serializing a resource with content of type ${h.type} with content addressing. Content addressing is only supported for json resources.`,{content:h}));const g=r?.contentAddressed&&"json"===h.type?(0,s.d)(h.jsonString):y?.filename??(0,a.lk)(),v=(0,n.fj)(r?.prefix??y?.prefix,g),w=`${v}.${(0,p.n)(h)}`;if(r?.contentAddressed&&l.resources&&"json"===h.type){const e=l.resources.toKeep.find((({resource:e})=>e.path===w))??l.resources.toAdd.find((({resource:e})=>e.path===w));if(e)return void(d[u]=e.resource.itemRelativeUrl)}const _=l.portalItem.resourceFromPath(w);(0,n.w8)(t)&&l.resources&&l.resources.pendingOperations.push((0,n.tk)(t).then((e=>{_.path=`${v}.${(0,p.n)({type:"blob",blob:e})}`,d[u]=_.itemRelativeUrl})).catch((()=>{})));const b=r?.compress??!1;l.resources&&f({...e,resource:_,content:h,compress:b,updates:l.resources.toAdd}),d[u]=_.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:o}){r.push({resource:i,content:s,compress:o,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function m(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},92071:(e,t,r)=>{r.d(t,{P:()=>w,L:()=>_});var i=r(90237),s=r(69622),o=r(76953),n=r(4718),a=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,r=this._originStores[a.Gr.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,n.o8)(e),a.Gr.DEFAULTS)}));for(let r=a.Gr.SERVICE;r<a.AU;r++){const i=this._originStores[r];i&&i.forEach(((i,s)=>{e&&e.has(s)||t.set(s,(0,n.o8)(i),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=a.Gr.USER){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=a.Gr.USER){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r?.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||a.Gr.DEFAULTS}isAtOrigin(e,t){return this.has(e,t)&&this.originOf(e)===t}isBelowOrigin(e,t){return!this.has(e)||this.originOf(e)<t}forEach(e){this._values.forEach(e)}}var d=r(45917),u=r(88620),p=r(40608);const c=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,u.oY)(this),r=t.store,i=new l;t.store=i,(0,o.k)(t,r,i)}read(e,t){(0,d.L)(this,e,t)}getAtOrigin(e,t){const r=y(this),i=(0,a.aB)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach((e=>{s[e]=r.get(e,i)})),s}originOf(e){return(0,a.OL)(this.originIdOf(e))}originIdOf(e){return y(this).originOf(e)}revert(e,t){const r=y(this),i=(0,a.aB)(t),s=(0,u.oY)(this);let o;o="string"==typeof e?"*"===e?r.keys(i):[e]:e,o.forEach((e=>{s.invalidate(e),r.revert(e,i),s.commit(e)}))}};return t=(0,i._)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function y(e){return(0,u.oY)(e).store}let h=class extends(c(s.A)){};h=(0,i._)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],h);var f=r(16649),m=r(49422);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){(0,u.oY)(this).clearOrigin(e,(0,a.aB)(t))}write(e,t){return(0,m.M)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,u.oY)(this).setAtOrigin(e,t,(0,a.aB)(r))}removeOrigin(e){const t=v(this),r=(0,a.aB)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),a.Gr.USER)}updateOrigin(e,t){const r=v(this),i=(0,a.aB)(t),s=(0,f.Jt)(this,e);for(let t=i+1;t<a.AU;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return t=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function v(e){return(0,u.oY)(e).store}const w=e=>{let t=class extends(g(c(e))){constructor(...e){super(...e)}};return t=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport")],t),t};let _=class extends(w(s.A)){};_=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport")],_)},96184:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(90237),s=r(69540),o=r(25482),n=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),d=r(43937),u=r(64272),p=r(26253),c=r(56400);function y(e,t){return p.T.fromJSON({value:e,unit:t})}let h=class extends(s.A.ClonableMixin(o.A)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?u.T.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?y(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?y(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i._)([(0,n.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],h.prototype,"cumulative",void 0),(0,i._)([(0,n.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"endField",void 0),(0,i._)([(0,n.MZ)({type:u.T,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"fullTimeExtent",void 0),(0,i._)([(0,a.w)("fullTimeExtent",["timeExtent"])],h.prototype,"readFullTimeExtent",null),(0,i._)([(0,d.K)("fullTimeExtent")],h.prototype,"writeFullTimeExtent",null),(0,i._)([(0,n.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"hasLiveData",void 0),(0,i._)([(0,n.MZ)({type:p.T,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"interval",void 0),(0,i._)([(0,a.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],h.prototype,"readInterval",null),(0,i._)([(0,d.K)("interval")],h.prototype,"writeInterval",null),(0,i._)([(0,n.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"startField",void 0),(0,i._)([(0,n.MZ)((0,c.P6)("timeReference",!0))],h.prototype,"timeZone",void 0),(0,i._)([(0,n.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"trackIdField",void 0),(0,i._)([(0,n.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],h.prototype,"useTime",void 0),(0,i._)([(0,n.MZ)({type:[Date],json:{read:!1}})],h.prototype,"stops",void 0),h=(0,i._)([(0,l.$)("esri.layers.support.TimeInfo")],h)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2593],{9093:(t,e,r)=>{function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function n(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}r.d(e,{o8:()=>n,vt:()=>s,zK:()=>a});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:n,create:s,fromValues:function(t,e,r,s,n,a,o,i,u,l,c,p,d,h,y,f){return[t,e,r,s,n,a,o,i,u,l,c,p,d,h,y,f]}},Symbol.toStringTag,{value:"Module"}))},18251:(t,e,r)=>{r.d(e,{A:()=>c});var s=r(90237),n=r(69540),a=r(25482),o=r(10107),i=(r(44208),r(53966),r(87811),r(93223)),u=r(40608),l=r(51850);let c=class extends(n.A.ClonableMixin(a.A)){constructor(t){super(t),this.type="local",this.origin=(0,l.vt)()}};(0,s._)([(0,i.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,s._)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,s._)([(0,u.$)("esri.geometry.support.MeshLocalVertexSpace")],c)},24770:(t,e,r)=>{r.d(e,{$I:()=>m,AU:()=>h,g7:()=>f,i4:()=>c,ui:()=>p,up:()=>b,vt:()=>l,yo:()=>y});var s=r(34727),n=r(58083),a=r(67026),o=r(82534),i=r(38954),u=r(51850);function l(t=b){return[t[0],t[1],t[2],t[3]]}function c(t,e,r=l()){return(0,i.c)(r,t),r[3]=e,r}function p(t,e=l()){const r=(0,n.l)(M,t);return g(e,(0,s.KJ)((0,a.Xd)(e,r))),e}function d(t,e,r=l()){return(0,a.x8)(M,t,m(t)),(0,a.x8)(_,e,m(e)),(0,a.lw)(M,_,M),g(r,(0,s.KJ)((0,a.Xd)(r,M)))}function h(t,e,r,s=l()){return c(u.Cw,t,A),c(u.JP,e,S),c(u.Cb,r,q),d(A,S,A),d(A,q,s),s}function y(t){return t}function f(t){return t[3]}function m(t){return(0,s.kU)(t[3])}function g(t,e){return t[3]=e,t}const b=[0,0,1,0],M=(0,o.vt)(),_=(0,o.vt)(),A=(l(),l()),S=l(),q=l()},27615:(t,e,r)=>{r.d(e,{CK:()=>u,Hq:()=>i,MW:()=>l,TE:()=>c,yJ:()=>p});var s=r(38954),n=r(86738),a=r(95696),o=r(18251);function i(t){return null!=t.origin}function u(t){return i(t.vertexSpace)}function l(t,e){if(!i(t))return null;const[r,s,a]=t.origin;return new n.A({x:r,y:s,z:a,spatialReference:e})}function c(t,e){const{x:r,y:s,z:n,spatialReference:i}=t,u=[r,s,n??0];return"local"===(e?.vertexSpace??function(t){return t.isGeographic||t.isWebMercator?"local":"georeferenced"}(i))?new o.A({origin:u}):new a.A({origin:u})}function p(t,e){return t.type===e.type&&(t.origin===e.origin||null!=t.origin&&null!=e.origin&&(0,s.q)(t.origin,e.origin))}},28132:(t,e,r)=>{r.d(e,{A:()=>C});var s=r(90237),n=r(69622),a=r(49186),o=r(44208),i=r(74887),u=r(84952),l=r(10107),c=(r(53966),r(87811),r(40608)),p=r(21325),d=r(20557),h=r(27733),y=r(2272),f=r(20615),m=r(5443),g=r(80893),b=r(61956),M=r(78286),_=r(99199),A=r(97768),S=r(62815),q=r(90708);function x(t,e){return e}function v(t,e,r,s){switch(r){case 0:return R(t,e+s,0);case 1:return"lowerLeft"===t.originPosition?R(t,e+s,1):function({translate:t,scale:e},r,s){return t[s]-r*e[s]}(t,e+s,1)}}function w(t,e,r,s){return 2===r?R(t,e,2):v(t,e,r,s)}function F(t,e,r,s){return 2===r?0===e?0:R(t,e,3):v(t,e,r,s)}function I(t,e,r,s){return 3===r?0===e?0:R(t,e,3):w(t,e,r,s)}function R({translate:t,scale:e},r,s){return t[s]+r*e[s]}class O{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=x,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=(0,S.N)(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(null!=e)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;(0,A.Lw)(r),r.push(e);const s=r.map((t=>t.name));this._attributesConstructor=function(){for(const t of s)this[t]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(t,e,r)=>this.addCoordinatePoint(t,e,r),this.createGeometry=t=>this.createPointGeometry(t);break;case"esriGeometryPolygon":this.addCoordinate=(t,e,r)=>this._addCoordinatePolygon(t,e,r),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"esriGeometryPolyline":this.addCoordinate=(t,e,r)=>this._addCoordinatePolyline(t,e,r),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"esriGeometryMultipoint":this.addCoordinate=(t,e,r)=>this._addCoordinateMultipoint(t,e,r),this.createGeometry=t=>this._createMultipointGeometry(t)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){0===this._lengths.length&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=this._transform?(0,q.Ch)(r.clone(),r,!1,!1,this._transform):r.clone(),a=(0,q.zv)(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return null!==this._mValueOffset&&0===t&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){0===r&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){0===r&&0==this._toAddInCurrentPath--&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?I:e?w:r?F:v}}var T=r(22671);let C=class extends n.A{constructor(t){super(t),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return(0,u.An)(this.url)}async execute(t,e){const r=await this.executeJSON(t,e);return this.featureSetFromJSON(t,r,e)}async executeJSON(t,e){const r=this._normalizeQuery(t),s=null!=t.outStatistics?.[0],n=(0,o.A)("featurelayer-pbf-statistics"),a=(!s||n)&&!0!==t.returnTrueCurves;let i;if(this.pbfSupported&&a)try{i=await async function(t,e,r,s){const n=(0,y.Dl)(t),a={...r},o=b.A.from(e),i=!o.quantizationParameters,{data:u}=await(0,g.IJ)(n,o,new O({sourceSpatialReference:o.sourceSpatialReference,applyTransform:i}),a,s);return u}(this.url,r,e,{uniqueIdFields:this.uniqueIdFields})}catch(t){if("query:parsing-pbf"!==t.name)throw t;this.pbfSupported=!1}return this.pbfSupported&&a||(i=await(0,_.e)(this.url,r,e,{uniqueIdFields:this.uniqueIdFields})),this._normalizeFields(i.fields),i}async featureSetFromJSON(t,e,s){if(!this._queryIs3DObjectFormat(t)||null==this.infoFor3D||!e.features)return T.A.fromJSON(e);const{meshFeatureSetFromJSON:n}=await(0,i.qr)(Promise.all([r.e(3030),r.e(36),r.e(6112)]).then(r.bind(r,40050)),s);return n(t,this.infoFor3D,e)}executeForCount(t,e){return(0,f.I)(this.url,this._normalizeQuery(t),e)}executeForExtent(t,e){return async function(t,e,r){const s=(0,y.Dl)(t),n=await(0,g.Jf)(s,b.A.from(e),{...r}),a=n.data.extent;return!a||isNaN(a.xmin)||isNaN(a.ymin)||isNaN(a.xmax)||isNaN(a.ymax)?{count:n.data.count,extent:null}:{count:n.data.count,extent:m.A.fromJSON(a)}}(this.url,this._normalizeQuery(t),e)}executeForIds(t,e){return(0,M.V)(this.url,this._normalizeQuery(t),e,{uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(t,e){const[{default:s},{executeRelationshipQuery:n}]=await(0,i.qr)(Promise.all([Promise.resolve().then(r.bind(r,26591)),r.e(5257).then(r.bind(r,15257))]),e);return t=s.from(t),(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),n(this.url,t,e)}async executeRelationshipQueryForCount(t,e){const[{default:s},{executeRelationshipQueryForCount:n}]=await(0,i.qr)(Promise.all([Promise.resolve().then(r.bind(r,26591)),r.e(5257).then(r.bind(r,15257))]),e);return t=s.from(t),(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),n(this.url,t,e)}async executeAttachmentQuery(t,e){const{executeAttachmentQuery:s,fetchAttachments:n,processAttachmentQueryResult:a}=await(0,i.qr)(r.e(9239).then(r.bind(r,9239)),e),o=(0,y.Dl)(this.url);return a(o,await(this.queryAttachmentsSupported?s(o,t,e):n(o,t,e)))}async executeAttributeBinsQuery(t,e){const{executeAttributeBinsQuery:s}=await(0,i.qr)(Promise.all([r.e(4575),r.e(3103)]).then(r.bind(r,33103)),e);return s(this.parsedUrl,t,e)}async executeTopFeaturesQuery(t,e){const{executeTopFeaturesQuery:s}=await(0,i.qr)(r.e(1273).then(r.bind(r,11273)),e);return s(this.parsedUrl,t,this.sourceSpatialReference,e)}async executeForTopIds(t,e){const{executeForTopIds:s}=await(0,i.qr)(r.e(1277).then(r.bind(r,21277)),e);return s(this.parsedUrl,t,e)}async executeForTopExtents(t,e){const{executeForTopExtents:s}=await(0,i.qr)(r.e(8018).then(r.bind(r,8018)),e);return s(this.parsedUrl,t,e)}async executeForTopCount(t,e){const{executeForTopCount:s}=await(0,i.qr)(r.e(980).then(r.bind(r,10980)),e);return s(this.parsedUrl,t,e)}_normalizeQuery(t){let e=b.A.from(t);e.sourceSpatialReference=e.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(e=e===t?e.clone():e,e.gdbVersion=t.gdbVersion||this.gdbVersion,e.dynamicDataSource=t.dynamicDataSource?h.L.from(t.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(null!=r&&this._queryIs3DObjectFormat(t)){if(e=e===t?e.clone():e,e.formatOf3DObjects=(0,d.Hz)(r),!e.formatOf3DObjects)throw new a.A("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(e.outSpatialReference&&!(0,p.aI)(e.outSpatialReference,this.sourceSpatialReference))throw new a.A("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==e.outFields||!e.outFields.includes("*")){e=e===t?e.clone():e,null==e.outFields&&(e.outFields=[]);const{originX:s,originY:n,originZ:a,translationX:o,translationY:i,translationZ:u,scaleX:l,scaleY:c,scaleZ:p,rotationX:d,rotationY:h,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;e.outFields.push(s,n,a,o,i,u,l,c,p,d,h,y,f)}}return e}_normalizeFields(t){if(null!=this.fieldsIndex&&null!=t)for(const e of t){const t=this.fieldsIndex.get(e.name);t&&Object.assign(e,t.toJSON())}}_queryIs3DObjectFormat(t){return null!=this.infoFor3D&&!0===t.returnGeometry&&"xyFootprint"!==t.multipatchOption&&!t.outStatistics}};(0,s._)([(0,l.MZ)({type:h.L})],C.prototype,"dynamicDataSource",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"fieldsIndex",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"gdbVersion",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"infoFor3D",void 0),(0,s._)([(0,l.MZ)({readOnly:!0})],C.prototype,"parsedUrl",null),(0,s._)([(0,l.MZ)()],C.prototype,"pbfSupported",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"queryAttachmentsSupported",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"sourceSpatialReference",void 0),(0,s._)([(0,l.MZ)()],C.prototype,"uniqueIdFields",void 0),(0,s._)([(0,l.MZ)({type:String})],C.prototype,"url",void 0),C=(0,s._)([(0,c.$)("esri.layers.graphics.sources.support.QueryTask")],C)},29242:(t,e,r)=>{function s(){return[1,0,0,0,1,0,0,0,1]}function n(t,e,r,s,n,a,o,i,u){return[t,e,r,s,n,a,o,i,u]}r.d(e,{fA:()=>n,vt:()=>s,zK:()=>a});const a=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:s,fromValues:n},Symbol.toStringTag,{value:"Module"}))},38954:(t,e,r)=>{r.d(e,{A:()=>y,B:()=>h,C:()=>c,D:()=>p,E:()=>E,F:()=>j,H:()=>Z,a:()=>D,b:()=>g,c:()=>o,d:()=>l,e:()=>x,f:()=>u,g:()=>m,h:()=>v,i:()=>i,j:()=>b,k:()=>_,l:()=>a,m:()=>w,n:()=>q,o:()=>I,q:()=>C,r:()=>S,s:()=>M,t:()=>F,u:()=>A,v:()=>R,w:()=>d,x:()=>Q,y:()=>G,z:()=>f});var s=r(51850),n=r(34304);function a(t){const e=t[0],r=t[1],s=t[2];return Math.sqrt(e*e+r*r+s*s)}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t,e,r,s){return t[0]=e,t[1]=r,t[2]=s,t}function u(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function c(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function p(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function d(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function h(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function y(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function f(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function m(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function g(t,e,r,s){return t[0]=e[0]+r[0]*s,t[1]=e[1]+r[1]*s,t[2]=e[2]+r[2]*s,t}function b(t,e){const r=e[0]-t[0],s=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+s*s+n*n)}function M(t,e){const r=e[0]-t[0],s=e[1]-t[1],n=e[2]-t[2];return r*r+s*s+n*n}function _(t){const e=t[0],r=t[1],s=t[2];return e*e+r*r+s*s}function A(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function S(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function q(t,e){const r=e[0],s=e[1],n=e[2];let a=r*r+s*s+n*n;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function x(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function v(t,e,r){const s=e[0],n=e[1],a=e[2],o=r[0],i=r[1],u=r[2];return t[0]=n*u-a*i,t[1]=a*o-s*u,t[2]=s*i-n*o,t}function w(t,e,r,s){const n=e[0],a=e[1],o=e[2];return t[0]=n+s*(r[0]-n),t[1]=a+s*(r[1]-a),t[2]=o+s*(r[2]-o),t}function F(t,e,r){const s=e[0],n=e[1],a=e[2];return t[0]=r[0]*s+r[4]*n+r[8]*a+r[12],t[1]=r[1]*s+r[5]*n+r[9]*a+r[13],t[2]=r[2]*s+r[6]*n+r[10]*a+r[14],t}function I(t,e,r){const s=e[0],n=e[1],a=e[2];return t[0]=s*r[0]+n*r[3]+a*r[6],t[1]=s*r[1]+n*r[4]+a*r[7],t[2]=s*r[2]+n*r[5]+a*r[8],t}function R(t,e,r){const s=r[0],n=r[1],a=r[2],o=r[3],i=e[0],u=e[1],l=e[2],c=n*l-a*u,p=a*i-s*l,d=s*u-n*i,h=n*d-a*p,y=a*c-s*d,f=s*p-n*c,m=2*o;return t[0]=i+c*m+2*h,t[1]=u+p*m+2*y,t[2]=l+d*m+2*f,t}const O=(0,s.vt)(),T=(0,s.vt)();function C(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function E(t,e,r){const s=r[0]-e[0],n=r[1]-e[1],a=r[2]-e[2];let o=s*s+n*n+a*a;return o>0?(o=1/Math.sqrt(o),t[0]=s*o,t[1]=n*o,t[2]=a*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const D=l,P=c,N=p,j=b,Q=M,Z=a,G=_;Object.freeze(Object.defineProperty({__proto__:null,abs:d,add:u,angle:function(t,e){q(O,t),q(T,e);const r=x(O,T);return r>1?0:r<-1?Math.PI:Math.acos(r)},bezier:function(t,e,r,s,n,a){const o=1-a,i=o*o,u=a*a,l=i*o,c=3*a*i,p=3*u*o,d=u*a;return t[0]=e[0]*l+r[0]*c+s[0]*p+n[0]*d,t[1]=e[1]*l+r[1]*c+s[1]*p+n[1]*d,t[2]=e[2]*l+r[2]*c+s[2]*p+n[2]*d,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,r=1){return t[0]=Math.min(Math.max(t[0],e),r),t[1]=Math.min(Math.max(t[1],e),r),t[2]=Math.min(Math.max(t[2],e),r),t},copy:o,cross:v,crossAndNormalize:function(t,e,r){const s=e[0],n=e[1],a=e[2],o=r[0],i=r[1],u=r[2],l=n*u-a*i,c=a*o-s*u,p=s*i-n*o,d=Math.sqrt(l*l+c*c+p*p);return t[0]=l/d,t[1]=c/d,t[2]=p/d,t},direction:E,dist:j,distance:b,div:N,divide:p,dot:x,equals:function(t,e){if(t===e)return!0;const r=t[0],s=t[1],a=t[2],o=e[0],i=e[1],u=e[2],l=(0,n.FD)();return Math.abs(r-o)<=l*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-i)<=l*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(a-u)<=l*Math.max(1,Math.abs(a),Math.abs(u))},exactEquals:C,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,r,s,n,a){const o=a*a,i=o*(2*a-3)+1,u=o*(a-2)+a,l=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*i+r[0]*u+s[0]*l+n[0]*c,t[1]=e[1]*i+r[1]*u+s[1]*l+n[1]*c,t[2]=e[2]*i+r[2]*u+s[2]*l+n[2]*c,t},inverse:S,len:Z,length:a,lerp:w,max:f,min:y,mul:P,multiply:c,negate:A,normalize:q,random:function(t,e=1){const r=n.Ov,s=2*r()*Math.PI,a=2*r()-1,o=Math.sqrt(1-a*a)*e;return t[0]=Math.cos(s)*o,t[1]=Math.sin(s)*o,t[2]=a*e,t},rotateX:function(t,e,r,s){const n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(s)-n[2]*Math.sin(s),a[2]=n[1]*Math.sin(s)+n[2]*Math.cos(s),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},rotateY:function(t,e,r,s){const n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[2]*Math.sin(s)+n[0]*Math.cos(s),a[1]=n[1],a[2]=n[2]*Math.cos(s)-n[0]*Math.sin(s),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},rotateZ:function(t,e,r,s){const n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0]*Math.cos(s)-n[1]*Math.sin(s),a[1]=n[0]*Math.sin(s)+n[1]*Math.cos(s),a[2]=n[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:m,scaleAndAdd:g,set:i,sign:h,sqrDist:Q,sqrLen:G,squaredDistance:M,squaredLength:_,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:D,subtract:l,transformMat3:I,transformMat4:F,transformQuat:R},Symbol.toStringTag,{value:"Module"}))},63579:(t,e,r)=>{r.d(e,{Bq:()=>u,Qp:()=>i,WN:()=>b,dK:()=>M,eN:()=>y,fH:()=>g,in:()=>f,yr:()=>l});var s=r(78888),n=r(4576),a=r(74887),o=r(20557);class i{constructor(t,e,r){this.assetName=t,this.assetMimeType=e,this.parts=r}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&(0,n.aI)(this.parts,t.parts,((t,e)=>t.equals(e)))}isOnService(t){return this.parts.every((e=>e.isOnService(t)))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(1===e.length)return e[0].toBlob(t);const r=await Promise.all(e.map((e=>e.toBlob(t))));return(0,a.Te)(t),new Blob(r)}}class u{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await(0,s.A)(this.partUrl,{responseType:"blob"});return(0,a.Te)(t),e}}function l(t){return function(t){return!!t&&(Array.isArray(t)?t.some(h):h(t))}(t?.source)}function c(t){return!!Array.isArray(t)&&t.every((t=>t instanceof i))}const p=/^(model\/gltf\+json)|(model\/gltf-binary)$/,d=/\.(gltf|glb)/i;function h(t){if(t instanceof File){const{type:e,name:r}=t;return p.test(e)||d.test(r)}return p.test(t.assetMimeType)||d.test(t.assetName)}function y(t,e){if(!t)return!1;const{source:r}=t;return function(t,e){if(Array.isArray(t)){const r=t;return r.length>0&&r.every((t=>m(t,e)))}return m(t,e)}(r,e)}function f(t,e){if(t===e)return!0;const{source:r}=t,{source:s}=e;if(r===s)return!0;if(c(r)&&c(s)){if(r.length!==s.length)return!1;const t=(t,e)=>t.assetName<e.assetName?-1:t.assetName>e.assetName?1:0,e=[...r].sort(t),n=[...s].sort(t);for(let t=0;t<e.length;++t)if(!e[t].equals(n[t]))return!1;return!0}return!1}function m(t,e){return t instanceof i&&t.isOnService(e)}function g(t,e){return t instanceof File?(0,o.rq)(t,e):(0,o.z$)(t.assetMimeType,t.assetName,e)}function b(t){return Array.isArray(t)?t:[t]}function M(t){return!!t.original}},64714:(t,e,r)=>{r.d(e,{F0:()=>i,Vx:()=>c,e2:()=>d,f:()=>h});var s=r(44208),n=r(4718),a=r(99352),o=r(93470);function i(t){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===t||"esriGeometryMultipoint"===t?o.Cb:"esriGeometryPolyline"===t?o.yM:o.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function c(t,e){if((0,s.A)("esri-csp-restrictions"))return()=>({[e]:null,...t});try{let r=`this${p(e)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const s=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch(r){return()=>({[e]:null,...t})}}function p(t){return u.test(t)?`.${t}`:`["${t}"]`}function d(t={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.o8)(t)}}]}function h(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:a.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:a.P,editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},67026:(t,e,r)=>{r.d(e,{A6:()=>f,Xd:()=>c,Xr:()=>h,hZ:()=>g,lw:()=>p,t2:()=>I,x8:()=>l});var s=r(29242),n=r(82534),a=r(51850),o=r(34304),i=r(38954),u=r(87317);function l(t,e,r){r*=.5;const s=Math.sin(r);return t[0]=s*e[0],t[1]=s*e[1],t[2]=s*e[2],t[3]=Math.cos(r),t}function c(t,e){const r=2*Math.acos(e[3]),s=Math.sin(r/2);return s>(0,o.FD)()?(t[0]=e[0]/s,t[1]=e[1]/s,t[2]=e[2]/s):(t[0]=1,t[1]=0,t[2]=0),r}function p(t,e,r){const s=e[0],n=e[1],a=e[2],o=e[3],i=r[0],u=r[1],l=r[2],c=r[3];return t[0]=s*c+o*i+n*l-a*u,t[1]=n*c+o*u+a*i-s*l,t[2]=a*c+o*l+s*u-n*i,t[3]=o*c-s*i-n*u-a*l,t}function d(t,e,r,s){const n=e[0],a=e[1],i=e[2],u=e[3];let l,c,p,d,h,y=r[0],f=r[1],m=r[2],g=r[3];return c=n*y+a*f+i*m+u*g,c<0&&(c=-c,y=-y,f=-f,m=-m,g=-g),1-c>(0,o.FD)()?(l=Math.acos(c),p=Math.sin(l),d=Math.sin((1-s)*l)/p,h=Math.sin(s*l)/p):(d=1-s,h=s),t[0]=d*n+h*y,t[1]=d*a+h*f,t[2]=d*i+h*m,t[3]=d*u+h*g,t}function h(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function y(t,e){const r=e[0]+e[4]+e[8];let s;if(r>0)s=Math.sqrt(r+1),t[3]=.5*s,s=.5/s,t[0]=(e[5]-e[7])*s,t[1]=(e[6]-e[2])*s,t[2]=(e[1]-e[3])*s;else{let r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);const n=(r+1)%3,a=(r+2)%3;s=Math.sqrt(e[3*r+r]-e[3*n+n]-e[3*a+a]+1),t[r]=.5*s,s=.5/s,t[3]=(e[3*n+a]-e[3*a+n])*s,t[n]=(e[3*n+r]+e[3*r+n])*s,t[a]=(e[3*a+r]+e[3*r+a])*s}return t}function f(t,e,r,s){const n=.5*Math.PI/180;e*=n,r*=n,s*=n;const a=Math.sin(e),o=Math.cos(e),i=Math.sin(r),u=Math.cos(r),l=Math.sin(s),c=Math.cos(s);return t[0]=a*u*c-o*i*l,t[1]=o*i*c+a*u*l,t[2]=o*u*l-a*i*c,t[3]=o*u*c+a*i*l,t}const m=u.c,g=u.s,b=u.g,M=p,_=u.b,A=u.h,S=u.l,q=u.j,x=q,v=u.f,w=v,F=u.n,I=u.a,R=u.e,O=(0,a.vt)(),T=(0,a.fA)(1,0,0),C=(0,a.fA)(0,1,0),E=(0,n.vt)(),D=(0,n.vt)(),P=(0,s.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:b,calculateW:function(t,e){const r=e[0],s=e[1],n=e[2];return t[0]=r,t[1]=s,t[2]=n,t[3]=Math.sqrt(Math.abs(1-r*r-s*s-n*n)),t},conjugate:h,copy:m,dot:A,equals:R,exactEquals:I,fromEuler:f,fromMat3:y,getAxisAngle:c,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,e){const r=e[0],s=e[1],n=e[2],a=e[3],o=r*r+s*s+n*n+a*a,i=o?1/o:0;return t[0]=-r*i,t[1]=-s*i,t[2]=-n*i,t[3]=a*i,t},len:x,length:q,lerp:S,mul:M,multiply:p,normalize:F,random:function(t){const e=o.Ov,r=e(),s=e(),n=e(),a=Math.sqrt(1-r),i=Math.sqrt(r);return t[0]=a*Math.sin(2*Math.PI*s),t[1]=a*Math.cos(2*Math.PI*s),t[2]=i*Math.sin(2*Math.PI*n),t[3]=i*Math.cos(2*Math.PI*n),t},rotateX:function(t,e,r){r*=.5;const s=e[0],n=e[1],a=e[2],o=e[3],i=Math.sin(r),u=Math.cos(r);return t[0]=s*u+o*i,t[1]=n*u+a*i,t[2]=a*u-n*i,t[3]=o*u-s*i,t},rotateY:function(t,e,r){r*=.5;const s=e[0],n=e[1],a=e[2],o=e[3],i=Math.sin(r),u=Math.cos(r);return t[0]=s*u-a*i,t[1]=n*u+o*i,t[2]=a*u+s*i,t[3]=o*u-n*i,t},rotateZ:function(t,e,r){r*=.5;const s=e[0],n=e[1],a=e[2],o=e[3],i=Math.sin(r),u=Math.cos(r);return t[0]=s*u+n*i,t[1]=n*u-s*i,t[2]=a*u+o*i,t[3]=o*u-a*i,t},rotationTo:function(t,e,r){const s=(0,i.e)(e,r);return s<-.999999?((0,i.h)(O,T,e),(0,i.H)(O)<1e-6&&(0,i.h)(O,C,e),(0,i.n)(O,O),l(t,O,Math.PI),t):s>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,i.h)(O,e,r),t[0]=O[0],t[1]=O[1],t[2]=O[2],t[3]=1+s,F(t,t))},scale:_,set:g,setAxes:function(t,e,r,s){const n=P;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=s[0],n[4]=s[1],n[7]=s[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],F(t,y(t,n))},setAxisAngle:l,slerp:d,sqlerp:function(t,e,r,s,n,a){return d(E,e,n,a),d(D,r,s,a),d(t,E,D,2*a*(1-a)),t},sqrLen:w,squaredLength:v,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},72593:(t,e,r)=>{r.r(e),r.d(e,{default:()=>H});var s=r(90237),n=r(92602),a=r(78888),o=r(4576),i=r(49186),u=r(44208),l=r(66552),c=r(92474),p=r(53966),d=r(93637),h=r(74887),y=r(36708),f=r(84952),m=r(13069),g=r(10107),b=r(40608),M=r(5443),_=r(16930),A=r(95696),S=r(27615),q=r(63579),x=r(52106),v=r(83047),w=r(80586),F=r(65864),I=r(73836),R=r(21325),O=r(78628);async function T(t,e,r){const{geometry:s}=e,n={...e.attributes};if(null!=r&&"mesh"===s?.type){const{transformFieldRoles:e}=r,{origin:a,spatialReference:o,vertexSpace:i}=s,u=s.transform??new I.A,l="local"===i.type,c=t.spatialReference,p=c.isGeographic,d=(0,R.aI)(c,o),h=(0,w.isEqualBaseGCS)(o,c)&&(0,w.canProjectWithoutEngine)(o,c);if(!(l&&p&&h||!l&&!p&&d))return null;const y=(0,w.projectWithoutEngine)(a,o,c);if(null==y)return null;if(n[e.originX]=y.x,n[e.originY]=y.y,n[e.originZ]=y.z??0,null!=u){const{translation:t,scale:r,rotation:s}=u,a=l?1:(0,v.KX)(o)/(0,v.KX)(c);n[e.translationX]=t[0]*a,n[e.translationY]=t[2]*a,n[e.translationZ]=-t[1]*a,n[e.scaleX]=r[0],n[e.scaleY]=r[2],n[e.scaleZ]=r[1],n[e.rotationX]=s[0],n[e.rotationY]=s[2],n[e.rotationZ]=-s[1],n[e.rotationDeg]=s[3]}return{attributes:n}}return null==s?{attributes:n}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:n}}async function C(t,e){const r=await Promise.all((e.addAttachments??[]).map((e=>E(t,e)))),s=await Promise.all((e.updateAttachments??[]).map((e=>E(t,e)))),n=e.deleteAttachments??[];return r.length||s.length||n.length?{adds:r,updates:s,deletes:[...n]}:null}async function E(t,e){const{feature:r,attachment:s}=e,{globalId:n,name:a,contentType:o,data:i,uploadId:u}=s,l={globalId:n};if(r&&("attributes"in r?l.parentGlobalId=r.attributes?.[t.globalIdField]:r.globalId&&(l.parentGlobalId=r.globalId)),u)l.uploadId=u;else if(i){const t=await(0,f._0)(i);t&&(l.contentType=t.mediaType,l.data=t.data),i instanceof File&&(l.name=i.name)}return a&&(l.name=a),o&&(l.contentType=o),l}function D(t){const e=!0===t.success?null:t.error||{code:void 0,description:"Feature edit failed"};return{objectId:t.objectId,globalId:t.globalId,error:e?new i.A("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function P(t,e){return new x.A({attributes:t.attributes,geometry:(0,F.rS)({...t.geometry,spatialReference:e})})}function N(t,e){return{adds:t?.adds?.map((t=>P(t,e)))||[],updates:t?.updates?.map((t=>({original:P(t[0],e),current:P(t[1],e)})))||[],deletes:t?.deletes?.map((t=>P(t,e)))||[],spatialReference:e}}var j=r(64714),Q=r(28132),Z=r(60694),G=r(15426),J=r(20557),U=r(99199),k=r(96520),V=r(61956),z=r(64272),B=r(20816);const L=new l.J({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new l.J({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let H=class extends c.A{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=(0,h.sg)((async()=>{await this.load();const t=this.sourceJSON.editingInfo?.lastEditDate;if(null==t)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,r=this._fetchService(e,{...t}).then((()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t))).then((()=>this._ensureLatestMetadata(t)));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([(0,y.wB)((()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null}),(t=>this._handleLastEditsEventChange(t)))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:r,spatialReference:s,fieldsIndex:n,uniqueIdFields:a}=this.layer,o="infoFor3D"in this.layer?this.layer.infoFor3D:null,i="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,l=(0,u.A)("featurelayer-pbf")&&t?.query.supportsFormatPBF&&null==o;return new Q.A({dynamicDataSource:i,fieldsIndex:n,gdbVersion:r,infoFor3D:o,pbfSupported:l,queryAttachmentsSupported:t?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,uniqueIdFields:a,url:e.path})}async addAttachment(t,e){await this.load();const{layer:r}=this;await(0,G.VA)(r,"editing");const s=t.attributes[r.objectIdField],n=r.parsedUrl.path+"/"+s+"/addAttachment",o=this._getLayerRequestOptions(),i=this._getFormDataForAttachment(e,o.query);try{return D((await(0,a.A)(n,{body:i})).data.addAttachmentResult)}catch(t){throw this._createAttachmentErrorResult(s,t)}}async updateAttachment(t,e,r){await this.load();const{layer:s}=this;await(0,G.VA)(s,"editing");const n=t.attributes[s.objectIdField],o=s.parsedUrl.path+"/"+n+"/updateAttachment",i=this._getLayerRequestOptions({query:{attachmentId:e}}),u=this._getFormDataForAttachment(r,i.query);try{return D((await(0,a.A)(o,{body:u})).data.updateAttachmentResult)}catch(t){throw this._createAttachmentErrorResult(n,t)}}async applyEdits(t,e){await this.load();const{layer:r}=this;await(0,G.VA)(r,"editing");const s="infoFor3D"in r?r.infoFor3D:null,n=null!=s,u=n||(e?.globalIdUsed??!1),l=n?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,c=t.addFeatures?.map((t=>T(this.layer,t,s)))??[],p=(await Promise.all(c)).filter(o.Ru),d=t.updateFeatures?.map((t=>T(this.layer,t,s)))??[],h=(await Promise.all(d)).filter(o.Ru),y=function(t,e,r){if(!e||0===e.length)return[];if(r&&(0,O.zp)(e))return e.map((t=>t.globalId));if((0,O.r3)(e))return e.map((t=>t.objectId));const s=r?t.globalIdField:t.objectIdField;return s?e.map((t=>t.getAttribute(s))):[]}(this.layer,t.deleteFeatures,u);(0,k.u)(p,h,r.spatialReference);const f=await C(this.layer,t),m=r.capabilities.editing.supportsAsyncApplyEdits&&n,g=e?.gdbVersion||r.gdbVersion,b={gdbVersion:g,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:m};await(0,B.ZJ)(this.layer.url,g,!0);const M=(0,B.w5)(this.layer.url,g||null);if(await(0,B.We)(r.url,g,r.historicMoment))throw new i.A("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(b.edits=JSON.stringify([{id:r.layerId,adds:p.length?p:null,updates:h.length?h:null,deletes:y.length?y:null,attachments:f,assetMaps:l}]),b.returnServiceEditsOption=L.toJSON(e?.returnServiceEditsOption),b.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(b.adds=p.length?JSON.stringify(p):null,b.updates=h.length?JSON.stringify(h):null,b.deletes=y.length?u?JSON.stringify(y):y.join(","):null,b.attachments=f&&JSON.stringify(f),b.assetMaps=null!=l?JSON.stringify(l):void 0);const _=this._getLayerRequestOptions({method:"post",query:b});M&&(_.authMode="immediate",_.query.returnEditMoment=!0,_.query.sessionId=B.TA);const A=e?.returnServiceEditsOption?r.url:r.parsedUrl.path;let S;try{S=m?await this._asyncApplyEdits(A+"/applyEdits",_):await(0,a.A)(A+"/applyEdits",_)}catch(t){if(!function(t){const e=t.details.raw,r=+e.code,s=+e.extendedCode;return 500===r&&(-2147217144===s||-2147467261===s)}(t))throw t;_.authMode="immediate",S=m?await this._asyncApplyEdits(A+"/applyEdits",_):await(0,a.A)(A+"/applyEdits",_)}return this._createEditsResult(S)}async deleteAttachments(t,e){await this.load();const{layer:r}=this;await(0,G.VA)(r,"editing");const s=t.attributes[r.objectIdField],n=r.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await(0,a.A)(n,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(D)}catch(t){throw this._createAttachmentErrorResult(s,t)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then((async()=>{const e=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:n}=await(0,a.A)(`${s}/${r}`,e),{id:o,extent:i,fullExtent:u,timeExtent:l}=n,c=i||u;return{id:o,fullExtent:c&&M.A.fromJSON(c),timeExtent:l&&z.T.fromJSON({start:l[0],end:l[1]})}}))}async queryAttachments(t,e={}){await this.load();const r=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,r)}async queryFeatures(t,e){await this.load();const r=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});if(t.outStatistics?.length&&r.features.length){const e=new Map;if(r.features.forEach((r=>{const s=r.attributes;t.outStatistics?.forEach((({outStatisticFieldName:t})=>{if(t){const r=t.toLowerCase();r&&r in s&&t!==r&&(s[t]=s[r],delete s[r],e.set(r,t))}}))})),null!=r.fields)for(const t of r.fields){const r=e.get(t.name.toLowerCase());null!=r&&(t.name=r)}}return r}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryAttributeBins(t,e){return await this.load(),this.queryTask.executeAttributeBinsQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!(0,Z.Wo)(this.layer.url))return"unavailable";const t=(0,f.fj)(this.layer.url,"status"),e=await(0,a.A)(t,{query:{f:"json"}});return $.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:s}=await r.e(1384).then(r.bind(r,31384));return s(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(null==t||!("capabilities"in e)||!("effectiveCapabilities"in e))return;if(e.capabilities?.operations?.supportsEditing||!e.effectiveCapabilities?.operations?.supportsEditing)return;const r=e.url;null!=r&&("layerId"in e&&(0,f.fj)(r,e.layerId.toString()),this._getOrCreateEditInterceptor(r).before=e=>{const r=e.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=e.requestOptions.query??{};r._ts=t.getTime(),e.requestOptions.query=r}})}_getOrCreateEditInterceptor(t){return null==this._editInterceptor&&(this._editInterceptor={urls:t},n.A.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&((0,o.TF)(n.A.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const r=(await(0,a.A)(t,e)).data.statusUrl;for(;;){const t=(await(0,a.A)(r,{query:{f:"json"},responseType:"json"})).data;switch(t.status){case"Completed":return(0,a.A)(t.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i.A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i.A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,h.Pl)(X)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};(0,u.A)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await(0,a.A)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const r=t.type;if(!this.supportedSourceTypes.has(r))throw new i.A("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(t,e){if("Table"!==t.type&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const e=(0,j.F0)(t.geometryType).renderer;(0,d.sM)("drawingInfo.renderer",e,t)}if("esriGeometryMultiPatch"===t.geometryType&&t.infoFor3D&&(t.geometryType="mesh"),null==t.extent)try{const{data:r}=await(0,a.A)(this.layer.url,this._getLayerRequestOptions({signal:e}));r.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(t){(0,h.QP)(t)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length)return null;if(await this._areAllAssetsAlreadyMapped(e))return null;const s=t.addFeatures.filter((t=>t.geometry));if(e.length!==s.length+t.updateFeatures.length)throw new i.A("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const n=new Array,a=new Map;for(const t of e){const{geometry:e}=t,{vertexSpace:s}=e;if((0,S.Hq)(s))n.push(e);else{const s=e.origin,{convertMeshVertexSpace:o}=await Promise.all([r.e(3030),r.e(4496)]).then(r.bind(r,28846)),i=await o(e,new A.A({origin:[s.x,s.y,s.z??0]}));a.set(i,e),t.geometry=i,n.push(i)}}await this.uploadAssets(n);for(const[t,e]of a)e.addExternalSources(t.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const n of t){const t=n.geometry,{metadata:a}=t,o=a.getExternalSourcesOnService(s),i=n.getAttribute(r);if(0===o.length){p.A.getLogger(this).error(`Skipping feature ${i}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:u}=o.find(q.dK)??o[0];for(const t of u)1===t.parts.length?e.push({globalId:(0,m.yS)(),parentGlobalId:i,assetName:t.assetName,assetHash:t.parts[0].partHash,flags:[]}):p.A.getLogger(this).error(`Skipping asset ${t.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:r}=this.layer,s=[];let n=null;if(Array.isArray(e))for(const t of e)s.push({id:t.id,editedFeatures:t.editedFeatures}),t.id===r&&(n={addResults:t.addResults??[],updateResults:t.updateResults??[],deleteResults:t.deleteResults??[],attachments:t.attachments,editMoment:t.editMoment});else n=e;const a=function(t){const e=t?.assetMaps;if(e){for(const t of e.addResults)t.success||p.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${t.globalId}.`);for(const t of e.updateResults)t.success||p.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${t.globalId}.`)}const r=t?.attachments,s={addFeatureResults:t?.addResults?.map(D)??[],updateFeatureResults:t?.updateResults?.map(D)??[],deleteFeatureResults:t?.deleteResults?.map(D)??[],addAttachmentResults:r?.addResults?r.addResults.map(D):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(D):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(D):[]};return t?.editMoment&&(s.editMoment=t.editMoment),s}(n);if(s.length>0){a.editedFeatureResults=[];for(const t of s){const{editedFeatures:e}=t,r=e?.spatialReference?new _.A(e.spatialReference):null;a.editedFeatureResults.push({layerId:t.id,editedFeatures:N(e,r)})}}return a}_createAttachmentErrorResult(t,e){const r=e.details.messages?.[0]||e.message,s=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new i.A("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(t,e){const r=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(r)for(const t in e){const s=e[t];null!=s&&(r.set?r.set(t,s):r.append(t,s))}return r}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...t,query:{gdbVersion:s,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:r,parsedUrl:s}=e,n="infoFor3D"in e?e.infoFor3D:null;if(null==n||null==r)return!1;const a=(0,J.JZ)(n);if(null==a)return!1;const i=(0,f.fj)(s.path,`../${a.id}`),u=new Array;for(const e of t){if(!(e.geometry.metadata.getExternalSourcesOnService(s).length>0))return!1;u.push(e)}const l=u.map((t=>t.getAttribute(r))).filter(o.Ru);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=n,d=new V.A({where:`${c} IN (${l.map((t=>`'${t}'`))})`,outFields:[p,c],returnGeometry:!1}),h=await(0,U.s)(i,d),{features:y}=h;return 0!==y.length&&!u.some((t=>{const e=t.getAttribute(r);if(!e)return!0;const{metadata:n}=t.geometry,a=y.filter((t=>t.getAttribute(c)===e));if(0===a.length)return!0;const o=a.map((t=>t.getAttribute(p)));return n.getExternalSourcesOnService(s).flatMap((({source:t})=>t.flatMap((t=>t.parts.map((t=>t.partHash)))))).some((t=>o.every((e=>t!==e))))}))}};(0,s._)([(0,g.MZ)()],H.prototype,"type",void 0),(0,s._)([(0,g.MZ)({constructOnly:!0})],H.prototype,"layer",void 0),(0,s._)([(0,g.MZ)({constructOnly:!0})],H.prototype,"supportedSourceTypes",void 0),(0,s._)([(0,g.MZ)({readOnly:!0})],H.prototype,"queryTask",null),H=(0,s._)([(0,b.$)("esri.layers.graphics.sources.FeatureLayerSource")],H);const X=1e3},73836:(t,e,r)=>{r.d(e,{A:()=>y});var s,n=r(90237),a=r(25482),o=r(10107),i=(r(44208),r(53966),r(87811),r(40608)),u=r(58083),l=r(9093),c=r(67026),p=r(82534),d=r(51850),h=r(24770);let y=class extends a.A{static{s=this}constructor(t){super(t),this.translation=(0,d.vt)(),this.rotationAxis=(0,d.ci)(h.up),this.rotationAngle=0,this.scale=(0,d.fA)(1,1,1)}get rotation(){return(0,h.i4)(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=(0,d.o8)((0,h.yo)(t)),this.rotationAngle=(0,h.g7)(t)}get localMatrix(){const t=(0,l.vt)();return(0,c.x8)(f,(0,h.yo)(this.rotation),(0,h.$I)(this.rotation)),(0,u.o1)(t,f,this.translation,this.scale),t}get localMatrixInverse(){return(0,u.B8)((0,l.vt)(),this.localMatrix)}equals(t){return this===t||null!=t&&(0,u.t2)(this.localMatrix,t.localMatrix)}clone(){const t={translation:(0,d.o8)(this.translation),rotationAxis:(0,d.o8)(this.rotationAxis),rotationAngle:this.rotationAngle,scale:(0,d.o8)(this.scale)};return new s(t)}};(0,n._)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"translation",void 0),(0,n._)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"rotationAxis",void 0),(0,n._)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"rotationAngle",void 0),(0,n._)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"scale",void 0),(0,n._)([(0,o.MZ)()],y.prototype,"rotation",null),(0,n._)([(0,o.MZ)()],y.prototype,"localMatrix",null),(0,n._)([(0,o.MZ)()],y.prototype,"localMatrixInverse",null),y=s=(0,n._)([(0,i.$)("esri.geometry.support.MeshTransform")],y);const f=(0,p.vt)()},82534:(t,e,r)=>{function s(){return[0,0,0,1]}function n(t){return[t[0],t[1],t[2],t[3]]}r.d(e,{o8:()=>n,vt:()=>s,zK:()=>a});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:n,create:s,fromValues:function(t,e,r,s){return[t,e,r,s]}},Symbol.toStringTag,{value:"Module"}))},95696:(t,e,r)=>{r.d(e,{A:()=>c});var s,n=r(90237),a=r(69540),o=r(25482),i=r(10107),u=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);let c=class extends(a.A.ClonableMixin(o.A)){static{s=this}constructor(t){super(t),this.type="georeferenced",this.origin=null}static{this.absolute=new s}};(0,n._)([(0,u.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n._)([(0,i.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=s=(0,n._)([(0,l.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},99352:(t,e,r)=>{r.d(e,{F:()=>s,P:()=>n});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},n={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}}}]);